A common technique in software development is code cloning, which allows for the reuse of pre-existing code. However, frequently it comes at the cost of more difficulties and unnoticed flaws (bugs). The effect of code clones on software quality has been thoroughly examined in the existing studies, but the relationship between clone authorship and bug proneness has received less attention. Code fragments cloned by developers other than the original author are intuitively more likely to contain bugs than those cloned by the original author. However, there is no empirical evaluation of this intuition. In order to bridge this research gap, we have conducted an empirical study to analyze the impact of clone authorship on the bug-proneness of code clones. For the purpose of our study, we have mined a particular clone evolutionary pattern from thousands of revisions of our subject systems. The pattern helps us discover those clone fragments that were created by one programmer through copy/pasting another programmer’s code. We have analyzed the bug-proneness of such clones. According to our analysis on five diverse subject systems, if a programmer copy/pastes and reuses another programmer’s code, the copy/pasted code fragment is more likely to contain bugs compared to a code fragment which was created through copy/pasting by the original programmer. Our research provides actionable suggestions regarding the cloning activities of programmers towards minimizing bugs in code clones.
