Copying and pasting code snippets, with or without intent, is a very common activity in software develop-ment. These have both positive and negative aspects because they save time, but cause an increase in costs forsoftware maintenance. However, often the copied code changes due to bug fixes or refactorings, which couldaffect clone detection. In this regard, this study aims to investigate whether the transformations performedby the compiler on the code can determine the appearance of a set of previously undetectable clones. Theproposed approach involves the extraction of software quality metrics on both decompiled and source codeto bring to light any differences due to the presence of undetectable clones on the source code. Experimentswere conducted on five open-source Java software systems. The results show that indeed compiler optimiza-tions lead to the appearance of a set of previously undetected clones, which can be called logical clones. Thisphenomenon in Java appears to be marginal as it amounts to 5% more clones than normal, therefore a statis-tically negligible result in small projects, but in the future, it would be interesting to extend the study to otherprogramming languages to evaluate any different cases.
Understanding Compiler Effects on Clone Detection Process
Iammarino, Martina;
2023-01-01
Abstract
Copying and pasting code snippets, with or without intent, is a very common activity in software develop-ment. These have both positive and negative aspects because they save time, but cause an increase in costs forsoftware maintenance. However, often the copied code changes due to bug fixes or refactorings, which couldaffect clone detection. In this regard, this study aims to investigate whether the transformations performedby the compiler on the code can determine the appearance of a set of previously undetectable clones. Theproposed approach involves the extraction of software quality metrics on both decompiled and source codeto bring to light any differences due to the presence of undetectable clones on the source code. Experimentswere conducted on five open-source Java software systems. The results show that indeed compiler optimiza-tions lead to the appearance of a set of previously undetected clones, which can be called logical clones. Thisphenomenon in Java appears to be marginal as it amounts to 5% more clones than normal, therefore a statis-tically negligible result in small projects, but in the future, it would be interesting to extend the study to otherprogramming languages to evaluate any different cases.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.