PofoliaDaily literature tracker

ACM Transactions on Software Engineering and Methodology· 2026Q1

What Were You Thinking? An LLM-Driven Large-Scale Study of Refactoring Motivations in Open Source Projects

Mikel Robredo, Matteo Esposito, Fabio Palomba, Rafael Peñaloza et al.

Short summary

Large Language Models (LLMs) identified refactoring motivations in open-source projects, finding that 80% matched human judgment but only 47% aligned with existing literature, with pragmatic reasons like simplification and maintainability being most common.

AI-generated from the title and abstract; the full text is not read.

Key points

  • LLMs successfully identified refactoring motivations in 80% of cases, comparable to human judgment.
  • LLM-identified motivations aligned with existing literature in only 47% of instances.
  • Pragmatic reasons like simplification and maintainability were the most common refactoring drivers.
  • Metrics for developer experience and code readability showed weak correlations with motivation categories.

AI-generated from the title and abstract; the full text is not read.

Abstract

Context. Code refactoring improves software quality without changing external behavior. Despite its advantages, its benefits are hindered by the considerable cost of time, resources, and continuous effort it demands. Aim. Understanding why developers refactor, and which metrics capture these motivations, may support wider and more effective use of refactoring in practice. Method. We performed a large-scale empirical study to analyze developers’ refactoring activity, leveraging Large Language Models (LLMs) to identify underlying motivations from version control data, comparing our findings with previous motivations reported in the literature. Results. LLMs matched human judgment in 80% of cases, but aligned with literature-based motivations in only 47%. They enriched 22% of motivations with more detailed rationale, often highlighting readability, clarity, and structural improvements. Most motivations were pragmatic, focused on simplification and maintainability. While metrics related to developer experience and code readability ranked highest, their correlation with motivation categories was weak. Conclusions. We conclude that LLMs effectively capture surface-level motivations but struggle with architectural reasoning. Their value lies in providing localized explanations, which, when combined with software metrics, can form hybrid approaches. Such integration offers a promising path toward prioritizing refactoring more systematically and balancing short-term improvements with long-term architectural goals.

The authors' abstract, as published at the source. ACM Transactions on Software Engineering and Methodology, 2026 · DOI ↗

TakeawaysFree for 3 days Ask the paperFree account

Continue with a free account

Ask the paper: 5 free questions a day about this paper; save it, get its citation, new summaries every day for your field. A new account opens the takeaways for its first 3 days.

Continue free on the web

Sign in with Google or Apple; no card needed. You come back to this paper.

On your phone:

Field: Information Systems

Information SystemsComputer Science