Software development agents such as Claude Code, GitHub Copilot, Cursor Agent, Devin, and OpenAI Codex are being increasingly integrated into developer workflows. While prior work has evaluated agent capabilities for code completion and task automation, there is little work investigating how these agents perform Java refactoring in practice, the types of changes they make, and their impact on code quality. In this study, we present the first analysis of agentic refactoring pull requests in Java, comparing them to developer refactorings across 86 projects per group. Using RefactoringMiner and DesigniteJava 3.0, we identify refactoring types and detect code smells before and after refactoring commits. Our results show that agent refactorings are dominated by annotation changes (the 5 most common refactoring types done by agents are annotation related), in contrast to the diverse structural improvements typical of developers. Despite these differences in refactoring types, we find Cursor to be the only model to show a statistically significant increase in refactoring smells.
翻译:软件开发生成器(如Claude Code、GitHub Copilot、Cursor Agent、Devin和OpenAI Codex)正日益融入开发者的工作流程。尽管已有研究评估了这些代理在代码补全和任务自动化方面的能力,但鲜有研究探讨这些代理在实践中如何执行Java重构、其所作更改的类型以及对代码质量的影响。在本研究中,我们首次对Java中的代理式重构拉取请求进行了分析,将其与每组86个项目的开发者重构进行了比较。利用RefactoringMiner和DesigniteJava 3.0,我们识别了重构类型,并检测了重构提交前后的代码坏味。结果表明,代理重构以注解更改为主(代理执行的前5种最常见的重构类型均与注解相关),这与开发者典型的多样化结构改进形成对比。尽管重构类型存在这些差异,我们发现Cursor是唯一在重构坏味方面显示出统计显著增加的模型。