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...
Gespeichert in:
| Veröffentlicht in: | Proceedings (IEEE/ACM International Conference on Software Engineering Companion. Online) S. 226 - 227 |
|---|---|
| 1. Verfasser: | |
| Format: | Tagungsbericht |
| Sprache: | Englisch |
| Veröffentlicht: |
IEEE
27.04.2025
|
| Schlagworte: | |
| ISSN: | 2574-1934 |
| Online-Zugang: | Volltext |
| Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
| 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 Xplore POP ALL IEEE Xplore All Conference Proceedings IEEE/IET Electronic Library (IEL) (UW System Shared) 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.2896597 |
| 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/eLvHCXMwlV1dS8MwFA06RHxSceI3eRDf4tqkTVLfxlhR0DH8gL2NJrkBQVbZOv373qRze_LBt1BIafPBObk35x5CrrVBziF1xlxlcjygGMsqAZYBgrFOjHQiraLZhBqN9GRSjFdi9aiFAYB4-QxuQzPm8l1tlyFU1kOoQkRReELfVkq2Yq11QEXwUGpF7ZKbVR3N3sPgZcjabRX8cJDpB-UVD0GUJErmN3YqEU3K_X9-xwHpbnR5dLxGnEOyBbMjUj4hKS3v6CPgqoyeQzSqalk_qKZoiIb7j_p7QZGe0v6yqZGjgqOD2gF9htZvBzt1yVs5fB3cs5U7Aqu4ThqWapcWnhuXZUVinU8Kq7zzTvhMcl9oL0OKUSGFsrziwCFPjRfSaOWE0zYXx6Qzq2dwQihuQ6tTAaCQHjktdeINl7lyKZJDfNMp6YZBmH62BTCmv_9_9sfzc7IXxjkkXbi6IJ1mvoRLsmO_mvfF_CpO2w_sDpga |
| linkProvider | IEEE |
| linkToHtml | http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV1NSwMxEA1SRT2pWPHbHMRb7G72I1lvpXRpsS1FK_RWNskEBOlKu9W_7yRb25MHb2Ehy24-eC8zefMIuZcKOUcqY2YKleABRWlWRKAZIBjLQKUmCgtvNiFGIzmdZuO1WN1rYQDAXz6DR9f0uXxT6pULlbUQqhBRBJ7Qd5M45kEt19qEVCLuiq2IffKwrqTZ6ndeu6zeWM4RB7m-015xF0YJvGh-a6ji8SQ_-ueXHJPmVplHxxvMOSE7MD8l-RBpaf5EB4Dr0rsOUa-rZW2nm6IuHm4_yu8lRYJK26uqRJYKhnZKA_QFascd7NQkb3l30umxtT8CK7gMKhZKE2aWKxPHWaCNDTItrLEmsnHKbSZt6pKMAkmU5gUHDkmobJQqKUxkpE6iM9KYl3M4JxQ3opZhBCCQIBmZysAqnibChEgP8U0XpOkGYfZZl8CY_f7_5R_P78hBbzIczAb90fMVOXRj7lIwXFyTRrVYwQ3Z01_V-3Jx66fwBwe8m2E |
| 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 |