paperbot · PL 论文追踪

全部论文 待读 收藏

P2 RefAgent: A Multi-agent LLM-based Framework for Automatic Software Refactoring

RefAgent:一种基于多智能体 LLM 的自动软件重构框架
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 3/10 · 论文聚焦于用多智能体 LLM 框架自动完成软件重构,属于代码维护与 Agent 工程应用,并不涉及静态分析、形式化验证、浮点或贝叶斯程序分析,也未分析 Agentic 程序本身,与用户核心的 PL×AI 交叉方向关联较弱。引用 13 inbox
Khouloud Oueslati, Maxime Lamothe, Foutse Khomh
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出多智能体 LLM 框架 RefAgent,通过规划、执行、测试与反思迭代自动完成端到端软件重构。

针对传统 LLM 依赖静态指令、难以动态适应重构任务的问题,本文提出 RefAgent——一个基于多智能体 LLM 的端到端软件重构框架。RefAgent 由规划、执行、测试和迭代精化等专用智能体组成,利用自反思与工具调用能力协同完成重构。作者在八个开源 Java 项目上评估,并与单智能体、基于搜索的重构工具及开发者历史重构对比。结果显示:单元测试通过率中位数达 90%,代码坏味中位数减少 52.5%,可复用性等关键质量属性中位数提升 8.6%;识别重构机会的 F1 中位数分别为 79.15% 和 72.7%,且相比单智能体将测试通过率和编译成功率中位数分别提升 64.7% 和 40.1%。

问题
传统基于 LLM 的重构方法依赖静态、详细的任务指令,难以在动态上下文中自主决策并适应重构流程。
方法
RefAgent 采用多智能体架构,由负责规划、执行、测试和迭代精化的专用 LLM 智能体组成,通过自反思与工具调用协同完成端到端重构。
评估
在八个开源 Java 项目上,与单智能体、搜索式重构工具和开发者历史重构进行对比,报告单元测试通过率、代码坏味减少、质量属性提升及重构机会识别的 F1 值。
原文摘要(Abstract)

Recent progress in Large Language Models (LLMs) has influenced various software engineering tasks, including code generation, program repair, and software maintenance. Indeed, in the case of software refactoring, traditional LLMs have shown the ability to reduce development time and enhance code quality. However, these LLMs often rely on static, detailed instructions for specific tasks. In contrast, LLM-based agents can dynamically adapt to evolving contexts and autonomously make decisions by interacting with software tools and executing workflows. In this paper, we explore the potential of LLM-based agents in supporting refactoring activities. Specifically, we introduce RefAgent, a multi-agent LLM-based framework for end-to-end software refactoring. RefAgent consists of specialized agents responsible for planning, executing, testing, and iteratively refining refactorings using self-reflection and tool-calling capabilities. We evaluate RefAgent on eight open-source Java projects, comparing its effectiveness against a single-agent approach, a search-based refactoring tool, and historical developer refactorings. Our results show that RefAgent achieves a median unit test pass rate of 90%, reduces code smells by a median of 52.5%, and improves key quality attributes (e.g., reusability) by a median of 8.6%. Additionally, it closely aligns with developer refactorings and the search-based tool in identifying refactoring opportunities, attaining a median F1-score of 79.15% and 72.7%, respectively. Compared to single-agent approaches, RefAgent improves the median unit test pass rate by 64.7% and the median compilation success rate by 40.1%. These findings highlight the promise of multi-agent architectures in advancing automated software refactoring.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2511-03153,
  title = {RefAgent: A Multi-agent LLM-based Framework for Automatic Software Refactoring},
  author = {Khouloud Oueslati and Maxime Lamothe and Foutse Khomh},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3773153}
}