Why We Refactor? Confessions of GitHub Contributors
Danilo Silva, Nikolaos Tsantalis, Marco Tulio Valente

TL;DR
This study investigates the motivations behind code refactoring in GitHub projects, revealing that requirement changes drive most refactoring activities and that IDE choice influences automation adoption.
Contribution
It provides the first empirical analysis of developers' motivations for refactoring, identifying 44 motivations across 12 refactoring types through developer surveys.
Findings
Refactoring is mainly driven by requirement changes.
Extract Method serves multiple purposes, being highly versatile.
IDE choice influences the use of automated refactoring tools.
Abstract
Refactoring is a widespread practice that helps developers to improve the maintainability and readability of their code. However, there is a limited number of studies empirically investigating the actual motivations behind specific refactoring operations applied by developers. To fill this gap, we monitored Java projects hosted on GitHub to detect recently applied refactorings, and asked the developers to ex- plain the reasons behind their decision to refactor the code. By applying thematic analysis on the collected responses, we compiled a catalogue of 44 distinct motivations for 12 well-known refactoring types. We found that refactoring activity is mainly driven by changes in the requirements and much less by code smells. Extract Method is the most versatile refactoring operation serving 11 different purposes. Finally, we found evidence that the IDE used by the developers affects the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
