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žené v:
Podrobná bibliografia
Vydané v:Proceedings (IEEE/ACM International Conference on Software Engineering Companion. Online) s. 226 - 227
Hlavný autor: Xu, Yisen
Médium: Konferenčný príspevok..
Jazyk:English
Vydavateľské údaje: IEEE 27.04.2025
Predmet:
ISSN:2574-1934
On-line prístup:Získať plný text
Tagy: Pridať tag
Žiadne tagy, Buďte prvý, kto otaguje tento záznam!
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/eLvHCXMwlV3PS8MwFA46RDypOPE3OYi3uDbN8lJvY1gU5hj-gN3GmryAIKtsnf77vqRzO3nwVkoL6UvD9-W9fO9j7NoDgQjhgCCy2khyhLGJElOZWlVqA6WP3fUHMBya8TgfrcTqUQuDiPHwGd6Gy1jLd5VdhlRZh6CKEAVoh74NoBux1jqhksnQagV22c2qj2bnsf9yL5plFfxwiOkH5ZUMSZQkSuY3dioRTYr9f47jgLU3ujw-WiPOIdvC2RErnoiUFnd8gPRXRs8hHlW1ohdUUzxkw_1H9b3gRE95b1lXxFHR8X7lkD9j47dDL7XZW3H_2n8QK3cEiqNJapEal-Zelk6pPLHOJ7kF77zLvNLS58brUGIEolBWTiVK7Kalz3RpwGXO2G52zFqzaoYnjCuEkp5xBqdSgdI0W2GnoTGTJaA0p6wdgjD5bBpgTH6__-yP--dsL8Q5FF0kXLBWPV_iJduxX_X7Yn4Vp-0HzFCXUQ
linkProvider IEEE
linkToHtml http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV3PS8MwFA4yRT2pOPG3OYi3uDbNmtTbGCsbdmPohN3GmryAIKtsnf77vqR1O3nwVkoL6UvD9-W9fO8j5N5KBBHEAYZktZLkMKUDweY81CKPlcyt766fydFITafJuBarey0MAPjDZ_DoLn0t3xR67VJlLYQqRBSJO_RdZ51Vy7U2KZWIu2Yrcp881J00W4Pua49VC8s54iDXd9or7tIogRfNbw1VPJ6kR_8cyTFpbpV5dLzBnBOyA4tTkg6RlqZPNAP8L73rEPW6WtZxuinq8uH2o_heUSSotLMuC2SpYGi3MEBfoHLcwZea5C3tTbp9VvsjYCRVULJQmTCxPDdCJIE2Nki0tMaayIqY20TZ2BUZJZIozeccOLTD3EZxrqSJjNLt6Iw0FsUCzgkVIHN8xiiYcyFFjPPl9hoxRDyXwNUFabogzD6rFhiz3--__OP-HTnoT4bZLBuMnq_IoYu5K8FweU0a5XINN2RPf5Xvq-Wtn8If3-6amg
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