When LLM-Generated Refactorings Ripple: An Empirical Study of Repository Adoption Readiness
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) are increasingly used to refactor source files, but file-local evaluations do not reveal changes to contracts, dependencies, or caller assumptions affecting repository adoption. To address this gap, we conduct 1,500 generation attempts across 150 production files from 15 open-source Java repositories, five LLM configurations, and two dependency-aware generation conditions: single-prompt refactoring and LangGraph-based multi-agent refactoring. Of these attempts, 1,455 yield complete candidates eligible for analysis. We evaluate these candidates using local changes, repository-facing structural indicators, detected caller impact, the behavioural-equivalence indicator, and available test evidence, and categorize them as Low-risk, Review-needed, High Contract/Dependency Risk, or Inconclusive. The results show that 1,365 candidates (93.8%) are classified as High Contract/Dependency Risk, whereas 106 (7.3%) have at least one detected broken downstream caller and 290 (19.9%) have a false behavioural-equivalence indicator; only eight satisfy the Low-risk criteria. Within the reason-covered subset, the High-risk rate decreases under more conservative dependency-delta thresholds, while 60 of the 65 candidates with conclusive targeted-test outcomes pass, including 50 classified as High risk. Paired analyses of 705 complete pairs identify no statistically significant generation-condition difference in the principal risk indicators, although model configurations differ in specific detected risk channels. These findings suggest that practitioners should treat LLM-generated refactorings as candidates requiring staged repository-level verification, while future research should validate screening and extraction precision and strengthen compilation, behavioural, and coordinated multi-file verification.
Key facts. No citing papers in the map yet (data through 26 Nov 2026). Builds on 11 of its 36 references that are in the map. Submitted 17 Oct 2026.
Builds on
11 of 36 references.
References · 11
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 424
- 2023CodePlan: Repository-level Coding using LLMs and Planningcited by 152
- 2023Refactoring Programs Using Large Language Models with Few-Shot Examplescited by 29
- 2024On the Impacts of Contexts on Repository-Level Code Generationcited by 25
- 2024An Empirical Study on the Code Refactoring Capability of Large Language Modelscited by 21
- 2026SWE-Refactor: A Repository-Level Benchmark for Real-World LLM-Based Code Refactoringcited by 17
- 2024An Empirical Study on the Potential of LLMs in Automated Software Refactoringcited by 12
- 2025MANTRA: Enhancing Automated Method-Level Refactoring with Contextual RAG and Multi-Agent LLM Collaborationcited by 12
- 2025RefAgent: A Multi-agent LLM-based Framework for Automatic Software Refactoringcited by 9
- 2026SmellBench: Evaluating LLM Agents on Architectural Code Smell Repaircited by 4
- 2026SmellBench: Towards Fine-Grained Evaluation of Code Agents on Refactoring Taskscited by 3
Built on by
Not cited yet.