Abstract
Exactly or nearly similar code pieces residing in a software system's code-base are known as code clones in the lit-erature. The existing studies have investigated the bug-proneness of code clones in different ways. However, there is no study on the bug-proneness of code clones considering their granularities (i.e., method level or fragment level granularity). Thus, whether method level or fragment level code clones are more vulnerable for software evolution and maintenance is still unknown. If a particular clone category appears to be more vulnerable, we can prioritize refactoring code clones of that category to minimize clone related bugs in software systems. Focusing on this, we investigate and compare the bug-proneness of method level and fragment level code clones in our research. We detect code clones using the well-known NiCad clone de-tector and analyze their evolutionary history by automatically examining the changes that occurred to them during their evolution. We investigate and compare the bug-proneness of two categories of code clones: method level clones and fragment level clones. According to our investigation on three types (Type 1, 2, and 3) of code clones from thousands of revisions of six software systems: method level code clones are significantly more bug-prone than fragment level code clones during evolution. Also, method level clones are significantly more change-prone than fragment level clones. We should thus prioritize method level clones over fragment level clones while performing clone management activities.