ACM Transactions on Software Engineering and Methodology· 2026Q1
Agentic Refactoring: An Empirical Study of AI Coding Agents
- 1citations
- Q1SCImago
- 2026year
Short summary
AI agents are used for refactoring in 26.1% of commits in open-source Java projects, with a slightly higher proportion of low-level, consistency-focused edits than human refactoring (27.6% vs. 24.4%).
AI-generated from the title and abstract; the full text is not read.
Key points
- AI agents are involved in refactoring in 26.1% of commits in open-source Java projects.
- Agentic refactoring has a slightly higher share of low-level, consistency-oriented edits (27.6%) than human refactoring (24.4%).
- The most frequent agentic refactoring operations are Rename Variable (7.6%) and Change Variable Type (6.8%).
- Agentic refactoring primarily targets internal code quality (maintainability, readability), but measured improvements from low-level changes are limited.
- Agentic refactoring yields small but statistically significant improvements in structural code quality metrics, particularly for medium-level changes.
AI-generated from the title and abstract; the full text is not read.
Abstract
Agentic coding tools, such as OpenAI Codex, Claude Code, and Cursor, are changing how software is developed. These AI-powered systems function as autonomous teammates capable of planning and executing complex development tasks. Agents have become active participants in refactoring, a key practice for improving internal code quality without altering observable behavior. Despite their increasing adoption, there is little empirical understanding of how agentic refactoring is used in practice, how it compares to human-driven refactoring, and what impact it has on code quality. To address this empirical gap, we present a large-scale study of AI agent-generated refactorings in real-world open-source Java projects, analyzing 51,412 refactoring instances across 12,256 pull requests and 14,998 commits based on the AIDev dataset. Our empirical analysis shows that refactoring is a common and intentional activity in this development paradigm, with agents explicitly targeting refactoring in 26.1% of commits. The subsequent analyses of refactoring types, purposes, and code quality focus on the 3,907 commits (32,611 instances) with explicit refactoring intent. Analysis of refactoring types reveals that high-level refactorings form the largest category overall. However, agentic refactoring contains a slightly larger share of lowlevel, consistency-oriented edits than human refactoring (27.6% vs. 24.4%), and its two most frequent operations are Rename Variable (7.6%) and Change Variable Type (6.8%). Additionally, the stated motivations behind agentic refactoring focus overwhelmingly on internal quality concerns (with 52.5% in maintainability and 28.1% in readability), although the measured metric improvements from these frequently occurring low-level refactorings remain limited. Furthermore, quantitative evaluation of code quality metrics shows that agentic refactoring yields small but statistically significant improvements in structural metrics, particularly for medium-level changes, reducing class size and complexity.
The authors' abstract, as published at the source. ACM Transactions on Software Engineering and Methodology, 2026 · DOI ↗
Continue with a free account
Ask the paper: 3 free questions a day about this paper; save it, get its citation, new summaries every day for your field. Takeaways are Premium.
Continue free on the webSign in with Google or Apple; no card needed. You come back to this paper.
On your phone:
Field: Information Systems
Information SystemsComputer Science