Machine-Learning Aided Analysis of Clone Evolution

作者:Zhang Fanlong; Khoo Siau-Cheng; Su Xiaohong*
来源:Chinese Journal of Electronics, 2017, 26(6): 1132-1138.
DOI:10.1049/cje.2017.08.012

摘要

Code clones are similar code fragments appearing in software. As software evolves, code clones may be subjected to changes as well; we term this clone evolution. There have not been many investigations into clone evolution characteristics. Therefore, we tackle this by exploring useful information associated with changes of clones during evolution. We focus on three perspectives of clone evolution, ranging from individual clone changes to characterization of clone genealogies. With the help X means clustering, we establish associations between clone changes and life of clones. Our experimental results on two softwares show that clones are mostly stable throughout software evolution. For the relatively smaller group of "unstable" clones, changes usually happen after several versions, and consistent changes appear more frequently than inconsistent ones. We suggest that developers should pay more attention to relatively longer genealogies, and should consider applying changes consistently to clone group when a constituent clone fragment has undergone change.