An empirical study of the factors affecting co-change frequency of cloned code

  • Authors:
  • Lionel Marks;Ying Zou;Iman Keivanloo

  • Affiliations:
  • Statistics Canada, Ottawa, ON;Queen's University, Kingston, ON;Queen's University, Kingston, ON

  • Venue:
  • CASCON '13 Proceedings of the 2013 Conference of the Center for Advanced Studies on Collaborative Research
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Code clones are duplicated code fragments that are copied to re-use functionality and speed up development. However, due to the duplicate nature of code clones, inconsistent updates can lead to defects in software system. We extend the existing studies on the inconsistent co-change characteristics, by investigating further factors that affect clone evolution. We study the effect of development cycles, the number of developers, method names similarity and code complexity. Our empirical study includes six industrial software systems to determine if the observations are statistically significant. We discover that one way to improve maintenance of code clones is to decrease code complexity. We find that increased code complexity leads to a decrease in co-change, which can lead to software defects. Likewise, we find that method name similarity is an important factor on co-change frequency of cloned code. From development cycles point of view, we observe that co-change frequency of cloned code does not change significantly from early to later and from development to defect fixing cycles. As a result, we suggest assigning a higher priority for early refactoring (i.e., within the first six months) of all cloned methods with infrequent co-change focusing on clone classes with low similarity in method names and high code complexity.