Fault density analysis of object-oriented classes in presence of code clones
Mahmoud O. Elish, Yasser Al-Ghamdi · 2015
Code cloning has been a typical practice during software development, by which code fragments are reused with or without changes by copying and pasting. It has been a questionable issue whether cloning has a destructive impact or not on software development and the quality of the delivered software. This paper empirically investigates the relationship between code clones and fault density of object-oriented classes. More than 3000 classes from five open source software systems were analyzed. The results suggest that classes that have clones were less fault dense on average than the classes that do not have clones. However, there was no association between intra/inter-class clone fragments within a class and its fault density. The results also indicate that among the groups of classes that have only one type of clones, the group of classes with Type III clones was the least fault dense. Minor, although statistically significant, correlations were observed between many code clone metrics and class fault density. Furthermore, the fault density predictive powers of these metrics were found to be almost the same. However, no improvement in the accuracy of fault density prediction models was observed when these metrics were used as inputs.