Code Clones in Feature-Oriented Software Product Lines
by Sandro Schulze, Sven Apel, and Christian Kästner
In Proceedings of the 9th International Conference on Generative Programming and Component Engineering (GPCE), pages 103–112. ACM Press, 2010.
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-specific) 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 amount of clones in feature-oriented software product lines and that a large fraction of these clones is FOP-specific (i.e., caused by limitations of feature-oriented mechanisms). Based on our results, we initiate a discussion on the reasons for FOP-specific clones and on how to cope with them. We exemplary show how such clones can be removed by the application of refactoring.