A guide to creating efficient variants

FeatureIDE - A novel approach to developing software - Part 3

     

Generating Variants

After implementing the features we can generate variants of our calculator. In order to generate a tailor-made application, we select a set of features that we want to include. A selection of features is called configuration and can be created with a graphical editor (see Figure 3). Once we have chosen the desired feature, the resulting variant is generated automatically and is ready to use. . Variants can be tailored to functional requirements, such as addition and multiplication, as well as non-functional requirements, such as program size and execution time.

Figure 3 - Selecting Features

Specifying Valid Combinations of Features

Certain combinations of features may not lead to useful variants (e.g., mobile and PC support must not be selected together in our example). FeatureIDE guides us when selecting features by disabling options that lead to such invalid configurations, e.g. after selecting Mobile the feature PC will be disabled for this configuration because these two features are alternative. Alternative means that our application does not support both features in the very same variant.

Figure 4: Feature Model

A programmer creates a feature model to define how features relate to each other. A feature model is basically a hierarchy of features that can be created and edited graphically and textually in FeatureIDE (see Figure 4). The root feature (feature Calculator in our example), must be selected in every configuration and contains functionality that is used in every variant. Other features can be added to the feature model in a couple of ways representing different forms of dependency. Generally, a connection in the feature model represents a dependency between two features. If two features are connected we call the feature that is located higher within the hierarchy parent feature and the other one child feature. A child feature can only be selected if the connected parent feature is selected, e.g. Multiplication can only be selected if Operations is selected. A feature can have multiple child features but only one parent feature.

Features can be related to their parent in different ways. In our example, the feature Addition is mandatory and must be selected in every configuration while the feature Multiplication is optional and can be left out. The features Mobile and PC are alternatives and cannot be selected together,Graphical and Console are related in an Or group, which means that at least one of them must be selected in a configuration. Further dependencies can be given using arbitrary propositional formulas.

The feature model also helps to organize the features in a structured manner (e.g. it is easy to understand that the features Addition and Multiplication are considered as operations). This is especially helpful in larger projects in which feature dependencies can be more complex than in our example.        

Pages

Fabian Benduhn and Thomas Thüm

What do you think?

JAX Magazine - 2014 - 03 Exclucively for iPad users JAX Magazine on Android

Comments

Latest opinions