arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.00482cs.SEcs.AI
收藏

多智能体协同重命名重构

Multi-Agent Coordinated Rename Refactoring

University of Colorado(科罗拉多大学);Tulane University(路易斯安那大学);University of Texas at Dallas(德克萨斯大学达拉斯分校);NEC Corporation(日本电气通信事业株式会社);NEC Laboratories America(NEC美国实验室);JetBrains Research(JetBrains研究)
Abhiram Bellur, Mohammed Raihan Ullah, Dima Golubenko, Fraol Batole, Mohit Kansara, Masaharu Morimoto, Kai Ishikawa, Haifeng Chen, Yaroslav Zharov, Timofey Bryk… 展开作者

Abhiram Bellur, Mohammed Raihan Ullah, Dima Golubenko, Fraol Batole, Mohit Kansara, Masaharu Morimoto, Kai Ishikawa, Haifeng Chen, Yaroslav Zharov, Timofey Bryksin, Tien N. Nguyen, Hridesh Rajan, Danny Dig

AI总结:

本文提出了一种多智能体框架,通过协同重命名重构自动化减少开发者负担,提升重构效率。

摘要:

人工智能代理在软件开发中的主要价值在于其扩展开发者推理和行动能力的能力,而不是取代人类参与。为了展示如何利用代理与开发者协同工作,我们设计了一种新的方法来进行协同重命名。协同重命名,即单个重命名重构触发多个相关标识符的重构,是一种频繁但具有挑战性的任务。开发者必须手动在众多文件和上下文中传播这些重命名重构,这一过程既繁琐又高度容易出错。最先进的启发式方法会产生大量的假阳性结果,而普通的大型语言模型(LLMs)由于上下文有限和无法与重构工具交互,提供不完整的建议。这使开发者要么得到不完整的重构,要么不得不过滤太多假阳性结果。协同重命名正是那种代理可以显著减轻开发者负担而仍保持其主导地位的重复性任务。我们设计、实现并评估了第一个自动执行协同重命名的多代理框架。它基于一个关键洞察:开发者的初始重构是一个线索,可用于推断相关重构的范围。我们的范围推断代理首先将这个线索转换为显式的、自然语言的声明性范围。然后,计划执行代理利用这个作为严格计划来识别应进行重构的程序元素,并通过调用IDE自身的可信重构API安全地执行更改。最后,复制代理使用它来指导项目范围内的搜索。我们首先在100个开源项目的609,000个提交中对协同重命名的实践进行了形成性研究,并调查了205名开发者...

英文摘要:

The primary value of AI agents in software development lies in their ability to extend the developer's capacity for reasoning and action, not to supplant human involvement. To showcase how to use agents working in tandem with developers, we designed a novel approach for carrying out coordinated renaming. Coordinated renaming, where a single rename refactoring triggers refactorings in multiple, related identifiers, is a frequent yet challenging task. Developers must manually propagate these rename refactorings across numerous files and contexts, a process that is both tedious and highly error-prone. State-of-the-art heuristic-based approaches produce an overwhelming number of false positives, while vanilla Large Language Models (LLMs) provide incomplete suggestions due to their limited context and inability to interact with refactoring tools. This leaves developers with incomplete refactorings or burdens them with filtering too many false positives. Coordinated renaming is exactly the kind of repetitive task that agents can significantly reduce the developers' burden while keeping them in the driver's seat. We designed, implemented, and evaluated the first multi-agent framework that automates coordinated renaming. It operates on a key insight: a developer's initial refactoring is a clue to infer the scope of related refactorings. Our Scope Inference Agent first transforms this clue into an explicit, natural-language Declared Scope. The Planned Execution Agent then uses this as a strict plan to identify program elements that should undergo refactoring and safely executes the changes by invoking the IDE's own trusted refactoring APIs. Finally, the Replication Agent uses it to guide the project-wide search. We first conducted a formative study on the practice of coordinated renaming in 609K commits in 100 open-source projects and surveyed 205 developers ...

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑