Skip to main content

A Summary on the Stability of Code Clones and Current Research Trends

  • Chapter
  • First Online:
Code Clone Analysis

Abstract

Code clones are exactly or nearly similar code pieces in the source code files of a software system. These mainly get created because of the frequent copy/paste activities of the programmers during development. Many studies have been done on realizing the impacts of code clones on software evolution and maintenance. We performed a comprehensive study on clone stability in order to understand whether clone or non-clone code in a software system is more change-prone. Intuitively, code pieces with higher change-proneness (lower stability) will require higher maintenance effort and cost during software evolution. According to our study, code clones are more change-prone than non-clone code in general and thus, code clones are likely to require a higher maintenance effort and cost. We suggest that code clones should be managed with proper tool support so that we can get rid of their negative impacts and can get benefited from their positive impacts. This document provides a brief summary of our study on clone stability. It also discusses the studies that were done mostly after the publication of our study. Finally, it mentions some possible future works on the basis of the findings of the existing studies.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 139.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 179.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 179.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. R. Agrawal, T. Imieliski, A. Swami, Mining association rules between sets of items in large databases, in ACM SIGMOD International Conference on Management of Data (ACM SIGMOD’93), vol. 22, issue 2 (1993), pp 207–216

    Google Scholar 

  2. F. Al-omari, I. Keivanloo, C.K. Roy, J. Rilling, Detecting clones across microsoft .net programming languages, in Proceedings of the International Working Conference on Reverse Engineering (WCRE’12) (2012), pp. 405–414

    Google Scholar 

  3. F. Al-Omari, C.K. Roy, T. Chen. Semanticclonebench: a semantic code clone benchmark using crowd-source knowledge, in IWSC (2020), pp. 57–63

    Google Scholar 

  4. M. Balazinska, E. Merlo, M. Dagenais, K. Kontogiannis, Advanced clone-analysis to support object-oriented system refactoring, in Proceedings of the 7th Working Conference on Reverse Engineering (WCRE’00) (2000), pp. 98–107

    Google Scholar 

  5. M. Balazinska, E. Merlo, M. Dagenais, B. Lagüe, K. Kontogiannis, Measuring clone based reengineering opportunities, in Proceedings of the 6th International Symposium on Software Metrics (METRICS’99) (1999), pp. 292–303

    Google Scholar 

  6. M. Balazinska, E. Merlo, M. Dagenais, B. Lagüe, K. Kontogiannis, Partial redesign of Java software systems based on clone analysis, in Proceedings of the 6th Working Conference on Reverse Engineering (WCRE’99) (1999), pp. 326–336

    Google Scholar 

  7. L. Barbour, F. Khomh, Y. Zou, Late propagation in software clones, in Proceedings of the 27th IEEE International Conference on Software Maintenance (ICSM’11) (2011), pp. 273–282

    Google Scholar 

  8. L. Barbour, F. Khomh, Y. Zou, An empirical study of faults in late propagation clone genealogies. J. Softw.: Evol. Process. 25(11), 1139–1165 (2013)

    Google Scholar 

  9. I. Baxter, A. Yahin, L. Moura, M. Sant’Anna, L. Bier, Clone detection using abstract syntax trees, in Proceedings of the International Conference on Software Maintenance (ICSM’98) (1998), pp. 368–378

    Google Scholar 

  10. M. Beller, A. Zaidman, A. Karpov, The last line effect, in ICPC (2015), pp. 240–243

    Google Scholar 

  11. N. Bettenburg, W. Shang, W. Ibrahim, B. Adams, Y. Zou, A.E. Hassan, An empirical study on inconsistent changes to code clones at release level, in WCRE (2009), pp. 85–94

    Google Scholar 

  12. S. Bouktif, G. Antoniol, M. Neteler, E. Merlo, A novel approach to optimize clone refactoring activity, in Proceedings of the 8th Annual Conference on Genetic and Evolutionary Computation (GECCO’06) (2006), pp. 1885–1892

    Google Scholar 

  13. C. Brown, S. Thompson, Clone detection and elimination for Haskell, in Proceedings of the 2010 ACM SIGPLAN workshop on Partial Evaluation and Program Manipulation (PEPM’10) (2010), pp. 111–120

    Google Scholar 

  14. G. Canfora, M. Ceccarelli, L. Cerulo, M.D. Penta, Using multivariate time series and association rules to detect logical change coupling: an empirical study, in Proceedings of the IEEE International Conference on Software Maintenance (ICSM’10) (2010), pp. 1–10

    Google Scholar 

  15. X. Cheng, H. Zhong, Y. Chen, Z. Hu, J. Zhao, Rule-directed code clone synchronization, in ICPC (2016), pp. 1–10

    Google Scholar 

  16. E. Choi, N. Yoshida, T. Ishio, K. Inoue, T. Sano, Extracting code clones for refactoring using combinations of clone metrics, in Proceedings of the 5th International Workshop on Software Clones (IWSC’11) (2011), pp. 7–13

    Google Scholar 

  17. J.R. Cordy, C.K. Roy, The NiCad clone detector, in Proceedings of the 2011 IEEE 19th International Conference on Program Comprehension (ICPC’ 11) (2011), pp. 219–220

    Google Scholar 

  18. N. Göde, D. Steidl, Feature-based detection of bugs in clones, in Proceedings of the 7th International Workshop on Software Clones (IWSC’13) (2013), pp. 76–82

    Google Scholar 

  19. E. Duala-Ekoko, M.P. Robillard, Tracking code clones in evolving software, in Proceedings of the 29th International Conference on Software Engineering (ICSE’07) (2007), pp. 158–167

    Google Scholar 

  20. E. Duala-Ekoko, M.P. Robillard, Clonetracker: tool support for code clone management, in Proceedings of the 30th International Conference on Software Engineering (ICSE’08) (2008), pp. 843–846

    Google Scholar 

  21. E. Duala-Ekoko, M.P. Robillard, Clone region descriptors: representing and tracking duplication in source code. ACM Trans. Softw. Eng. Methodol. 20(1), 1–31 (2010)

    Article  Google Scholar 

  22. N. Göde, J. Harder, Clone stability, in Proceedings of the 15th European Conference on Software Maintenance and Reengineering (CSMR’11) (2011), pp. 65–74

    Google Scholar 

  23. N. Göde, R. Koschke, Incremental clone detection, in Proceedings of the 13th European Conference on Software Maintenance and Reengineering (CSMR’09) (2009), pp. 219–228

    Google Scholar 

  24. J. Harder, N. Göde, Efficiently handling clone data: RCF and cyclone, in Proceedings of the 5th International Workshop on Software Clones (IWSC’11) (2011), pp. 81–82

    Google Scholar 

  25. Y. Higo, T. Kamiya, S. Kusumoto, K. Inoue, Refactoring support based on code clone analysis. Prod. Focus. Softw. Process. Improv. (LNCS 3009):220–233 (2004)

    Google Scholar 

  26. Y. Higo, T. Kamiya, S. Kusumoto, K. Inoue, ARIES: refactoring support tool for code clone, in Proceedings of the 3rd Workshop on Software Quality (3-WoSQ’05) (2005) pp. 1–4

    Google Scholar 

  27. Y. Higo, S. Kusumoto, K. Inoue, A metric-based approach to identifying refactoring opportunities for merging code clones in a Java software system. J. Softw. Maint. Evol.: Res. Pract. 20, 435–461 (2008)

    Article  Google Scholar 

  28. K. Hotta, Y. Sano, Y. Higo, S. Kusumoto, Is duplicate code more frequently modified than non-duplicate code in software evolution?: an empirical study on open source software, in Proceedings of the International Workshop on Principles of Software Evolution (IWPSE’10) (2010), pp. 73–82

    Google Scholar 

  29. J.F. Islam, M. Mondal, C.K. Roy, Bug replication in code clones: an empirical study, in Proceedings of the 23rd IEEE International Conference on Software Analysis, Evolution, and Reengineering (SANER’16) (2016), pp. 68–78

    Google Scholar 

  30. J.F. Islam, M. Mondal, C.K. Roy, A comparative study of software bugs in micro-clones and regular code clones, in SANER (2019), pp. 73–83

    Google Scholar 

  31. J.F. Islam, M. Mondal, C.K. Roy, K. Schneider, Comparing bug replication in regular and micro code clones, in ICPC (2019), pp. 81–92

    Google Scholar 

  32. C.K. Roy, J. Svajlenko, Fast and flexible large-scale clone detection with cloneworks, in ICSE-C (2017), pp. 27–30

    Google Scholar 

  33. P. Jablonski, D. Hou, CReN: a tool for tracking copy-and-paste code clones and renaming identifiers consistently in the ide, in Proceedings of the 2007 OOPSLA Workshop on Eclipse Technology Exchange (OOPSLA’07) (2007), pp. 16–20

    Google Scholar 

  34. L. Jiang, Z. Su, E. Chiu, Context-based detection of clone-related bugs, in Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC-FSE’07) (2007), pp. 55–64

    Google Scholar 

  35. T. Kamiya, S. Kusumoto, K. Inoue, CCFinder: a multilinguistic token-based code clone detection system for large scale source code. IEEE Trans. Softw. Eng. 28(7), 654–670 (2002)

    Article  Google Scholar 

  36. C. Kapser, M.W. Godfrey, Cloning considered harmful considered harmful: patterns of cloning in software. Empir. Softw. Eng. J. 13(6), 645–692 (2008)

    Google Scholar 

  37. D. Kim, J. Nam, J. Song, S. Kim, Automatic patch generation learned from human-written patches, in ICSE (2013), pp. 802–811

    Google Scholar 

  38. J. Krinke, A study of consistent and inconsistent changes to code clones, in Proceedings of the 14th Working Conference on Reverse Engineering (WCRE’07) (2007), pp. 170–178

    Google Scholar 

  39. J. Krinke, Is cloned code more stable than non-cloned code?, in Proceedings of the 8th IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM’08) (2008), pp. 57–66

    Google Scholar 

  40. J. Krinke. Is cloned code older than non-cloned code?, in Proceedings of the 5th International Workshop on Software Clones (IWSC’11) (2011), pp. 28–33

    Google Scholar 

  41. H. Li, S. Thompson, Clone detection and removal for Erlang/OTP within a refactoring environment, in Proceedings of the 2009 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM’09) (2009), pp. 169–177

    Google Scholar 

  42. H. Li, S. Thompson, Incremental clone detection and elimination for Erlang programs, in Proceedings of the 14th International Conference on Fundamental Approaches to Software Engineering (FASE’11) (2011), pp. 356–370

    Google Scholar 

  43. J. Li, M.D. Ernst, CBCD: cloned buggy code detector, in Proceedings of the 34th International Conference on Software Engineering (ICSE’12) (2012), pp. 310–320

    Google Scholar 

  44. A. Lozano, M. Wermelinger, Assessing the effect of clones on changeability, in Proceedings of the IEEE International Conference on Software Maintenance (ICSM’08) (2008), pp. 227–236

    Google Scholar 

  45. A. Lozano, M. Wermelinger, Tracking clones’ imprint, in Proceedings of the 4th International Workshop on Software Clones (IWSC’10) (2010), pp. 65–72

    Google Scholar 

  46. N. Meng, L. Hua, M. Kim, K.S. McKinley, Does automated refactoring obviate systematic editing?, in Proceedings of the 37th International Conference on Software Engineering (ICSE’15) (2015), pp. 392–402

    Google Scholar 

  47. D. Mondal, M. Mondal, C.K. Roy, K.A. Schneider, S. Wang, Y. Li, Clone-world: a visual analytic system for large scale software clones, in PacificVAST (2019), pp. 1–11

    Google Scholar 

  48. D. Mondal, M. Mondal, C.K. Roy, K.A. Schneider, S. Wang, Y. Li, Towards visualizing large scale evolving clones, in ICSE Poster Track (2019), pp. 1–4

    Google Scholar 

  49. M. Mondal, M.S. Rahman, C.K. Roy, K.A. Schneider, Is cloned code really stable? Empir. Softw. Eng. 23(2), 693–770 (2018)

    Article  Google Scholar 

  50. M. Mondal, B. Roy, C.K. Roy, K.A. Schneider, An empirical study on bug propagation through code cloning. J. Syst. Softw. (2019)

    Google Scholar 

  51. M. Mondal, B. Roy, C.K. Roy, K.A. Schneider, Investigating context adaptation bugs in code clones, in ICSME (2019), pp. 157–168

    Google Scholar 

  52. M. Mondal, B. Roy, C.K. Roy, K.A. Schneider, Associating code clones with association rules for change impact analysis, in SANER (2020), pp. 93–103

    Google Scholar 

  53. M. Mondal, B. Roy, C.K. Roy, K.A. Schneider, Investigating near-miss micro-clones in evolving software, in ICPC (2020), p. 11

    Google Scholar 

  54. M. Mondal, C.K. Roy, M.S. Rahman, R.K. Saha, J. Krinke, K.A. Schneider, Comparative stability of cloned and non-cloned code: an empirical study, in Proceedings of the 27th Annual ACM Symposium on Applied Computing (SAC’12) (2012), pp. 1227–1234

    Google Scholar 

  55. M. Mondal, C.K. Roy, K.A. Schneider, An empirical study on clone stability. ACM SIGAPP Appl. Comput. Rev. 12(3), 20–36 (2012)

    Article  Google Scholar 

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

    Google Scholar 

  57. M. Mondal, C.K. Roy, K.A. Schneider, Automatic identification of important clones for refactoring and tracking, in Proceedings of the IEEE 14th International Working Conference on Source Code Analysis and Manipulation (SCAM’14) (2014), pp. 11–20

    Google Scholar 

  58. M. Mondal, C.K. Roy, K.A. Schneider, Automatic ranking of clones for refactoring through mining association rules, in Proceedings of the IEEE Conference on Software Maintenance, Reengineering and Reverse Engineering (CSMR-WCRE’14), Software Evolution Week (2014), pp. 114–123

    Google Scholar 

  59. M. Mondal, C.K. Roy, K.A. Schneider, A comparative study on the bug-proneness of different types of code clones, in Proceedings of the 31st IEEE International Conference on Software Maintenance and Evolution (ICSME’15) (2015), pp. 91–100

    Google Scholar 

  60. M. Mondal, C.K. Roy, K.A. Schneider, An exploratory study on change suggestions for methods using clone detection, in CASCON (2016), pp. 85–95

    Google Scholar 

  61. M. Mondal, C.K. Roy, K.A. Schneider, Micro-clones in evolving software, in SANER (2018), pp. 50–60

    Google Scholar 

  62. M. Mondal, C.K. Roy, K.A. Schneider, A fine-grained analysis on the inconsistent changes in code clones, in ICSME (2020), pp. 220–231

    Google Scholar 

  63. Manishankar Mondal, Chanchal K. Roy, Kevin A. Schneider, Bug-proneness and late propagation tendency of code clones: a comparative study on different clone types. J. Syst. Softw. 144, 41–59 (2018)

    Article  Google Scholar 

  64. G. Mostaeen, J. Svajlenko, B. Roy, C.K. Roy, K.A. Schneider, On the use of machine learning techniques towards the design of cloud based automatic code clone validation tools, in SCAM (2018), pp. 155–164

    Google Scholar 

  65. G. Mostaeen, J. Svajlenko, B. Roy, C.K. Roy, K.A. Schneider, Clonecognition: machine learning based code clone validation tool, in FSE (2019), pp. 1105–1109

    Google Scholar 

  66. M. Nadim, M. Mondal, C.K. Roy, Evaluating performance of clone detection tools in detecting cloned co-change candidates, in IWSC (2020), pp. 15–21

    Google Scholar 

  67. H. Nguyen, T. Nguyen, N. Pham, J. Al-Kofahi, T. Nguyen, Clone management for evolving software. IEEE Trans. Softw. Eng. 38(5), 1008–1026 (2011)

    Article  Google Scholar 

  68. H.A. Nguyen, A.T. Nguyen, T.T. Nguyen, T.N. Nguyen, H. Rajan, A study of repetitiveness of code changes in software evolution, in ASE (2013), pp. 180–190

    Google Scholar 

  69. B. Ray, M. Nagappan, C. Bird, N. Nagappan, T. Zimmermann, The uniqueness of changes: characteristics and applications, in Microsoft Research Technical Report (2014), pp. 1–10

    Google Scholar 

  70. D. Reniers, L. Voinea, O. Ersoy, A. Telea, A visual analytics toolset for program structure, metrics, and evolution comprehension, in International, Workshop on Advanced/Academic Software Development Tools and Techniques (2010)

    Google Scholar 

  71. C.K. Roy, Detection and analysis of near-miss software clones, in Proceedings of the Doctoral Symposium Track of the 25th IEEE International Conference on Software Maintenance (ICSM’09) (2009), pp. 447–450

    Google Scholar 

  72. C.K. Roy, J.R. Cordy, NICAD: accurate detection of near-miss intentional clones using flexible pretty-printing and code normalization, in Proceedings of the 16th IEEE International Conference on Program Comprehension (ICPC’08) (2008), pp. 172–181

    Google Scholar 

  73. C.K. Roy, M.F. Zibran, R. Koschke, The vision of software clone management: past, present, and future (keynote paper), in Proceedings of the IEEE Conference on Software Maintenance, Reengineering and Reverse Engineering (CSMR-WCRE’14), Software Evolution Week (2014), pp. 18–33

    Google Scholar 

  74. V. Rysselberghe, S. Demeyer, Evaluating clone detection techniques from a refactoring perspective, in Proceedings of the 19th IEEE International Conference on Automated Software Engineering (ASE’04) (2004), pp. 336–339

    Google Scholar 

  75. R.K. Saha, C.K. Roy, K.A. Schneider, An automatic framework for extracting and classifying near-miss clone genealogies, in Proceedings of the 27th IEEE International Conference on Software Maintenance (ICSM’11) (2011), pp. 293–302

    Google Scholar 

  76. H. Sajnani, V. Saini, J. Svajlenko, C.K. Roy, C.V. Lopes, SourcererCC: scaling code clone detection to big-code, in Proceedings of the 38th International Conference on Software Engineering (ICSE’16) (2016), pp. 1157–1168

    Google Scholar 

  77. A. Sheneamer, J. Kalita, Semantic clone detection using machine learning, in ICMLA (2016), pp. 1024–1028

    Google Scholar 

  78. J. Svajlenko, C.K. Roy, Evaluating clone detection tools with bigclonebench, in Proceedings of the 31st International Conference on Software Maintenance and Evolution (ICSME’15) (2015), pp. 131–140

    Google Scholar 

  79. J. Svajlenko, C.K. Roy, The mutation and injection framework: evaluating clone detection tools with mutation analysis. IEEE Trans. Softw. Eng. 1 (2019)

    Google Scholar 

  80. S. Tokui, N. Yoshida, E. Choi, K. Inoue, Clone notifier: developing and improving the system to notify changes of code clones, in SANER (2020), pp. 642–646

    Google Scholar 

  81. M. Tokunaga, N. Yoshida, K. Yoshioka, M. Matsushita, K. Inoue, Towards a collection of refactoring patterns based on code clone categorization, in Proceedings of the 2nd Asian Conference on Pattern Languages of Programs (AsianPLoP’11) (2011), pp. 1–6

    Google Scholar 

  82. N. Tsantalis, D. Mazinanian, G.P. Krishnan, Assessing the refactorability of software clones. IEEE Trans. Softw. Eng. 41(11), 1055–1090 (2015)

    Article  Google Scholar 

  83. N. Tsantalis, D. Mazinanian, S. Rostami, Clone refactoring with lambda expressions, in ICSE (2017), pp. 60–70

    Google Scholar 

  84. R. van Tonder, C. Le Goues, Defending against the attack of the micro-clones, in ICPC (2016), pp. 1–4

    Google Scholar 

  85. W. Wang, M.W. Godfrey, Investigating intentional clone refactoring. Electron. Commun. EASST 63, 1–7 (2014)

    Google Scholar 

  86. W. Wang, M.W. Godfrey, Recommending clones for refactoring using design, context, and history, in Proceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution (ICSME’14) (2014), pp. 331–340

    Google Scholar 

  87. S. Xie, F. Khomh, Y. Zou, An empirical study of the fault-proneness of clone mutation and clone migration, in Proceedings of the 10th Working Conference on Mining Software Repositories (MSR’13) (2013), pp. 149–158

    Google Scholar 

  88. H. Yu, W. Lam, L. Chen, G. Li, T. Xie, Q. Wang, Neural detection of semantic code clones via tree-based convolution, in ICPC (2019), pp. 1–11

    Google Scholar 

  89. M.F. Zibran, C.K. Roy, Conflict-aware optimal scheduling of code clone refactoring: a constraint programming approach, in Proceedings of the 19th IEEE International Conference on Program Comprehension (ICPC’11) (IEEE, 2011), pp. 266–269

    Google Scholar 

  90. M.F. Zibran, C.K. Roy, Conflict-aware optimal scheduling of prioritised code clone refactoring. IET Softw. 7(3), 167–186 (2013)

    Article  Google Scholar 

  91. M.F. Zibran, R.K. Saha, C.K. Roy, K.A. Schneider, Genealogical insights into the facts and fictions of clone removal. Appl. Comput. Rev. 13(4), 30–42 (2013)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Manishankar Mondal .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Mondal, M., Roy, C.K., Schneider, K.A. (2021). A Summary on the Stability of Code Clones and Current Research Trends. In: Inoue, K., Roy, C.K. (eds) Code Clone Analysis. Springer, Singapore. https://doi.org/10.1007/978-981-16-1927-4_12

Download citation

  • DOI: https://doi.org/10.1007/978-981-16-1927-4_12

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-16-1926-7

  • Online ISBN: 978-981-16-1927-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics