RefAgent: A Multi-agent LLM-based Framework for Automatic Software Refactoring
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Large Language Models (LLMs) have substantially influenced various software engineering tasks. Indeed, in the case of software refactoring, traditional LLMs have shown the ability to reduce development time and enhance code quality. However, these LLMs often rely on static, detailed instructions for specific tasks. In contrast, LLM-based agents can dynamically adapt to evolving contexts and autonomously make decisions by interacting with software tools and executing workflows. In this paper, we explore the potential of LLM-based agents in supporting refactoring activities. Specifically, we introduce RefAgent, a multi-agent LLM-based framework for end-to-end software refactoring. RefAgent consists of specialized agents responsible for planning, executing, testing, and iteratively refining refactorings using self-reflection and tool-calling capabilities. We evaluate RefAgent on eight open-source Java projects, comparing its effectiveness against a single-agent approach, a search-based refactoring tool, and historical developer refactorings. Our assessment focuses on: (1) the impact of generated refactorings on software quality, (2) the ability to identify refactoring opportunities, and (3) the contribution of each LLM agent through an ablation study. Our results show that RefAgent achieves a median unit test pass rate of 90%, reduces code smells by a median of 52.5%, and improves key quality attributes (e.g., reusability) by a median of 8.6%. Additionally, it closely aligns with developer refactorings and the search-based tool in identifying refactoring opportunities, attaining a median F1-score of 79.15% and 72.7%, respectively. Compared to single-agent approaches, RefAgent improves the median unit test pass rate by 64.7% and the median compilation success rate by 40.1%. These findings highlight the promise of multi-agent architectures in advancing automated software refactoring.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 14 of its 57 references that are in the map. First posted on arXiv 5 Nov 2025.
Builds on
14 of 57 references.
Closest ancestors · 4
Same direction, newest first
- 2024Human-In-the-Loop Software Development Agents19 Nov
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep
- 2024Agentless: Demystifying LLM-based Software Engineering Agents1 Jul
- 2024MASAI: Modular Architecture for Software-engineering AI Agents17 Jun
Other references · 10
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2024A Survey on LLM-as-a-Judgecited by 1,423
- 2024Alibaba LingmaAgent: Improving Automated Issue Resolution via Comprehensive Repository Explorationcited by 58
- 2024AutoSafeCoder: A Multi-Agent Framework for Securing LLM Code Generation through Static Analysis and Fuzz Testingcited by 35
- 2024Hybrid Automated Program Repair by Combining Large Language Models and Program Analysiscited by 22
- 2024An Empirical Study on the Code Refactoring Capability of Large Language Modelscited by 19
- 2020Code Smells and Refactoring: A Tertiary Systematic Review of Challenges and Observationscited by 18
- 2023Fixing Large Language Models' Specification Misunderstanding for Better Code Generationcited by 17
- 202020-MAD -- 20 Years of Issues and Commits of Mozilla and Apache Developmentcited by 3
- 2021On Preserving the Behavior in Software Refactoring: A Systematic Mapping Studycited by 1
Built on by
Citing papers per year: 2026: 8.
8 papers.
- 2026Harness-of-Harness: Multi-Day Autonomous Software Development with Continual Improvementcited by 4
- 2026SmellBench: Evaluating LLM Agents on Architectural Code Smell Repaircited by 3
- 2026A Multi-agent AI System for Deep Learning Model Migration from TensorFlow to JAXcited by 2
- 2026Lean Refactor: Multi-Objective Controllable Proof Optimization via Agentic Strategy Searchcited by 1
- 2026SWE-NFI: Studying and Benchmarking Coding Agents for Non-Functional Improvementscited by 1
- 2026REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoringcited by 0
- 2026Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebasecited by 0
- 2026Concealing LLM-Based Multi-Agent Topology via Phantom Structure Injectioncited by 0
- 2026Concealing LLM-Based Multi-Agent Topology via Phantom Structure Injection29 Sep 2026
- 2026Harness-of-Harness: Multi-Day Autonomous Software Development with Continual Improvement1 Sep 2026
- 2026Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebase29 Aug 2026
- 2026REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoring21 Aug 2026
- 2026SWE-NFI: Studying and Benchmarking Coding Agents for Non-Functional Improvements29 Jul 2026
- 2026Lean Refactor: Multi-Objective Controllable Proof Optimization via Agentic Strategy Search18 May 2026
- 2026SmellBench: Evaluating LLM Agents on Architectural Code Smell Repair7 May 2026
- 2026A Multi-agent AI System for Deep Learning Model Migration from TensorFlow to JAX28 Mar 2026
Similar, not cited
Close in wording, no citation either way
- 2025MANTRA: Enhancing Automated Method-Level Refactoring with Contextual RAG and Multi-Agent LLM Collaboration
- 2026RefactorAssist: Agentic Refinement for Reliable Code Refactoring
- 2025Agentic Refactoring: An Empirical Study of AI Coding Agents
- 2026"Refactoring Runaway": Understanding and Mitigating Tangled Refactorings in Coding Agents for Issue Resolution
- 2026CodeTaste: Can LLMs Generate Human-Level Code Refactorings?
- 2025LLM-based Multi-Agent System for Intelligent Refactoring of Haskell Code
- 2026Developing LLM-based Multi-Agent Systems in Software Engineering: A Mixed-Method Experience Report
- 2026How do Agents Refactor: An Empirical Study