skip to main content
research-article

Code clones in feature-oriented software product lines

Published:10 October 2010Publication History
Skip Abstract Section

Abstract

Some limitations of object-oriented mechanisms are known to cause code clones (e.g., extension using inheritance). Novel programming paradigms such as feature-oriented programming (FOP) aim at alleviating these limitations. However, it is an open issue whether FOP is really able to avoid code clones or whether it even facilitates (FOP-related) clones. To address this issue, we conduct an empirical analysis on ten feature-oriented software product lines with respect to code cloning. We found that there is a considerable number of clones in feature-oriented software product lines and that a large fraction of these clones is FOP-related (i.e., caused by limitations of feature-oriented mechanisms). Based on our results, we initiate a discussion on the reasons for FOP-related clones and on how to cope with them. We show by means of examples how such clones can be removed by applying refactorings.

References

  1. }}V. Alves and et al. Extracting and Evolving Mobile Games Product Lines. In Proc. of the Int. Software Product Line Conf., pages 70--81. Springer-Verlag, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. }}S. Apel. How AspectJ is Used: An Analysis of Eleven AspectJ Programs. Journal of Object Technology, 9(1):117--142, 2010.Google ScholarGoogle ScholarCross RefCross Ref
  3. }}S. Apel, T. Leich, M. Rosenmuller, and G. Saake. Feature C++: On the Symbiosis of Feature-Oriented and Aspect-Oriented Programming. In Proc. of the Int. Conf. on Generative Programming and Component Engineering, pages 125--140. Springer Verlag, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}S. Apel, T. Leich, and G. Saake. Aspectual Feature Modules. 34(2):162--180, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}S. Apel, C. K¨astner, and C. Lengauer. FeatureHouse: Language-Independent, Automated Software Composition. In Proc. Int. Conf. on Software Engineering, pages 221--231. IEEE Computer Society, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. }}B. S. Baker. On Finding Duplication and Near-Duplication in Large Software Systems. In Proc. of the Work. Conf. on Reverse Engineering, pages 86--95. IEEE Computer Society, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. }}M. Balazinska, E. Merlo, M. Dagenais, B. Lag¨ue, and K. Kontogiannis. Advanced Clone-Analysis to Support Object-Oriented System Refactoring. In Proc. of the Work. Conf. on Reverse Engineering, pages 98--107. IEEE Computer Society, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. }}H. Basit, D. Rajapakse, and S. Jarzabek. Beyond Templates: A Study of Clones in the STL and some General Implications. In Proc. Int. Conf. on Software Engineering, pages 451--459. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. }}D. Batory, J. Sarvela, and A. Rauschmayer. Scaling Step-Wise Refinement. IEEE Trans. Soft. Eng., 30(6):355--371, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}I. Baxter, A. Yahin, L. Moura, M. Sant'Anna, and L. Bier. Clone Detection Using Abstract Syntax Trees. In Proc. of the Int. Conf. on Software Maintenance, pages 368--377. IEEE Computer Society, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}S. Bellon, R. Koschke, G. Antoniol, J. Krinke, and E. Merlo. Comparison and Evaluation of Clone Detection Tools. IEEE Trans. Soft. Eng., 33(9):577--591, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. }}M. Bruntink, A. Deursen, R. Engelen, and T. Tourwe. On the Use of Clone Detection for Identifying Crosscutting Concern Code. volume 31, pages 804--818. IEEE Computer Society, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. }}P. Clements and L. Northrop. Software Prodcut Lines: Practices and Patterns. Addison Wesley, 2006.Google ScholarGoogle Scholar
  14. }}P. Cole, L.and Borba. Deriving Refactorings for AspectJ. In Proc. Int. Conf. on Aspect-Oriented Software Development, pages 123--134. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. }}A. Colyer, R. A., and G. Blair. On the Separation of Concerns in Program Families. Technical Report Technical Report COMP-001--2004, Computing Department, Lancaster University, 2004.Google ScholarGoogle Scholar
  16. }}E. Duala-Ekoko and M. Robillard. Tracking Code Clones in Evolving Software. In Proc. Int. Conf. on Software Engineering, pages 158--167. IEEE Computer Society, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. }}S. Ducasse, M. Rieger, and S. Demeyer. A Language Independent Approach for Detecting Duplicated Code. In Proc. of the Int. Conf. on Software Maintenance, pages 109--118. IEEE Computer Society, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}M. Fowler. Refactoring -- Improving the Design of Existing Code. Addison Wesley, 2000.Google ScholarGoogle Scholar
  19. }}Y. Higo, T. Kamiya, S. Kusumoto, and K. Inoue. Aries: Refactoring Support Environment based on Code Clone Analysis. In Proc. of Int'l Conf. on Soft. Eng. and Appl. (SEA), pages 222--229. ACTA Press, 2004.Google ScholarGoogle Scholar
  20. }}Y. Higo, S. Kusumoto, and K. Inoue. A Metric-Based Approach to Identifying Refactoring Opportunities for Merging Code Clones in a Java Software System. J. Softw. Maint. Evol., 20(6):435--461, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. }}L. Jiang, G. Misherghi, Z. Su, and S. Glondu. DECKARD: Scalable and Accurate Tree-based Detection of Code Clones. In Proc. Int. Conf. on Software Engineering, pages 96--105. IEEE Computer Society, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. }}R. Johnson and B. Foote. Designing Reusable Classes. J. of Object-Oriented Progr., 1(2):22--35, 1988.Google ScholarGoogle Scholar
  23. }}E. Juergens, F. Deissenboeck, B. Hummel, and S. Wagner. Do Code Clones Matter? In Proc. Int. Conf. on Software Engineering, pages 485--495. IEEE Computer Society, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. }}T. Kamiya, S. Kusumoto, and K. Inoue. CCFinder: A Multilinguistic Token-Based Code Clone Detection System for Large Scale Source Code. volume 28, pages 654--670. IEEE Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. }}K. Kang, S. Cohen, J. Hess, W. Novak, and A. Peterson. Feature-Oriented Domain Analysis (FODA) Feasibility Study. Technical Report CMU/SEI-90-TR-21, Software Engineering Institute, Carnegie Mellon University, 1990.Google ScholarGoogle ScholarCross RefCross Ref
  26. }}C. Kapser and M. W. Godfrey. Supporting the Analysis of Clones in Software Systems: A Case Study. J. Softw. Maint. Evol., 18(2):61--82, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. }}C. Kastner, S. Apel, and M. Kuhlemann. Granularity in Software Product Lines. In Proc. Int. Conf. on Software Engineering, pages 311--320. ACM Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. }}C. Kastner, S. Apel, and M. Kuhlemann. A Model of Refactoring Physically and Virtually Separated Features. In Proc. of the Int. Conf. on Generative Programming and Component Engineering, pages 157--166. ACM Press, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. }}G. Kiczales et al. Aspect-Oriented Programming. In Proc. of the Eur. Conf. on Object-Oriented Programming, pages 220--242, 1997.Google ScholarGoogle Scholar
  30. }}K. Kontogiannis. Evaluation Experiments on the Detection of Programming Patterns Using Software Metrics. In Proc. of the Work. Conf. on Reverse Engineering, pages 44--55. IEEE Computer Society, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. }}J. Krinke. Identifying Similar Code with Program Dependence Graphs. In Proc. of the Work. Conf. on Reverse Engineering, pages 301--309. IEEE Computer Society, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. }}Z. Li, S. Lu, S. Myagmar, and Y. Zhou. CP-Miner: Finding Copy-Paste and Related Bugs in Large-Scale Software Code. IEEE Trans. Soft. Eng., 32(3):176--192, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. }}J. Liu, D. Batory, and C. Lengauer. Feature Oriented Refactoring of Legacy Applications. In Proc. Int. Conf. on Software Engineering, pages 112--121. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. }}R. Lopez-Herrejon and D. Batory. A Standard Problem for Evaluating Product-Line Methodologies. In Proc. of the Int'l Conf. on Generative and Component-Based Soft. Eng. (GCSE), pages 10--24. Springer-Verlag, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. }}J. Mayrand, C. Leblanc, and E. Merlo. Experiment on the Automatic Detection of Function Clones in a Software System Using Metrics. In Proc. of the Int. Conf. on Software Maintenance, pages 244--254. IEEE Computer Society, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. }}T. Mende, F. Beckwermert, R. Koschke, and G. Meier. Supporting the Grow-and-Prune Model in Software Product Lines Evolution Using Clone Detection. In Proc. of the Eur. Conf. on Software Maintenance and Reengineering, pages 163--172. IEEE Computer Society, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. }}A. Monden, D. Nakae, T. Kamiya, S. Sato, and K. Matsumoto. Software Quality Analysis by Code Clones in Industrial Legacy Software. In Proc. of the Int Symposium on Software Metrics, pages 87--96. IEEE Computer Society, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. }}M. Monteiro and J. Fernandes. Towards a Catalog of Aspect-Oriented Refactorings. In Proc. Int. Conf. on Aspect-Oriented Software Development, pages 111--122. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. }}G. Murphy, A. Lai, R. Walker, and M. Robillard. Separating Features in Source Code: An Exploratory Study. In Proc. Int. Conf. on Software Engineering, pages 275--284. IEEE Computer Society, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. }}D. L. Parnas. On the Criteria to be used in Decomposing Systems into Modules. Commun. ACM, 15(12):1053--1058, 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. }}P. W. Pearse, T. T.and Oman. Experiences Developing and Maintaining Software in a Multi-Platform Environment. In Proc. of the Int. Conf. on Software Maintenance, pages 270--277. IEEE Computer Society, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. }}C. Prehofer. Feature-Oriented Programming: A Fresh Look at Objects. In Proc. of the Eur. Conf. on Object-Oriented Programming, pages 419--443. Springer, 1997.Google ScholarGoogle Scholar
  43. }}C. Roy and J. Cordy. A Survey on Software Clone Detection Research. Technical Report 2007--451, School of Computing, Queen's University at Kingston, 2007.Google ScholarGoogle Scholar
  44. }}C. K. Roy, J. Cordy, and R. Koschke. Comparison and Evaluation of Code Clone Detection Techniques and Tools: A Qualitative Approach. Sci. Comp. Prog., 74(7):470--495, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. }}T. Thum, D. Batory, and C. K¨astner. Reasoning about Edits to Feature Models. In Proc. Int. Conf. on Software Engineering, pages 254--264. IEEE Computer Society, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. }}M. Toomim, A. Begel, and S. Graham. Managing Duplicated Code with Linked Editing. In Proc. of the Symposium on Visual Languages - Human Centric Computing, pages 173--180. IEEE Computer Society, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Code clones in feature-oriented software product lines

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 46, Issue 2
        GPCE '10
        Febuary 2011
        185 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1942788
        Issue’s Table of Contents
        • cover image ACM Conferences
          GPCE '10: Proceedings of the ninth international conference on Generative programming and component engineering
          October 2010
          198 pages
          ISBN:9781450301541
          DOI:10.1145/1868294
          • General Chair:
          • Eelco Visser,
          • Program Chair:
          • Jaakko Järvi

        Copyright © 2010 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 10 October 2010

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!