Abstract

Code clones are defined to be the exactly or nearly similar code fragments in a software system’s code-base. The existing clone related studies reveal that code clones are likely to introduce bugs and inconsistencies in the code-base. However, although there are different types of clones, it is still unknown which types of clones have a higher likeliness of introducing bugs to the software systems and so, should be considered more important for managing with techniques such as refactoring or tracking. With this focus, we performed an empirical study that compared the bug-proneness of the major clone-types: Type 1, Type 2, and Type 3.According to our experimental results on thousands of revisions of nine diverse subject systems, Type 3 clones exhibit the highest bug-proneness among the three clone-types. The bug-proneness of Type 1 clones is the lowest. Also, Type 3 clones have the highest likeliness of being co-changed consistently while experiencing bug-fixing changes. Moreover, the Type 3 clones that experience bug-fixes have a higher possibility of evolving following a Similarity Preserving Change Pattern (SPCP) compared to the bug-fix clones of the other two clone-types. From the experimental results it is clear that Type 3 clones should be given a higher priority than the other two clone-types when making clone management decisions. Our investigation on the relatedness between bug-proneness and late propagation in code clones implies that bug-proneness of code clones is not primarily related with late propagation. The possibility that a bug-fix experienced by a clone fragment will be related with late propagation is only 1.4%. Moreover, for only 10.76% of the cases, a late propagation experienced by clone fragments can be related with a bug. Thus, late propagation contributes to a very little proportion of the bugs in code clones. We believe that our study provides useful implications for ranking clones for management such as refactoring and tracking.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.