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...
Saved in:
| Published in: | Proceedings (IEEE/ACM International Conference on Software Engineering Companion. Online) pp. 226 - 227 |
|---|---|
| Main Author: | |
| Format: | Conference Proceeding |
| Language: | English |
| Published: |
IEEE
27.04.2025
|
| Subjects: | |
| ISSN: | 2574-1934 |
| Online Access: | Get full text |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| Abstract | 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. |
|---|---|
| AbstractList | 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. |
| Author | Xu, Yisen |
| Author_xml | – sequence: 1 givenname: Yisen surname: Xu fullname: Xu, Yisen email: yisen.xu@mail.concordia.ca organization: Gina Cody School of Engineering and Computer, Science Concordia University,Montreal,Canada |
| BookMark | eNotkM1OwkAURkejiYh9AxezclecufPvrmlASSAmKHFJpp07pAod0haJby-Jrr7NOWfx3ZKrNrVIyANnE86Ze5yXb9O8TPuDb5vUag0KJsBATRhjhl-QzBlnheBKaCv4JRmBMjLnTsgbkvX95xkTwIR0ZkRmy3Wxmj3RBX5j57dNu6XL425o8mKL7UA_UvcVd-nU05g6WhyHtPcDBlqmgHSF0ddD6s7SHbmOftdj9r9jsp5N38uXfPH6PC-LRe7BsiHnNnAXoQpSOlaHyFxtYohBRKkhOhs1E1oa5lQNHhBQ8SoKXVkTRLC1EmNy_9dtEHFz6Jq9734251dAgmHiFyoVUgY |
| CODEN | IEEPAD |
| ContentType | Conference Proceeding |
| DBID | 6IE 6IL CBEJK RIE RIL |
| DOI | 10.1109/ICSE-Companion66252.2025.00071 |
| DatabaseName | IEEE Electronic Library (IEL) Conference Proceedings IEEE Proceedings Order Plan All Online (POP All Online) 1998-present by volume IEEE Xplore All Conference Proceedings IEEE Electronic Library (IEL) IEEE Proceedings Order Plans (POP All) 1998-Present |
| DatabaseTitleList | |
| Database_xml | – sequence: 1 dbid: RIE name: IEEE Electronic Library (IEL) url: https://ieeexplore.ieee.org/ sourceTypes: Publisher |
| DeliveryMethod | fulltext_linktorsrc |
| EISBN | 9798331536831 |
| EISSN | 2574-1934 |
| EndPage | 227 |
| ExternalDocumentID | 11024270 |
| Genre | orig-research |
| GroupedDBID | 6IE 6IF 6IL 6IN AAJGR AAWTH ABLEC ADZIZ ALMA_UNASSIGNED_HOLDINGS BEFXN BFFAM BGNUA BKEBE BPEOZ CBEJK CHZPO IEGSK OCL RIE RIL |
| ID | FETCH-LOGICAL-a280t-18d19f2bd4490cdf09c7fdfd3f462f98f603647095c2a2e2e51bf36b87d3d8c53 |
| IEDL.DBID | RIE |
| ISICitedReferencesCount | 0 |
| ISICitedReferencesURI | http://www.webofscience.com/api/gateway?GWVersion=2&SrcApp=Summon&SrcAuth=ProQuest&DestLinkType=CitingArticles&DestApp=WOS_CPL&KeyUT=001554070400059&url=https%3A%2F%2Fcvtisr.summon.serialssolutions.com%2F%23%21%2Fsearch%3Fho%3Df%26include.ft.matches%3Dt%26l%3Dnull%26q%3D |
| IngestDate | Wed Jun 18 06:01:38 EDT 2025 |
| IsPeerReviewed | false |
| IsScholarly | true |
| Language | English |
| LinkModel | DirectLink |
| MergedId | FETCHMERGED-LOGICAL-a280t-18d19f2bd4490cdf09c7fdfd3f462f98f603647095c2a2e2e51bf36b87d3d8c53 |
| PageCount | 2 |
| ParticipantIDs | ieee_primary_11024270 |
| PublicationCentury | 2000 |
| PublicationDate | 2025-April-27 |
| PublicationDateYYYYMMDD | 2025-04-27 |
| PublicationDate_xml | – month: 04 year: 2025 text: 2025-April-27 day: 27 |
| PublicationDecade | 2020 |
| PublicationTitle | Proceedings (IEEE/ACM International Conference on Software Engineering Companion. Online) |
| PublicationTitleAbbrev | ICSE-COMPANION |
| PublicationYear | 2025 |
| Publisher | IEEE |
| Publisher_xml | – name: IEEE |
| SSID | ssj0003203497 |
| Score | 2.289756 |
| Snippet | Refactoring is crucial for maintaining a project, but it requires developers to understand code structure and system design principles well. Recent research on... |
| SourceID | ieee |
| SourceType | Publisher |
| StartPage | 226 |
| SubjectTerms | Code Refactoring Codes Contextual Retrieval-Augmented Generation Few shot learning Large Language Model Large language models Measurement Multi-Agent Communication Prompt engineering Retrieval augmented generation Software engineering System analysis and design |
| Title | MUARF: Leveraging Multi-Agent Workflows for Automated Code Refactoring |
| URI | https://ieeexplore.ieee.org/document/11024270 |
| WOSCitedRecordID | wos001554070400059&url=https%3A%2F%2Fcvtisr.summon.serialssolutions.com%2F%23%21%2Fsearch%3Fho%3Df%26include.ft.matches%3Dt%26l%3Dnull%26q%3D |
| hasFullText | 1 |
| inHoldings | 1 |
| isFullTextHit | |
| isPrint | |
| link | http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV3PS8MwFA46RDypOPE3OYi3uDRpm9TbGCsKOoY_YLfRJO-BIKtsnf77JuncTh68hUIgTfL4vr7X732EXFdSg0xRMJdpZCnonBkuLYO0AkQjPWKbaDahRiM9mRTjlVg9amEAIP58BrdhGGv5rrbLkCrreajyiKL8F_q2Unkr1lonVKQIrVbULrlZ9dHsPQxehqwNq-CH45l-UF6JkEThUTK_sVOJaFLu_3MdB6S70eXR8RpxDskWzI5I-eRJaXlHH8Hfyug5RKOqlvWDaoqGbDh-1N8L6ukp7S-b2nNUcHRQO6DP0Prt-Eld8lYOXwf3bOWOwCqhecMS7ZIChXFpWnDrkBdWoUMnMc0FFhrzUGJUnkJZUQkQkCUGZW60ctJpm8lj0pnVMzghVCTWT0fMROp8QIvCmsz6wLcVR4Ncn5Ju2ITpZ9sAY_r7_md_PD8ne2GfQ9FFqAvSaeZLuCQ79qt5X8yv4rH9AP95mUU |
| linkProvider | IEEE |
| linkToHtml | http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV3PS8MwFA4yRT2pOPG3OYi3uDZJ29TbGCsbbmPohN1Gm7wHgqyydfrvm6RzO3nwFgqBNMnj-_pev_cRcp8LBUIiZyZSyCSomBWB0AxkDoiFsIhdeLOJZDRS02k6XovVvRYGAPzPZ_Dohr6Wb0q9cqmyloUqiyiJ_ULfjaTkQS3X2qRUBHfNVpJ98rDupNnqd167rA4s54hjub7TXnGXRgm8aH5rqOLxJDv650qOSXOrzKPjDeackB2Yn5JsaGlp9kQHYO-ldx2iXlfL2k43RV0-HD_K7yW1BJW2V1VpWSoY2ikN0BeoHXfspCZ5y7qTTo-t_RFYzlVQsVCZMEVeGCnTQBsMUp2gQSNQxhxThbErMiaWRGmec-AQhQWKuFCJEUbpSJyRxrycwzmhPNR2OmLEpbEhzVNdRNqGvs4DLDBQF6TpNmH2WbfAmP2-_-Ufz-_IQW8yHMwG_dHzFTl0e-5KMDy5Jo1qsYIbsqe_qvfl4tYf4Q8p65yM |
| openUrl | ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=proceeding&rft.title=Proceedings+%28IEEE%2FACM+International+Conference+on+Software+Engineering+Companion.+Online%29&rft.atitle=MUARF%3A+Leveraging+Multi-Agent+Workflows+for+Automated+Code+Refactoring&rft.au=Xu%2C+Yisen&rft.date=2025-04-27&rft.pub=IEEE&rft.eissn=2574-1934&rft.spage=226&rft.epage=227&rft_id=info:doi/10.1109%2FICSE-Companion66252.2025.00071&rft.externalDocID=11024270 |