Abstract
Code clones have long been recognized as bad smells in software systems and are considered to cause maintenance problems during evolution. It is broadly assumed that the more clones two files share, the more often they have to be changed together. This relation between clones and change couplings has been postulated but neither demonstrated nor quantified yet. However, given such a relation it would simplify the identification of restructuring candidates and reduce change couplings. In this paper, we examine this relation and discuss if a correlation between code clones and change couplings can be verified. For that, we propose a framework to examine code clones and relate them to change couplings taken from release history analysis. We validated our framework with the open source project Mozilla and the results of the validation show that although the relation is statistically unverifiable it derives a reasonable amount of cases where the relation exists. Therefore, to discover clone candidates for restructuring we additionally propose a set of metrics and a visualization technique. This allows one to spot where a correlation between cloning and change coupling exists and, as a result, which files should be restructured to ease further evolution.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Addison-Wesley, Reading (1999)
Mayrand, J., Leblanc, C., Merlo, E.: Experiment on the Automatic Detection of Function Clones in a Software System Using Metrics. In: Proceedings of the International Conference on Software Maintenance (ICSM), pp. 244–253. IEEE CS, Monterey, CA, USA (1996)
Grubb, P., Takang, A.A.: Software Maintenance – Concepts and Practice, 2nd edn. World Scientific, Singapore (2003)
Lehman, M.M., Belady, L.: Program Evolution Processes of Software Change. Academic Press, London (1985)
Gall, H., Hajek, K., Jazayeri, M.: Detection of Logical Coupling based on Product Release History. In: Proceedings of the 14th International Conference on Software Maintenance (ICSM), pp. 190–198. IEEE CS, Bethesda, Maryland, USA (1998)
Demeyer, S., Ducasse, S., Nierstrasz, O.: Object-Oriented Reengineering Patterns. Morgan Kaufmann, San Francisco, CA, USA (2003)
Baker, B.S.: A Program for Identifying Duplicated Code. Computing Science and Statistics 24, 49–57 (1992)
Ducasse, S., Rieger, M., Demeyer, S.: A Language Independent Approach for Detecting Duplicated Code. In: Proceedings of the 15th International Conference on Software Maintenance (ICSM), pp. 109–118. IEEE CS, Oxford, England, UK (1999)
Kamiya, T., Kusumoto, S., Inoue, K.: CCfinder: A Multilinguistic Token-based Code Clone Detection System for Large Scale Source Code. IEEE Transaction on Software Engineering 28, 654–670 (2002)
Baxter, I.D., Yahin, A., Moura, L., Sant’Anna, M., Bier, L.: Clone Detection Using Abstract Syntax Trees. In: Proceedings of the 14th International Conference on Software Maintenance (ICSM), pp. 368–377. IEEE CS, Bethesda, Maryland, USA (1998)
Krinke, J.: Identifying Similar Code with Program Dependence Graphs. In: Proceedings of the 8th Working Conference on Reverse Engineering (WCRE), pp. 301–310. IEEE CS, Stuttgart, Germany (2001)
Burd, E., Bailey, J.: Evaluating Clone Detection Tools for Use during Preventative Maintenance. In: Proceedings of the 2nd International Workshop on Source Code Analysis and Manipulation (SCAM), pp. 36–43. IEEE CS, Montreal, Canada (2002)
Ueda, Y., Kamiya, T., Kusumoto, S., Inoue, K.: Gemini: Maintenance Support Environment Based on Code Clone Analysis. In: Proceedings of the 8th International Symposium on Software Metrics (METRICS), pp. 67–76. IEEE CS, Ottawa, Canada (2002)
Rieger, M., Ducasse, S.: Visual Detection of Duplicated Code. In: Workshop on Object-Oriented Technology, pp. 75–76. Springer, Brussels, Belgium (1998)
Casazza, G., Antoniol, G., Villano, U., Merlo, E., Penta, M.D.: Identifying Clones in the Linux Kernel. In: Proceedings of the 1sr International Workshop on Source Code Analysis and Manipulation (SCAM), pp. 90–97. IEEE CS, Florence, Italy (2001)
Kim, M., Bergman, L., Lau, T., Notkin, D.: An Ethnographic Study of Copy and Paste Programming Practices in OOPL. In: Proceedings of the International Symposium on Empirical Software Engineering (ISESE), pp. 83–92. IEEE Computer Society Press, Redondo Beach, CA, USA (2004)
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), pp. 314–323. IEEE CS, Bari, Italy (1997)
Kim, M., Sazawal, V., Notkin, D.: An Empirical Study of Code Clone Genealogies. In: Proceedings of the 10th European software engineering conference held jointly with 13th ACM SIGSOFT international symposium on Foundations of software engineering (ESEC/FSE), pp. 187–196. ACM Press, Lisbon, Protugal (2005)
Kapser, C., Godfrey, M.W.: Aiding Comprehension of Cloning Through Categorization. In: Proceedings of the 7th International Workshop on Principles of Software Evolution (IWPSE), pp. 85–94. IEEE CS, Kyoto, Japan (2004)
Fischer, M., Pinzger, M., Gall, H.: Populating a Release History Database from Version Control and Bug Tracking Systems. In: Proceedings of the 19th International Conference on Software Maintenance (ICSM), pp. 23–32. IEEE CS, Amsterdam, The Netherlands (2003)
Gall, H., Jazayeri, M., Krajewski, J.: CVS Release History Data for Detecting Logical Couplings. In: Proceedings of the 6th International Workshop on Principles of Software Evolution (IWPSE), p. 13. IEEE CS, Helsinki, Finland (2003)
Fluri, B., Gall, H.C., Pinzger, M.: Fine-Grained Analysis of Change Couplings. In: Proceedings of the 5th International Workshop on Source Code Analysis and Manipulation, pp. 66–74. IEEE CS, Budapest, Hungary (2005)
Lanza, M., Ducasse, S.: Polymetric Views – A Lightweight Visual Approach to Reverse Engineering. IEEE Transactions on Software Engineering 29, 782–795 (2003)
Geiger, R.: Evolution Impact of Code Clones – Identification of Structural and Change Smells based on Code Clones. Master’s thesis, University of Zurich (2005), http://seal.ifi.unizh.ch/da
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Geiger, R., Fluri, B., Gall, H.C., Pinzger, M. (2006). Relation of Code Clones and Change Couplings. In: Baresi, L., Heckel, R. (eds) Fundamental Approaches to Software Engineering. FASE 2006. Lecture Notes in Computer Science, vol 3922. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11693017_31
Download citation
DOI: https://doi.org/10.1007/11693017_31
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-33093-6
Online ISBN: 978-3-540-33094-3
eBook Packages: Computer ScienceComputer Science (R0)