Article ID Journal Published Year Pages File Type
459289 Journal of Systems and Software 2015 14 Pages PDF
Abstract

•We mined and manually validated over 12,000 refactoring operations.•We verified if refactoring occurs on classes having poor quality as indicated by code metrics.•We verified whether refactoring occurs on classes affected by bad smells.•With very few exceptions, quality metrics do not show a clear relationship with refactoring.•40% of the refactorings was performed on classes affected by smells, but just 7% removed the smell.

Previous studies have investigated the reasons behind refactoring operations performed by developers, and proposed methods and tools to recommend refactorings based on quality metric profiles, or on the presence of poor design and implementation choices, i.e., code smells. Nevertheless, the existing literature lacks observations about the relations between metrics/code smells and refactoring activities performed by developers. In other words, the characteristics of code components increasing/decreasing their chances of being object of refactoring operations are still unknown. This paper aims at bridging this gap. Specifically, we mined the evolution history of three Java open source projects to investigate whether refactoring activities occur on code components for which certain indicators—such as quality metrics or the presence of smells as detected by tools—suggest there might be need for refactoring operations. Results indicate that, more often than not, quality metrics do not show a clear relationship with refactoring. In other words, refactoring operations are generally focused on code components for which quality metrics do not suggest there might be need for refactoring operations. Finally, 42% of refactoring operations are performed on code entities affected by code smells. However, only 7% of the performed operations actually remove the code smells from the affected class.

Related Topics
Physical Sciences and Engineering Computer Science Computer Networks and Communications
Authors
, , , , ,