Skip to main content

Clone Evolution and Management

  • Chapter
  • First Online:
Code Clone Analysis

Abstract

Programmers tend to write code clones unintentionally, which can be easily avoided. Clone change management is a crucial issue in open-source software (OSS) and industrial software development (e.g., development of social infrastructure, financial systems, and medical equipment). When industrial software developers have to fix a defect, they must find the code clones corresponding to the code fragment, including it. To date, several studies have been conducted on the analysis of clone evolution using OSS. However, only a few studies have reported on the application of a clone change notification system to the industrial software development process of our knowledge. In this chapter, first, we introduce a system that notifies about the creation of code clones. Then, we report on our experience with the system after a 40-day long application of it in a corporation’s software development process. In the industrial application, a developer successfully identified ten unintentionally created clones that should be merged. Moreover, we introduce the improvements that were made since we released the initial version of the notification system. Besides, we demonstrate a usage scenario of the current version. The current version of Clone Notifier and its video are available at: https://github.com/s-tokui/CloneNotifier.

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

Notes

  1. 1.

    https://jgrapht.org/.

  2. 2.

    https://www.postgresql.org/message-id/20181206222221.g5witbsklvqthjll@alvherre.pgsql.

References

  1. L. Aversano, L. Cerulo, M. Di Penta, How clones are maintained: an empirical study, in 11th European Conference on Software Maintenance and Reengineering (CSMR’07) (2007), pp. 81–90. https://doi.org/10.1109/CSMR.2007.26

  2. T. Bakota, R. Ferenc, T. Gyimothy, Clone smells in software evolution, in 2007 IEEE International Conference on Software Maintenance (2007), pp. 24–33. https://doi.org/10.1109/ICSM.2007.4362615

  3. E. Duala-Ekoko, M.P. Robillard, Tracking code clones in evolving software, in Proceedings of the 29th International Conference on Software Engineering, ICSE ’07 (IEEE Computer Society, USA, 2007), pp. 158–167. https://doi.org/10.1109/ICSE.2007.90

  4. E. Duala-Ekoko, M.P. Robillard, Clone region descriptors: representing and tracking duplication in source code. ACM Trans. Softw. Eng. Methodol. 20(1) (2010). https://doi.org/10.1145/1767751.1767754

  5. M. Fowler, Refactoring: Improving the Design of Existing Code (Addison-Wesley, Boston, MA, USA, 1999)

    MATH  Google Scholar 

  6. J. Harder, N. Gode, Modeling clone evolution, in Proceeding of the 3rd International Workshop on Software Clones, pp. 17–21 (2009)

    Google Scholar 

  7. Honda, H., Tokui, S., Yokoi, K., Choi, E., Yoshida, N., Inoue, K.: CCEvovis: a clone evolution visualization system for software maintenance, in 2019 IEEE/ACM 27th International Conference on Program Comprehension (ICPC) (2019), pp. 122–125. https://doi.org/10.1109/ICPC.2019.00026

  8. K. Inoue, Y. Higo, N. Yoshida, E. Choi, S. Kusumoto, K. Kim, W. Park, E. Lee, Experience of finding inconsistently-changed bugs in code clones of mobile software, in 2012 6th International Workshop on Software Clones (IWSC) (2012), pp. 94–95. https://doi.org/10.1109/IWSC.2012.6227882

  9. L. Jiang, Z. Su, E. Chiu, Context-based detection of clone-related bugs, in Proceedings of the the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on The Foundations of Software Engineering, ESEC-FSE ’07 (Association for Computing Machinery, New York, NY, USA, 2007), pp. 55–64. https://doi.org/10.1145/1287624.1287634

  10. E. Juergens, F. Deissenboeck, B. Hummel, S. Wagner, Do code clones matter?, in Proceedings of the 31st International Conference on Software Engineering, ICSE ’09 (IEEE Computer Society, USA, 2009), pp. 485–495. https://doi.org/10.1109/ICSE.2009.5070547

  11. 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). https://doi.org/10.1109/TSE.2002.1019480

    Article  Google Scholar 

  12. M. Kim, V. Sazawal, D. Notkin, G. Murphy, An empirical study of code clone genealogies (Association for Computing Machinery, New York, NY, USA, 2005), pp. 187–196. https://doi.org/10.1145/1095430.1081737

  13. J. Krinke, A study of consistent and inconsistent changes to code clones, in 14th Working Conference on Reverse Engineering (WCRE 2007) (2007), pp. 170–178. https://doi.org/10.1109/WCRE.2007.7

  14. Z. Li, S. Lu, S. Myagmar, Y. Zhou, CP-Miner: finding copy-paste and related bugs in large-scale software code. IEEE Trans. Softw. Eng. 32(3), 176–192 (2006). https://doi.org/10.1109/TSE.2006.28

    Article  Google Scholar 

  15. H.A. Nguyen, T.T. Nguyen, N.H. Pham, J. Al-Kofahi, T.N. Nguyen, Clone management for evolving software. IEEE Trans. Softw. Eng. 38(5), 1008–1026 (2012). https://doi.org/10.1109/TSE.2011.90

    Article  Google Scholar 

  16. J.R. Pate, R. Tairas, N.A. Kraft, Clone evolution: a systematic review. J. Softw. Evol. Process 25(3), 261–283 (2013)

    Google Scholar 

  17. R.K. Saha, C.K. Roy, K.A. Schneider, gCad: a near-miss clone genealogy extractor to support clone evolution analysis, in 2013 IEEE International Conference on Software Maintenance (2013), pp. 488–491. https://doi.org/10.1109/ICSM.2013.79

  18. H. Sajnani, V. Saini, J. Svajlenko, C.K. Roy, C.V. Lopes, SourcererCC: scaling code clone detection to big-code, in 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE) (2016), pp. 1157–1168. https://doi.org/10.1145/2884781.2884877

  19. S. Tokui, N. Yoshida, E. Choi, K. Inoue, Clone notifier: developing and improving the system to notify changes of code clones, in 2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER) (2020), pp. 642–646. https://doi.org/10.1109/SANER48275.2020.9054793

  20. Y. Yamanaka, E. Choi, N. Yoshida, K. Inoue, T. Sano, Applying clone change notification system into an industrial development process, in 2013 21st International Conference on Program Comprehension (ICPC) (2013), pp. 199–206. https://doi.org/10.1109/ICPC.2013.6613848

  21. K. Yokoi, E. Choi, N. Yoshida, K. Inoue, Investigating vector-based detection of code clones using BigCloneBench, in 2018 25th Asia-Pacific Software Engineering Conference (APSEC) (2018), pp. 699–700. https://doi.org/10.1109/APSEC.2018.00095

  22. N. Yoshida, S. Numata, E. Choiz, K. Inoue, Proactive clone recommendation system for extract method refactoring, in 2019 IEEE/ACM 3rd International Workshop on Refactoring (IWoR) (2019), pp. 67–70. https://doi.org/10.1109/IWoR.2019.00020

  23. A. Zeller, Why Programs Fail: A Guide to Systematic Debugging, 2nd edn. (Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2009)

    Google Scholar 

Download references

Acknowledgements

We would like to thank Ms. Fusako Mitsuhashi and Mr. Shin’ichi Iwasaki of NEC Corporation for data collection. We also thank Yuki Yamanaka, Shogo Tokui, Mananu Sano, Seiya Numata, Kazuki Yokoi, and Katsuro Inoue of Osaka University for their contribution to Clone Notifier. This work was supported by JSPS KAKENHI Grant Numbers JP18H04094, JP19K20240, JP20K11745.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Norihiro Yoshida .

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

Yoshida, N., Choi, E. (2021). Clone Evolution and Management. In: Inoue, K., Roy, C.K. (eds) Code Clone Analysis. Springer, Singapore. https://doi.org/10.1007/978-981-16-1927-4_14

Download citation

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

  • 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