Teaching Code Refactoring Using LLMs
Not on the map. Why?
Abstract (arXiv)
This Innovative Practice full paper explores how Large Language Models (LLMs) can enhance the teaching of code refactoring in software engineering courses through real-time, context-aware feedback. Refactoring improves code quality but is difficult to teach, especially with complex, real-world codebases. Traditional methods like code reviews and static analysis tools offer limited, inconsistent feedback. Our approach integrates LLM-assisted refactoring into a course project using structured prompts to help students identify and address code smells such as long methods and low cohesion. Implemented in Spring 2025 in a long-lived OSS project, the intervention is evaluated through student feedback and planned analysis of code quality improvements. Findings suggest that LLMs can bridge theoretical and practical learning, supporting a deeper understanding of maintainability and refactoring principles.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 7 of its 31 references that are in the map. First posted on arXiv 12 Aug 2025.
Builds on
7 of 31 references.
References · 7
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 358
- 2018An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translationcited by 108
- 2019Pythia: AI-assisted Code Completion Systemcited by 55
- 2023How Effective Are Neural Networks for Fixing Security Vulnerabilitiescited by 52
- 2016Why We Refactor? Confessions of GitHub Contributorscited by 10
- 2024Refactoring to Pythonic Idioms: A Hybrid Knowledge-Driven Approach Leveraging Large Language Modelscited by 3
Built on by
Not cited yet.