Clones: what is that smell?

TitleClones: what is that smell?
Publication TypeJournal Article
Year of Publication2012
AuthorsRahman, F, Bird, C, Devanbu, P
Secondary TitleEmpirical Software Engineering
Volume17
Issue4-5
Pagination503 - 530
Date Published8/2012
ISSN Number1573-7616
Abstract

Clones are generally considered bad programming practice in software engineering folklore. They are identified as a bad smell (Fowler et al. 1999) and a major contributor to project maintenance difficulties. Clones inherently cause code bloat, thus increasing project size and maintenance costs. In this work, we try to validate the conventional wisdom empirically to see whether cloning makes code more defect prone. This paper analyses the relationship between cloning and defect proneness. For the four medium to large open source projects that we studied, we find that, first, the great majority of bugs are not significantly associated with clones. Second, we find that clones may be less defect prone than non-cloned code. Third, we find little evidence that clones with more copies are actually more error prone. Fourth, we find little evidence to support the claim that clone groups that span more than one file or directory are more defect prone than collocated clones. Finally, we find that developers do not need to put a disproportionately higher effort to fix clone dense bugs. Our findings do not support the claim that clones are really a “bad smell” (Fowler et al. 1999). Perhaps we can clone, and breathe easily, at the same time.

DOI10.1007/s10664-011-9195-3
Short TitleEmpir Software Eng
Full Text