

A key challenge of product line engineering is to guarantee that only well-typed programs are generated.
#Dms software reengineering toolkit generator
A feature-oriented decomposition enables a generator to create an executable program by composing feature code solely on the basis of the feature selection of a user - no other information needed. When added to a program, a feature involves the introduction of new structures, such as classes and methods, and the refinement of existing ones, such as extending methods. A feature implements a stakeholder's requirement and represents a design decision or configuration option. Although emphTypeChef is still under development and cannot yet process arbitrary C code, we demonstrate its capabilities so far with a case study: By type checking the open-source web server emphBoa with potentially $2^110$ variants, we found type errors in several variants.Ī feature-oriented product line is a family of programs that share a common set of features. In this paper, we describe the problems faced and our progress to solve them with emphTypeChef. However, a product-line-aware type system for C is more difficult than expected due to several peculiarities of the preprocessor, including lexical macros and unrestricted use of emph#ifdef directives. With emphTypeChef, we build a similar type checker for product lines written in C that implements variability with emph#ifdef directives of the C preprocessor. In prior work, we and others have developed product-line-aware type systems to detect type errors in a product line, without generating all variants. However, the implementation of product lines raises new challenges, as potentially millions of program variants are developed in parallel. Software product lines have gained momentum as an approach to generate many variants of a program, each tailored to a specific use case, from a common code base. We implement variabilityaware parsers for Java and GNU C and demonstrate practicability by parsing the product line MobileMedia and the entire X86 architecture of the Linux kernel with 6065 variable features. Beyond the obvious task of detecting syntax errors, our parser paves the road for further analysis, such as variability-aware type checking. As part of the TypeChef project, we contribute a novel variability-aware parser that can parse unpreprocessed code without heuristics in practicable time. However, current parsing solutions use heuristics, support only a subset of the language, or suffer from exponential explosion. To analyze code with its variability, we need to parse it without preprocessing it. Unfortunately, while being a simply way to implement variability, conditional compilation and lexical macros hinder automatic analysis, even though such analysis would be urgently needed to combat variability-induced complexity. In many projects, lexical preprocessors are used to manage different variants of the project (using conditional compilation) and to define compile-time code transformations (using macros). We integrate these and other findings in a tool called FeatureCommander, which facilitates program comprehension in practice and which can serve as a basis for further research. Additionally, we found that subjects generally favor background colors. Our results demonstrate that background colors have the potential to improve program comprehension, independently of size and programming language of the underlying product.

In three controlled experiments with over 70 subjects in total, we evaluate whether and how background colors improve program comprehension in preprocessor-based implementations. Instead, we and others propose to increase the readability of preprocessor directives by using background colors to highlight source code annotated with ifdef directives.

There are many voices that suggest to use other implementation techniques instead, but these voices ignore the fact that a transition from preprocessors to other languages and tools is tedious, erroneous, and expensive in practice. However, preprocessor directives have been heavily criticized in academia and even referred to as “#ifdef hell”, because they introduce threats to program comprehension and correctness. Preprocessor directives are easy to use, and many mature tools are available for practitioners. In practice, software product lines are often implemented with preprocessors.

Software-product-line engineering aims at the development of variable and reusable software systems.
