Title
Understanding the impact of refactoring on smells: a longitudinal study of 23 software projects
Abstract
Code smells in a program represent indications of structural quality problems, which can be addressed by software refactoring. However, refactoring intends to achieve different goals in practice, and its application may not reduce smelly structures. Developers may neglect or end up creating new code smells through refactoring. Unfortunately, little has been reported about the beneficial and harmful effects of refactoring on code smells. This paper reports a longitudinal study intended to address this gap. We analyze how often commonly-used refactoring types affect the density of 13 types of code smells along the version histories of 23 projects. Our findings are based on the analysis of 16,566 refactorings distributed in 10 different types. Even though 79.4% of the refactorings touched smelly elements, 57% did not reduce their occurrences. Surprisingly, only 9.7% of refactorings removed smells, while 33.3% induced the introduction of new ones. More than 95% of such refactoring-induced smells were not removed in successive commits, which suggest refactorings tend to more frequently introduce long-living smells instead of eliminating existing ones. We also characterized and quantified typical refactoring-smell patterns, and observed that harmful patterns are frequent, including: (i) approximately 30% of the Move Method and Pull Up Method refactorings induced the emergence of God Class, and (ii) the Extract Superclass refactoring creates the smell Speculative Generality in 68% of the cases.
Year
DOI
Venue
2017
10.1145/3106237.3106259
ESEC/SIGSOFT FSE
Keywords
Field
DocType
Refactoring,Code Smells,Structural Quality
Programming language,Computer science,Software,God object,Code refactoring,Code smell,Generality
Conference
ISBN
Citations 
PageRank 
978-1-4503-5105-8
13
0.52
References 
Authors
31
9
Name
Order
Citations
PageRank
Diego Cedrim1292.15
Alessandro Garcia22231143.70
Melina Mongiovi3455.15
Rohit Gheyi461840.66
Leonardo da Silva Sousa5778.01
Rafael Maiani de Mello67110.47
Baldoino Fonseca710316.57
Márcio Ribeiro836332.81
Alexander Chávez9130.52