Study and Analysis of Bug Propagation in Evolving Software through Micro-clones

Md. Hasibul Islam, Manishankar Mondal · 2024

Code clones, identical or substantially similar code segments in a code base, have both negative and positive impacts on evolving software. Detecting code clones is important for many reasons, such as bug fixing, change suggestions, refactoring, bug replication analysis, etc. An existing study shows that a significant number of bugs are propagated through code clones. However, Micro-clones (clones of code shorter than 5 lines long) were not considered in this study. Thus, bug propagation through micro-clones is still unexplored. This research paper presents an empirical investigation of the propagation of bugs through micro-clones. In particular, two evolutionary patterns are studied that indicate the propagation of bugs by code cloning. Initially, this paper detects micro-clones that have gone through bugfix modifications by examining the history of software evolution. Subsequently, these ascertain which of these micro-clones have evolved in accordance with the patterns of bug propagation. Based on this analysis of several hundreds of commits from four Java-based open-source systems, it has been found that as many as $\mathbf{6 3 \%}$ of the micro clone segments that have gone through bugfix modifications may contain propagating bugs. Approximately 29.41% of the bugfixes encountered by the micro clones are attributed to fixing propagating bugs. This paper’s finding indicates that identical micro clones predominantly contribute to bug propagation rather than near-miss micro clones. Propagation has a greater likelihood of occurring in the clone segments that are formed during a single commit action instead of in different commits. This discovery’s significance lies in the ability to prioritize micro-clones for refactoring and monitoring in terms of bug propagation.

Read the paper · More papers on PaperTik