Exploring the Impact of Clone Refactoring on Test Code Size in Object-Oriented Software

Mourad Badri, Linda N. Badri, Oussama Hachemane, Alexandre Ouellet · 2017

This paper aims at exploring the impact of clone refactoring on the test code size, in terms of number of operations, in object-oriented software. We investigated three research questions: (1) the impact of clone refactoring on three important source code attributes (coupling, complexity and size) that are related to unit testability of classes, (2) the impact of clone refactoring on the test code size, and (3) the variations after clone refactoring in the source code attributes that have the most important impact on the test code size. We used linear regression and three popular machine learning techniques (i.e., k-Nearest Neighbors, Naïve Bayes and Random Forest) to develop predictive and explanatory models. We used data collected from an open source Java software system (ANT) that has been refactored using clone-refactoring techniques. The analyses indicate that there is a strong and positive relationship between clone refactoring and the reduction of the test code size. Results show that: (1) the source code attributes of refactored classes have been significantly improved, (2) the test code size of refactored classes has been significantly reduced, and (3) the variations of the test code size are more influenced by the variations of the complexity and size of refactored classes compared to coupling.

Read the paper · More papers on PaperTik