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.
- }}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 Scholar
Digital Library
- }}S. Apel. How AspectJ is Used: An Analysis of Eleven AspectJ Programs. Journal of Object Technology, 9(1):117--142, 2010.Google Scholar
Cross Ref
- }}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 Scholar
Digital Library
- }}S. Apel, T. Leich, and G. Saake. Aspectual Feature Modules. 34(2):162--180, 2008. Google Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}D. Batory, J. Sarvela, and A. Rauschmayer. Scaling Step-Wise Refinement. IEEE Trans. Soft. Eng., 30(6):355--371, 2004. Google Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}P. Clements and L. Northrop. Software Prodcut Lines: Practices and Patterns. Addison Wesley, 2006.Google Scholar
- }}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 Scholar
Digital Library
- }}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 Scholar
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}M. Fowler. Refactoring -- Improving the Design of Existing Code. Addison Wesley, 2000.Google Scholar
- }}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 Scholar
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}R. Johnson and B. Foote. Designing Reusable Classes. J. of Object-Oriented Progr., 1(2):22--35, 1988.Google Scholar
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Cross Ref
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}G. Kiczales et al. Aspect-Oriented Programming. In Proc. of the Eur. Conf. on Object-Oriented Programming, pages 220--242, 1997.Google Scholar
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}D. L. Parnas. On the Criteria to be used in Decomposing Systems into Modules. Commun. ACM, 15(12):1053--1058, 1972. Google Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
- }}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 Scholar
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}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 Scholar
Digital Library
Index Terms
Code clones in feature-oriented software product lines
Recommendations
Variant-preserving refactoring in feature-oriented software product lines
VaMoS '12: Proceedings of the 6th International Workshop on Variability Modeling of Software-Intensive SystemsA software product line (SPL) is an advanced concept to manage a family of programs under one umbrella. As with stand-alone programs, maintenance is an important challenge within SPL engineering. One pivotal activity during software maintenance is ...
Refactoring delta-oriented software product lines
AOSD '13: Proceedings of the 12th annual international conference on Aspect-oriented software developmentDelta-oriented programming (DOP) is an implementation approach to develop software product lines (SPL). Delta-oriented SPLs evolve over time due to new or changed requirements and need to be maintained to retain their value. Refactorings have been ...
Code clones in feature-oriented software product lines
GPCE '10: Proceedings of the ninth international conference on Generative programming and component engineeringSome 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 ...







Comments