Skip to main content

Tracking the Evolution of Code Clones

  • Conference paper
SOFSEM 2011: Theory and Practice of Computer Science (SOFSEM 2011)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6543))

Abstract

It is believed by many academic and industrial experts, that source code cloning (copy&paste programming) represents a significant threat to maintainability in an evolving software system. The real threat does not lie in the existence of duplications, but the fears are in connection with their evolution. There exist an abundance of algorithms for finding code clones in one particular version of a software system, but eliminating or even evaluating these clones often seems hopeless, as there may exist several thousands of them. Tracking the evolution of individual clones might solve the problem, as it could help identifying the inconsistently changing duplications: the clones which are really dangerous at a particular moment. In this paper we present an approach for mapping code duplications from one particular version of the software to another one, based on a similarity distance function. For the suspicious evolution patterns we introduce the term of “clone smells”. By defining the relevant categories of the possible evolution patterns, the proposed method also gives a clue about why the reported code fragments might be dangerous. In the case study, clone smells were extracted, evaluated, and manually categorized throughout many versions of the jEdit system. The findings suggest that roughly half of the reported smells refer to inconsistent changes in the code.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight 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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Mayrand, J., Leblanc, C., Merlo, E.: Experiment on the automatic detection of function clones in a software system using metrics. In: Proceedings of the 1996 International Conference on Software Maintenance, ICSM 1996, p. 244. IEEE Computer Society, Washington (1996)

    Chapter  Google Scholar 

  2. Kapser, C., Godfrey, M.W.: cloning considered harmful” considered harmful. In: Proceedings of the 13th Working Conference on Reverse Engineering, WCRE 2006, pp. 19–28. IEEE Computer Society, Washington (2006)

    Chapter  Google Scholar 

  3. Rahman, F., Bird, C., Devanbu, P.: Clones: What is that smell? In: 7th IEEE Working Conference on Mining Software Repositories (MSR), pp. 72–81 (2010)

    Google Scholar 

  4. Kamiya, T., Kusumoto, S., Inoue, K.: CCFinder: a multilinguistic token-based code clone detection system for large scale source code. IEEE Transactions on Software Engineering 28, 654–670 (2002)

    Article  Google Scholar 

  5. Koschke, R., Falke, R., Frenzel, P.: Clone detection using abstract syntax suffix trees. In: Proceedings of the 13th Working Conference on Reverse Engineering (WCRE 2006), Washington, DC, USA, pp. 253–262. IEEE Computer Society, Los Alamitos (2006)

    Chapter  Google Scholar 

  6. Lague, B., Proulx, D., Mayrand, J., Merlo, E.M., Hudepohl, J.: Assessing the benefits of incorporating function clone detection in a development process. In: Proceedings of the 13th International Conference on Software Maintenance (ICSM 1997), Washington, DC, USA, p. 314. IEEE Computer Society, Los Alamitos (1997)

    Google Scholar 

  7. Antoniol, G., Casazza, G., Di Penta, M., Merlo, E.: Modeling clones evolution through time series. In: Proceedings of the 17th International Conference on Software Maintenance (ICSM 2001), pp. 273–280. IEEE Computer Society, Los Alamitos (2001)

    Chapter  Google Scholar 

  8. Duala-Ekoko, E., Robillard, M.P.: Tracking code clones in evolving software. In: ICSE 2007: Proceedings of the 29th International Conference on Software Engineering, Washington, DC, USA, pp. 158–167. IEEE Computer Society, Los Alamitos (2007)

    Google Scholar 

  9. Kim, M., Sazawal, V., Notkin, D., Murphy, G.: An empirical study of code clone genealogies. SIGSOFT Software Engineering Notes 30, 187–196 (2005)

    Article  Google Scholar 

  10. Göde, N., Koschke, R.: Incremental clone detection. In: European Conference on Software Maintenance and Reengineering, pp. 219–228 (2009)

    Google Scholar 

  11. Thummalapenta, S., Cerulo, L., Aversano, L., Di Penta, M.: An empirical study on the maintenance of source code clones. Empirical Softw. Engg. 15, 1–34 (2010)

    Article  Google Scholar 

  12. Krinke, J.: A study of consistent and inconsistent changes to code clones. In: Proceedings of the 14th Working Conference on Reverse Engineering, WCRE 2007, pp. 170–178. IEEE Computer Society, Washington (2007)

    Google Scholar 

  13. Canfora, G., Cerulo, L., Di Penta, M.: Identifying changed source code lines from version repositories. In: Proceedings of the Fourth International Workshop on Mining Software Repositories, MSR 2007, IEEE Computer Society, Washington (2007)

    Google Scholar 

  14. Bakota, T., Ferenc, R., Gyimothy, T.: Clone smells in software evolution. In: Proceedings of the 23rd International Conference on Software Maintenance (ICSM 2007), October 2-5, pp. 24–33 (2007)

    Google Scholar 

  15. Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional, Reading (1999)

    Google Scholar 

  16. jEdit Homepage, http://www.jedit.org

  17. Ferenc, R., Beszédes, Á., Tarkiainen, M., Gyimóthy, T.: Columbus – Reverse Engineering Tool and Schema for C++. In: Proceedings of the 18th International Conference on Software Maintenance (ICSM 2002), pp. 172–181. IEEE Computer Society, Los Alamitos (2002)

    Chapter  Google Scholar 

  18. FrontEndART Software Ltd, http://www.frontendart.com (2001)

  19. Ferenc, R., Beszédes, Á.: Data Exchange with the Columbus Schema for C++. In: Proceedings of the 6th European Conference on Software Maintenance and Reengineering (CSMR 2002), pp. 59–66. IEEE Computer Society, Los Alamitos (2002)

    Chapter  Google Scholar 

  20. Yudin, D., Gol’shtein, E.G.: Linear Programing Problems of Transportation. NAUKA (1969) (in Russian)

    Google Scholar 

  21. Kuhn, H.W.: The Hungarian method for the assignment problem. Naval Research Logistic Quarterly 2, 83–97 (1955)

    Article  MathSciNet  MATH  Google Scholar 

  22. Levenshtein distance, http://en.wikipedia.org/wiki/Levenshtein_distance

  23. Kirkpatrick, S., Gelatt, C.D., Vecchi, M.P.: Optimization by simulated annealing. Science 220(4598), 671–680 (1983)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Bakota, T. (2011). Tracking the Evolution of Code Clones. In: Černá, I., et al. SOFSEM 2011: Theory and Practice of Computer Science. SOFSEM 2011. Lecture Notes in Computer Science, vol 6543. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-18381-2_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-18381-2_7

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-18380-5

  • Online ISBN: 978-3-642-18381-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics