Skip to main content
Log in

A comparative study on the intensity and harmfulness of late propagation in near-miss code clones

  • Published:
Software Quality Journal Aims and scope Submit manuscript

Abstract

Exact or nearly similar code fragments in a software system’s source code are referred to as code clones. It is often the case that updates (i.e., changes) to a code clone will need to be propagated to its related code clones to preserve their similarity and to maintain source code consistency. When there is a delay in propagating the changes (possibly because the developer is unaware of the related cloned code), the system might behave incorrectly. A delay in propagating a change is referred to as ‘late propagation,’ and a number of studies have investigated this phenomenon. However, these studies did not investigate the intensity of late propagation nor how late propagation differs by clone type. In this research, we investigate late propagation separately for each of the three clone types (Type 1, Type 2, and Type 3). According to our experimental results on thousands of revisions of eight diverse subject systems written in two programming languages, late propagation occurs more frequently in Type 3 clones compared with the other two clone types. More importantly, there is a higher probability that Type 3 clones will experience buggy late propagations compared with the other two clone types. Also, we discovered that block clones are more involved in late propagation than method clones. Refactoring and tracking of Similarity Preserving Change Pattern (SPCP) clones (i.e., the clone fragments that evolve following a SPCP) can help us minimize the occurrences of late propagation in clones.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2

Similar content being viewed by others

Notes

  1. Sourceforge: http://www.sourceforge.net.

  2. Ctags: http://sourceforge.net/projects/ctags/?source=directory.

  3. Source code file for Clone Fragment 1: trunk/org/gjt/sp/jedit/buffer/OffsetManager.java.

  4. Source code file for Clone Fragment 2: trunk/org/gjt/sp/jedit/textarea/ChunkCache.java.

  5. CCFinder. http://www.ccfinder.net/ccfinderxos.html.

  6. Simian. http://www.harukizaemon.com/simian/index.html.

References

  • Aversano, L., Cerulo, L., & Penta, M. D. (2007). How clones are maintained: An empirical study. In CSMR (pp. 81–90). IEEE Computer Society.

  • Bazrafshan, S. (2012). Evolution of near-miss clones. In SCAM (pp. 74–83).

  • Barbour, L., Khomh, F., & Zou, Y. (2013). An empirical study of faults in late propagation clone genealogies. Software: Evolution and Process, 25, 1139–1165.

    Google Scholar 

  • Cordy, J. R., & Roy, C. K. (2011). The NiCad clone detector. In Tool demo track (pp. 219–220). ICPC

  • D’Ambros, M., Lanza, M., & Lungu, M. (2009). Visualizing co-change information with the evolution radar. IEEE Transactions on Software Engineering, 35, 720–735.

    Article  Google Scholar 

  • Duala-Ekoko, E., & Robillard, M.P. (2007). Tracking code clones in evolving software. In ICSE (pp. 158–167).

  • Duala-Ekoko, E., & Robillard, M.P. (2008). Clonetracker: Tool support for code clone management. In ICSE (pp. 843–846).

  • Göde, N., & Harder, J. (2011). Clone stability. In CSMR (pp. 65–74).

  • Göde, N., & Koschke, R. (2011). Frequency and risks of changes to clones. In ICSE (pp. 311–320).

  • Kapser, C., & Godfrey, M. W. (2008). “Cloning considered harmful” considered harmful: Patterns of cloning in software. Empirical Software Engineering, 13, 645–692.

    Article  Google Scholar 

  • Krinke, J. (2007). A study of consistent and inconsistent changes to code clones. In WCRE (pp. 170–178).

  • Krinke, J. (2008). Is cloned code more stable than non-cloned code? In SCAM (pp. 57–66).

  • Kim, M., Sazawal, V., Notkin, D., & Murphy, G.C. (2005). An empirical study of code clone genealogies. In ESEC-FSE (pp. 187–196).

  • Lozano, A., & Wermelinger, M. (2008). Assessing the effect of clones on changeability. In ICSM (pp. 227–236).

  • Lozano, A., & Wermelinger, M. (2010). Tracking clones’ imprint. In IWSC (pp. 65–72).

  • Mondal, M., Roy, C. K., Rahman, M. S., Saha, R. K., Krinke, J., & Schneider, K. A. (2012a). Comparative stability of cloned and non-cloned code: an empirical study. In ACM SAC (pp. 1227–1234). ACM.

  • Mondal, M., Roy, C. K., & Schneider, K. A. (2012b). Connectivity of co-changed method groups: A case study on open source systems. In CASCON (pp. 205–219).

  • Mondal, M., Roy, C. K., & Schneider, K. A. (2012c). Dispersion of changes in cloned and non-cloned code. In IWSC (pp. 29–35).

  • Mondal, M., Roy, C. K., & Schneider, K. A. (2012d). An empirical study on clone stability. ACM SIGAPP Applied Computing Review, 12(3), 20–36.

    Article  Google Scholar 

  • Mondal, M., Roy, C. K., & Schneider, K. A. (2014a). Automatic identification of important clones for refactoring and tracking. In SCAM, 10 pp (to appear).

  • Mondal, M., Roy, C. K., & Schneider, K. A. (2014b). Automatic ranking of clones for refactoring through mining association rules. In CSMR-WCRE (pp. 114–123).

  • Mondal, M., Roy, C. K., & Schneider, K. A. (2014c). An insight into the dispersion of changes in cloned and non-cloned code: A genealogy based empirical study. Science of Computer Programming, 95, 445–468.

    Article  Google Scholar 

  • Mondal, M., Roy, C. K., & Schneider, K. A. (2014d). Late propagation in near-miss clones: An empirical study. In IWSC, 17 pp.

  • Mondal, M., Roy, C. K., & Schneider, K. A. (2015). A comparative study on the bug-proneness of different types of code clones. In ICSME (pp. 91–100).

  • Mockus, A., & Votta, L. G. (2000). Identifying reasons for software changes using historic databases. In ICSM (pp. 120–130).

  • Roy, C. K., & Cordy, J. R. (2008). NICAD: Accurate detection of near-miss intentional clones using flexible pretty-printing and code normalization. In ICPC (pp. 172–181). IEEE Computer Society.

  • Roy, C. K., & Cordy, J. R. (2009). A mutation/injection-based automatic framework for evaluating code clone detection tools. In Mutation (pp. 157–166).

  • Roy, C. K., Cordy, J. R., & Koschke, R. (2009). Comparison and evaluation of code clone detection techniques and tools: A qualitative approach. Science of Computer Programming, 74, 470–495.

    Article  MathSciNet  MATH  Google Scholar 

  • Roy, C. K. (2009). Detection and analysis of near-miss software clones. In ICSM (pp. 447–450).

  • Svajlenko, J., Roy, C. K. (2014). Evaluating modern clone detection tools. In ICSME (pp. 321–330).

  • Thummalapenta, S., Cerulo, L., Aversano, L., & Penta, M. D. (2009). An empirical study on the maintenance of source code clones. Empirical Software Engineering, 15, 1–34.

    Article  Google Scholar 

  • Vanya, A., Premraj, R., & Vliet, H. V. (2010). Interactive exploration of co-evolving software entities. In CSMR (pp. 260–263).

  • Wang, T., Harman, M., Jia, Y., & Krinke, J. (2013). Searching for better configurations: A rigorous approach to clone evaluation. In ESEC/SIGSOFT FSE (pp. 455–465).

  • Xie, S., & Khomh, Y. Z. F. (2013). An empirical study of the fault-proneness of clone mutation and clone migration. In MSR (pp. 149–158).

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Manishankar Mondal.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Mondal, M., Roy, C.K. & Schneider, K.A. A comparative study on the intensity and harmfulness of late propagation in near-miss code clones. Software Qual J 24, 883–915 (2016). https://doi.org/10.1007/s11219-016-9305-y

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11219-016-9305-y

Keywords

Navigation