Towards a Better Understanding of Feature Dependencies in Preprocessor-based Systems

Preprocessors are a common mechanism to implement features. In this context, features usually share elements, like variables and methods, which leads to code level feature dependencies like when a feature declares a variable used by another feature. Thus, developers are susceptible to maintain a feature and cause problems to another. To better understand feature dependencies, in this paper we complement previous work by providing an empirical study about them where we investigate if there are correlations with software complexity. In addition, we investigate where they occur, i.e., in which kinds of preprocessor directives we can find them. In particular, we answer the following research questions: How does program size influence feature dependencies? How does the number of features influences feature dependencies? How does the number of different kinds of preprocessor directives influence feature dependencies? How often do feature dependencies occur for each kind of preprocessor directive? To answer them, we analyze 45 preprocessor-based systems, software families, and product lines of different domains, size, and languages. The data we collect complement previous work and show that (i) there are correlations with complexity and (ii) we can find feature dependencies in many kinds of preprocessor directives.

[1]  M. Kendall,et al.  The Problem of $m$ Rankings , 1939 .

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

[3]  Henry Spencer,et al.  #ifdef Considered Harmful, or Portability Experience with C News , 1992, USENIX Summer.

[4]  Michael D. Ernst,et al.  An Empirical Analysis of C Preprocessor Use , 2002, IEEE Trans. Software Eng..

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

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

[7]  Márcio Ribeiro,et al.  Emergent feature modularization , 2010, SPLASH/OOPSLA Companion.

[8]  Sven Apel,et al.  An analysis of the variability in forty preprocessor-based software product lines , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[9]  Sven Apel,et al.  Analyzing the discipline of preprocessor annotations in 30 million lines of C code , 2011, AOSD '11.

[10]  Claus Brabrand,et al.  On the impact of feature dependencies when maintaining preprocessor-based software product lines , 2011, GPCE '11.