Code clones in feature-oriented software product lines

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.

[1]  Thomas Thüm,et al.  Reasoning about edits to feature models , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[2]  Jens Krinke,et al.  Identifying similar code with program dependence graphs , 2001, Proceedings Eighth Working Conference on Reverse Engineering.

[3]  Jia Liu,et al.  Feature oriented refactoring of legacy applications , 2006, ICSE.

[4]  Martin P. Robillard,et al.  Tracking Code Clones in Evolving Software , 2007, 29th International Conference on Software Engineering (ICSE'07).

[5]  Chanchal Kumar Roy,et al.  Comparison and evaluation of code clone detection techniques and tools: A qualitative approach , 2009, Sci. Comput. Program..

[6]  Kyo Chul Kang,et al.  Feature-Oriented Domain Analysis (FODA) Feasibility Study , 1990 .

[7]  Michael W. Godfrey,et al.  Supporting the analysis of clones in software systems: Research Articles , 2006 .

[8]  Brian Foote,et al.  Designing Reusable Classes , 2001 .

[9]  Paul Clements,et al.  Software product lines - practices and patterns , 2001, SEI series in software engineering.

[10]  Arie van Deursen,et al.  On the use of clone detection for identifying crosscutting concern code , 2005, IEEE Transactions on Software Engineering.

[11]  Brenda S. Baker,et al.  On finding duplication and near-duplication in large software systems , 1995, Proceedings of 2nd Working Conference on Reverse Engineering.

[12]  Stéphane Ducasse,et al.  A language independent approach for detecting duplicated code , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[13]  Paulo Borba,et al.  Deriving refactorings for AspectJ , 2005, AOSD '05.

[14]  Paul W. Oman,et al.  Experiences developing and maintaining software in a multi-platform environment , 1997, 1997 Proceedings International Conference on Software Maintenance.

[15]  Ettore Merlo,et al.  Experiment on the automatic detection of function clones in a software system using metrics , 1996, 1996 Proceedings of International Conference on Software Maintenance.

[16]  Giuliano Antoniol,et al.  Comparison and Evaluation of Clone Detection Tools , 2007, IEEE Transactions on Software Engineering.

[17]  João M. Fernandes,et al.  Towards a catalog of aspect-oriented refactorings , 2005, AOSD '05.

[18]  Elmar Jürgens,et al.  Do code clones matter? , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[19]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[20]  D. L. Parnas,et al.  On the criteria to be used in decomposing systems into modules , 1972, Software Pioneers.

[21]  Chanchal K. Roy,et al.  A Survey on Software Clone Detection Research , 2007 .

[22]  Sven Apel,et al.  FEATUREHOUSE: Language-independent, automated software composition , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[23]  Don S. Batory,et al.  Scaling step-wise refinement , 2004, IEEE Transactions on Software Engineering.

[24]  Sven Apel,et al.  A model of refactoring physically and virtually separated features , 2009, GPCE '09.

[25]  Thomas Leich,et al.  Aspectual Feature Modules , 2008, IEEE Transactions on Software Engineering.

[26]  Andrew Begel,et al.  Managing Duplicated Code with Linked Editing , 2004, 2004 IEEE Symposium on Visual Languages - Human Centric Computing.

[27]  Miguel P. Monteiro,et al.  CATALOGUE OF REFACTORINGS FOR ASPECTJ , 2004 .

[28]  Sven Apel,et al.  How AspectJ is Used: An Analysis of Eleven AspectJ Programs , 2010, J. Object Technol..

[29]  Akito Monden,et al.  Software quality analysis by code clones in industrial legacy software , 2002, Proceedings Eighth IEEE Symposium on Software Metrics.

[30]  Yuanyuan Zhou,et al.  CP-Miner: finding copy-paste and related bugs in large-scale software code , 2006, IEEE Transactions on Software Engineering.

[31]  Martin P. Robillard,et al.  Separating features in source code: an exploratory study , 2001, Proceedings of the 23rd International Conference on Software Engineering. ICSE 2001.

[32]  Shinji Kusumoto,et al.  ARIES: Refactoring support environment based on code clone analysis , 2004, IASTED Conf. on Software Engineering and Applications.

[33]  Gordon S. Blair,et al.  On the Separation of Concerns in Program Families , 2004 .

[34]  Rainer Koschke,et al.  Supporting the Grow-and-Prune Model in Software Product Lines Evolution Using Clone Detection , 2008, 2008 12th European Conference on Software Maintenance and Reengineering.

[35]  Christian Prehofer,et al.  Feature-Oriented Programming: A Fresh Look at Objects , 1997, ECOOP.

[36]  Vander Alves,et al.  Extracting and Evolving Mobile Games Product Lines , 2005, SPLC.

[37]  Kostas Kontogiannis,et al.  Evaluation experiments on the detection of programming patterns using software metrics , 1997, Proceedings of the Fourth Working Conference on Reverse Engineering.

[38]  Magdalena Balazinska,et al.  Advanced clone-analysis to support object-oriented system refactoring , 2000, Proceedings Seventh Working Conference on Reverse Engineering.

[39]  Thomas Leich,et al.  FeatureC++: on the symbiosis of feature-oriented and aspect-oriented programming , 2005, GPCE'05.

[40]  Zhendong Su,et al.  DECKARD: Scalable and Accurate Tree-Based Detection of Code Clones , 2007, 29th International Conference on Software Engineering (ICSE'07).

[41]  Shinji Kusumoto,et al.  A metric-based approach to identifying refactoring opportunities for merging code clones in a Java software system , 2008, J. Softw. Maintenance Res. Pract..

[42]  Damith C. Rajapakse,et al.  Beyond templates: a study of clones in the STL and some general implications , 2005, Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005..

[43]  Roberto Erick Lopez-Herrejon,et al.  A Standard Problem for Evaluating Product-Line Methodologies , 2001, GCSE.

[44]  Shinji Kusumoto,et al.  CCFinder: A Multilinguistic Token-Based Code Clone Detection System for Large Scale Source Code , 2002, IEEE Trans. Software Eng..

[45]  Sven Apel,et al.  Granularity in software product lines , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[46]  Michael W. Godfrey,et al.  Supporting the analysis of clones in software systems , 2006, J. Softw. Maintenance Res. Pract..