How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics in Stack Overflow
arXiv:2110.12229 · doi:10.1007/s10664-021-10045-x
Abstract
An essential part of software maintenance and evolution, refactoring is performed by developers, regardless of technology or domain, to improve the internal quality of the system, and reduce its technical debt. However, choosing the appropriate refactoring strategy is not always straightforward, resulting in developers seeking assistance. Although research in refactoring is well-established, with several studies altering between the detection of refactoring opportunities and the recommendation of appropriate code changes, little is known about their adoption in practice. Analyzing the perception of developers is critical to understand better what developers consider to be problematic in their code and how they handle it. Additionally, there is a need for bridging the gap between refactoring, as research, and its adoption in practice, by extracting common refactoring intents that are more suitable for what developers face in reality. In this study, we analyze refactoring discussions on Stack Overflow through a series of quantitative and qualitative experiments. Our results show that Stack Overflow is utilized by a diverse set of developers for refactoring assistance for a variety of technologies. Our observations show five areas that developers typically require help with refactoring -- Code Optimization, Tools and IDEs, Architecture and Design Patterns, Unit Testing, and Database. We envision our findings better bridge the support between traditional (or academic) aspects of refactoring and their real-world applicability, including better tool support.
arXiv commentPart of a collection: Collective Knowledge in Software Engineering ISSN: 1382-3256 (Print) 1573-7616 (Online)
References in corpus (7)
- NLTK: The Natural Language Toolkit
- Learning Natural Coding Conventions
- Why We Refactor? Confessions of GitHub Contributors
- Many-Objective Software Remodularization using NSGA-III
- SOTorrent: Reconstructing and Analyzing the Evolution of Stack Overflow Posts
- How We Refactor and How We Document it? On the Use of Supervised Machine Learning Algorithms to Classify Refactoring Documentation
- Do Design Metrics Capture Developers Perception of Quality? An Empirical Study on Self-Affirmed Refactoring Activities