Comparing Bug Replication in Regular and Micro Code Clones

Judith F. Islam, Manishankar Mondal, Chanchal K. Roy, Kevin A. Schneider


Abstract
Copying and pasting source code during software development is known as code cloning. Clone fragments with a minimum size of 5 LOC were usually considered in previous studies. In recent studies, clone fragments which are less than 5 LOC are referred as micro-clones. It has been established by the literature that code clones are closely related with software bugs as well as bug replication. None of the previous studies have been conducted on bug-replication of micro-clones. In this paper we investigate and compare bug-replication in between regular and micro-clones. For the purpose of our investigation, we analyze the evolutionary history of our subject systems and identify occurrences of similarity preserving co-changes (SPCOs) in both regular and micro-clones where they experienced bug-fixes. From our experiment on thousands of revisions of six diverse subject systems written in three different programming languages, C, C# and Java we find that the percentage of clone fragments that take part in bug-replication is often higher in micro-clones than in regular code clones. The percentage of bugs that get replicated in micro-clones is almost the same as the percentage in regular clones. Finally, both regular and micro-clones have similar tendencies of replicating severe bugs according to our experiment. Thus, micro-clones in a code-base should not be ignored. We should rather consider these equally important as of the regular clones when making clone management decisions.
Cite:
Judith F. Islam, Manishankar Mondal, Chanchal K. Roy, and Kevin A. Schneider. 2019. Comparing Bug Replication in Regular and Micro Code Clones. 2019 IEEE/ACM 27th International Conference on Program Comprehension (ICPC).
Copy Citation: