UNDERSTANDING AND IMPROVING BATCH REFACTORING IN SOFTWARE SYSTEMS

DIEGO CEDRIM GOMES REGO · 2018

Code smells in a program represent indications of structural quality problems, which can be addressed by software refactoring.However, developers may neglect or end up creating new code smells through single refactoring.Little has been reported about recurring beneficial and harmful e ects of refactoring on the program structural quality.As a consequence, developers still miss guidance along non-trivial smell-removing tasks.In fact, evidence suggests developers often need to apply a sequence of refactorings, so-called batch refactoring, to entirely remove a smelly code structure.Thus, in this thesis, we have conducted a series of studies to understand the impact of single and batch refactorings on code smells.In our first studies, we analyze how often commonly-used types of single refactoring a ect the density of code smells along the version histories of dozens of projects.Even though 79.4% of the refactorings touched smelly elements, 57% had no impact on the smell removal.Surprisingly, only 9.7% of refactorings removed smells, while 33% induced the introduction of new ones.On one hand, we observed that harmful refactoring-smell patterns could be used to guide developers to avoid smell-inducing refactoring.On the other hand, we observed that many smells can be removed only through batch refactoring.Thus, our last studies investigate the impact of batch refactorings on smells.Even when applied in batches, refactorings tend to maintain or even increase the density of code smells.We also identified common batch-smell patterns, which enable us to create heuristics that can guide developers through smell-removing tasks.The last study evaluated those heuristics, and we conclude the outcomes are promising.

Read the paper · More papers on PaperTik