RefAgent: A Multi-agent LLM-based Framework for Automatic Software Refactoring
Khouloud Oueslati, Maxime Lamothe, Foutse Khomh

TL;DR
RefAgent introduces a multi-agent LLM framework that autonomously performs software refactoring, significantly improving code quality, refactoring accuracy, and alignment with developer practices across multiple open-source Java projects.
Contribution
This paper presents the novel RefAgent framework, a multi-agent LLM-based system that automates software refactoring with dynamic decision-making, self-reflection, and tool integration, outperforming single-agent and traditional methods.
Findings
RefAgent achieves a median 90% unit test pass rate.
Reduces code smells by a median of 52.5%.
Attains a median F1-score of 79.15% in identifying refactoring opportunities.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Engineering Techniques and Practices · Software Testing and Debugging Techniques
