mlsanityData to 14 Oct 2026

An Empirical Study on the Code Refactoring Capability of Large Language Models

arXiv 2411.02320 ↗First posted 4 Nov 2024cs.SEcited by 19

Not on the map. Why?

Abstract (arXiv)

Large Language Models (LLMs) have shown potential to enhance software development through automated code generation and refactoring, reducing development time and improving code quality. This study empirically evaluates StarCoder2, an LLM optimized for code generation, in refactoring code across 30 open-source Java projects. We compare StarCoder2's performance against human developers, focusing on (1) code quality improvements, (2) types and effectiveness of refactorings, and (3) enhancements through one-shot and chain-of-thought prompting. Our results indicate that StarCoder2 reduces code smells by 20.1% more than developers, excelling in systematic issues like Long Statement and Magic Number, while developers handle complex, context-dependent issues better. One-shot prompting increases the unit test pass rate by 6.15% and improves code smell reduction by 3.52%. Generating five refactorings per input further increases the pass rate by 28.8%, suggesting that combining one-shot prompting with multiple refactorings optimizes performance. These findings provide insights into StarCoder2's potential and best practices for integrating LLMs into software refactoring, supporting more efficient and effective code improvement in real-world applications.

Key facts. Cited by 19 papers in the map (data through 14 Oct 2026). First posted on arXiv 4 Nov 2024.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 10; 2026: 9.

19 papers.

Sort:

By area:

  1. 2025Large Language Models (LLMs) for Source Code Analysis: applications, models and datasetscited by 16
  2. 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
  3. 2025RefAgent: A Multi-agent LLM-based Framework for Automatic Software Refactoringcited by 8
  4. 2026CodeTaste: Can LLMs Generate Human-Level Code Refactorings?cited by 8
  5. 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoringcited by 6
  6. 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Biascited by 3
  7. 2026SmellBench: Evaluating LLM Agents on Architectural Code Smell Repaircited by 3
  8. 2025Optimizing Token Consumption in LLMs: A Nano Surge Approach for Code Reasoning Efficiencycited by 2
  9. 2025Taxonomy of migration scenarios for Qiskit refactoring using LLMscited by 2
  10. 2025Can LLMs Replace Humans During Code Chunking?cited by 2
  11. 2025Refactoring with LLMs: Bridging Human Expertise and Machine Understandingcited by 2
  12. 2025A Blueprint for AI-Driven Software Quality: Integrating LLMs with Established Standardscited by 1
7 more
  1. 2025Automatic Qiskit Code Refactoring Using Large Language Modelscited by 1
  2. 2026TAM-Eval: Evaluating LLMs for Automated Unit Test Maintenancecited by 0
  3. 2026AI-Assisted Unit Test Writing and Test-Driven Code Refactoring: A Case Studycited by 0
  4. 2026Structural Anchors and Reasoning Fragility:Understanding CoT Robustness in LLM4Codecited by 0
  5. 2026An Exploratory Case Study of LLM-Assisted Refactoring and Gameplay Feature Generation in an Endless Runner Gamecited by 0
  6. 2026SDAD: Spec-Driven Agentic Development for the AI-Native SDLCcited by 0
  7. 2026REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoringcited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2024Rethinking Code Refinement: Learning to Judge Code Efficiency
  2. 2026RefactorAssist: Agentic Refinement for Reliable Code Refactoring
  3. 2025MANTRA: Enhancing Automated Method-Level Refactoring with Contextual RAG and Multi-Agent LLM Collaboration
  4. 2024The Impact of Prompt Programming on Function-Level Code Generation
  5. 2025Evaluating the Effectiveness of Small Language Models in Detecting Refactoring Bugs
  6. 2025Evaluating Large Language Models for Functional and Maintainable Code in Industrial Settings: A Case Study at ASML
  7. 2025FeedbackEval: A Benchmark for Evaluating Large Language Models in Feedback-Driven Code Repair Tasks
  8. 2026SmellBench: Towards Fine-Grained Evaluation of Code Agents on Refactoring Tasks