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...

Celý popis

Uloženo v:
Podrobná bibliografie
Vydáno v:Proceedings (IEEE/ACM International Conference on Software Engineering Companion. Online) s. 226 - 227
Hlavní autor: Xu, Yisen
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!
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 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.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/eLvHCXMwlV3PS8MwFA46RDypOPE3OYi3uDZNm8TbKCsKcwx_sdtokhcQZJWt1X_fJK3byYO3EAgkLwnvy3v53ofQtYwFF4wCAYglYQnTRNqUEcpsZqVgpgy19N7GfDIRs5mcdmT1wIUBgPD5DG59M-TyTaUbHyobOFflPAp3L_RtzrOWrLUOqCTUl1rhu-imq6M5eMifR6S9Vl4PxyF9z7yiPogSBcr8Rk4leJNi_5_zOED9DS8PT9ce5xBtweIIFY8OlBZ3eAzuVAbNIRxYtWToWVPYR8PtR_W9wg6e4mFTVw6jgsF5ZQA_Qau34wb10WsxesnvSaeOQEoqoprEwsTSUmUYk5E2NpKaW2NNYllGnZlt5lOM3EEoTUsKFNJY2SRTgpvECJ0mx6i3qBZwgnAUqRJAaSYhZTbNPOijMrXuLWdAGXWK-t4I88-2AMb8d_1nf_Sfoz1vZ590ofwC9eplA5doR3_V76vlVdi2Hw9ymII
linkProvider IEEE
linkToHtml http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV3PS8MwFA4yRT2pOPG3OYi3uDZNm8TbGCsbdmPolN1Gm7zAQFbZOv33TdK5nTx4C4FA8pLwvryX730I3ctQcMEoEIBQEhYxRaSJGaHMJEYKpnNfS-8948OhmEzkaE1W91wYAPCfz-DRNX0uX5dq5UJlLeuqrEfh9oW-GzNGg5qutQmpRNQVW-H76GFdSbPV77x2SX2xnCKOxfqOe0VdGCXwpPmtoIr3J-nRP2dyjJpbZh4ebXzOCdqB-SlKBxaWpk84A3suveoQ9rxa0na8Kezi4eaj_F5iC1Bxe1WVFqWCxp1SA36BWnHHDmqit7Q77vTIWh-B5FQEFQmFDqWhhWZMBkqbQCputNGRYQm1hjaJSzJyC6IUzSlQiMPCREkhuI60UHF0hhrzcg7nCAdBkQMUikmImYkTB_uojI19zWkodHGBms4I08-6BMb0d_2Xf_TfoYPeeJBNs_7w-QodOpu7FAzl16hRLVZwg_bUVzVbLm79Fv4ALr2byQ
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