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智能体在软件开发中的核心价值在于其扩展开发者推理与行动能力的作用,而非取代人类参与。为展示如何运用智能体与开发者协同工作,我们设计了一种实现协同重命名的新方法。协同重命名——即单一重命名重构触发多个相关标识符的连锁重构——是频繁出现却极具挑战性的任务。开发者需要跨大量文件与上下文手动传播这些重命名重构,该过程既繁琐又极易出错。当前最先进的基于启发式方法会产生大量误报,而原始大语言模型(LLMs)因上下文有限且无法与重构工具交互,仅能提供不完整的建议。这导致开发者要么获得不完整的重构结果,要么被迫筛选过多误报。协同重命名正是智能体能在保持开发者主导地位的同时显著减轻其负担的重复性任务。我们设计、实现并评估了首个自动化协同重命名的多智能体框架。其核心洞见在于:开发者的初始重构行为是推断相关重构范围的线索。我们的范围推断智能体首先将此线索转化为显式的自然语言声明范围。计划执行智能体随后将其作为严格计划,识别需要重构的程序元素,并通过调用集成开发环境自身可信的重构API安全执行变更。最后,复制智能体以此指导项目级全局搜索。我们首先对100个开源项目中609K次提交的协同重命名实践进行了形成性研究,并调研了205位开发者……