Daily Arxiv

This is a page that curates AI-related papers published worldwide.
All content here is summarized using Google Gemini and operated on a non-profit basis.
Copyright for each paper belongs to the authors and their institutions; please make sure to credit the source when sharing.

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

Created by
  • Haebom

Author

Mikel Robredo, Matteo Esposito, Fabio Palomba, Rafael Pe naloza, Valentina Lenarduzzi

Outline

This paper analyzed developers' refactoring activities through a large-scale empirical study and utilized a large-scale language model (LLM) to identify the underlying motivations for refactoring from version control data. By comparing the motivations identified in the literature with those derived from the LLM, we demonstrated that the LLM can effectively identify developers' refactoring motivations. Specifically, the LLM provided more detailed rationales for readability, clarity, and structural improvements, providing richer information than previous studies. Most motivations were pragmatic, focusing on simplification and maintainability. While metrics related to developer experience and code readability ranked highly, their correlations with the motivation categories were weak. In conclusion, the LLM effectively identifies surface-level motivations but struggles with architectural inference. We propose that a hybrid approach combining the LLM and software metrics can be useful for systematically prioritizing refactoring and balancing short-term improvements with long-term architectural goals.

Takeaways, Limitations

Takeaways:
LLM can be used to effectively understand developers' refactoring motivations and provide detailed justification.
Integrating LLM with software metrics can improve refactoring prioritization and balance between short-term and long-term goals.
A better understanding of refactoring motivations can contribute to developing more effective refactoring strategies.
We observed developer behavior that prioritized practical motivations such as improved readability and maintainability.
Limitations:
LLM struggles with architectural reasoning.
There is a weak correlation between developer experience and code readability metrics and refactoring motivation.
The agreement rate between LLM's judgment and the motivations of existing literature is rather low at 47%.
👍