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

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Proceedings (IEEE/ACM International Conference on Software Engineering Companion. Online) S. 226 - 227
1. Verfasser: Xu, Yisen
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 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/eLvHCXMwlV3PS8MwFA46RDypOPE3OYi3uC7pksbbGCsKcwx_sdtIkxcQZJWt1X_fl3RuJw_eQiClSdO-L-_1-z5CroUMoiN4yMHPv2Op4IIZaxXDzYEBvnBWRi29t5Eaj7PpVE9WZPXIhQGA-PMZ3IZmrOW70tYhVdbBUIWXVHhC31ZKNmStdUJF8CC1onbJzUpHs_MweB6y5rUKfjiI9APziockShIp8xs7lRhN8v1_3scBaW94eXSyjjiHZAvmRyR_RFCa39ER4K6MnkM0smpZP7CmaMiG-4_ye0kRntJ-XZWIUcHRQemAPkHjt4OD2uQ1H74M7tnKHYEZniUV62auqz0vXJrqxDqfaKu88074VHKvMy9DiVEhhLLccODQ6xZeyCJTTrjM9sQxac3LOZwQqo0vpLFcmMSliCALYXQmhZMqtcIqOCXtsAizz0YAY_Y7_7M_-s_JXljnUHTh6oK0qkUNl2THflXvy8VVfGw_6aeXyw
linkProvider IEEE
linkToHtml http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV3PT8IwGG0MGvWkRoy_7cF4q4y2tKs3QlggDkIUDTey9UdCYpiBof--XzuEkwdvTZMua9fte_2-vfcQumfCi47AIQc-_4ZwRhnJtJYENgcE-NxoEbT03lM5HMaTiRqtyeqBC2OtDT-f2UffDLV8U-iVT5U1IFTBJSWc0HdbnNOoomttUiqMerEVuY8e1kqajX7ntUuqF8s74gDW99wr6tMoUSDNbw1VQjxJjv55J8eovmXm4dEm5pygHTs_RckAYGnyhFML-zK4DuHAqyVtz5vCPh_uPorvJQaAitursgCUag3uFMbiF1s57sCgOnpLuuNOj6z9EUhG46gkzdg0laO54VxF2rhIaemMM8xxQZ2KnfBFRgkgStOMWmpbzdwxkcfSMBPrFjtDtXkxt-cIq8zlItOUZZHhgCFzlqlYMCMk10xLe4HqfhGmn5UExvR3_pd_9N-hg954kE7T_vD5Ch36NfclGCqvUa1crOwN2tNf5Wy5uA2P8Af_VpsS
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