MUARF: Leveraging Multi-Agent Workflows for Automated Code Refactoring
Refactoring is crucial for maintaining a project, but it requires developers to understand code structure and system design principles well. Recent research on Large Language Models(LLMs) has shown their great capability for handling complex tasks, making them a possible solution for overcoming thes...
Uloženo v:
| Vydáno v: | Proceedings (IEEE/ACM International Conference on Software Engineering Companion. Online) s. 226 - 227 |
|---|---|
| Hlavní autor: | |
| Médium: | Konferenční příspěvek |
| Jazyk: | angličtina |
| Vydáno: |
IEEE
27.04.2025
|
| Témata: | |
| ISSN: | 2574-1934 |
| On-line přístup: | Získat plný text |
| Tagy: |
Přidat tag
Žádné tagy, Buďte první, kdo vytvoří štítek k tomuto záznamu!
|
| Shrnutí: | Refactoring is crucial for maintaining a project, but it requires developers to understand code structure and system design principles well. Recent research on Large Language Models(LLMs) has shown their great capability for handling complex tasks, making them a possible solution for overcoming these challenges. In this paper, we propose MUARF, an LLM-based solution designed to automate method-level code refactoring, aiming to generate correct, high-quality, and human-like refactored code. MUARF leverages Contextual Retrieval-Augmented Generation to search for similar refactoring samples for few-shot learning, uses Multi-Agent Workflow to simulate the human refactoring process, and integrates advanced software engineering tools (e.g., RefactoringMiner, PurityChecker, StyleChecker) to assist refactoring. Evaluation results show that MUARF achieves a compilation pass rate of 86.5% and a test success rate of 83.8% for the refactored code it generates. Additionally, metrics such as CodeBLEU score and AST Diff accuracy-which compare human-refactored code with the output of MUARF -highlight the generated code is human-like. The ablation results show that RefactoringMiner and Agentware made the greatest contribution to MUARF. |
|---|---|
| ISSN: | 2574-1934 |
| DOI: | 10.1109/ICSE-Companion66252.2025.00071 |