A Fine-Grained Analysis on the Inconsistent Changes in Code Clones
Manishankar Mondal, Chanchal Kumar Roy, Kevin A. Schneider · 2020
Existing studies report that inconsistent changes in code clones can introduce bugs or inconsistencies in a software system's code-base. However, inconsistent changes can often be intentional and these might not lead to bugs. Thus, it would be beneficial if we could have an automatic mechanism for proactively determining which inconsistent changes are likely to introduce bugs in a code-base. With this focus, in our research we investigate the underlying factors affecting the possibility that an inconsistent change made to code clones will lead to bugs. We extract the evolutionary history of the clone fragments in open-source software systems and analyze whether clone-types, former clone evolutionary patterns, and clone proximity have impacts on the bug-proneness of the inconsistent changes to clones. We perform our investigation on six subject systems written in three different programming languages (Java, C, and C#) and find that inconsistent changes in Type 3 clones have the highest possibility of introducing bugs among all three clone-types (Type 1, 2, and 3). Moreover, similarity preserving inconsistent changes are significantly more likely to introduce bugs compared to diverging inconsistent changes. Proximity as well as granularity of code clones have significant impacts on their possibilities of experiencing bug-fixes after having inconsistent changes. Findings from our research can be important for minimizing bugs and inconsistencies in software systems during their evolution.