Feature model
In software development, a feature model is a compact representation of all the products of the Software Product Line in terms of "features". Feature models are visually represented by means of feature diagrams. Feature models are widely used during the whole product line development process and are commonly used as input to produce other assets such as documents, architecture definition, or pieces of code.
A SPL is a family of related programs. When the units of program construction are features—increments in program functionality or development—every program in an SPL is identified by a unique and legal combination of features, and vice versa.
Feature models were first introduced in the Feature-Oriented Domain Analysis method by Kang in 1990. Since then, feature modeling has been widely adopted by the software product line community and a number of extensions have been proposed.
Background
A "feature" is defined as a "prominent or distinctive user-visible aspect, quality, or characteristic of a software system or system". The focus of SPL development is on the systematic and efficient creation of similar programs. FODA is an analysis devoted to identification of features in a domain to be covered by a particular SPL.Model
A feature model is a model that defines features and their dependencies, typically in the form of a feature diagram + left-over constraints. But also it could be as a table of possible combinations.Diagram
A feature diagram is a visual notation of a feature model, which is basically an and-or tree. Other extensions exist: cardinalities, feature cloning, feature attributes, discussed below.Configuration
A feature configuration is a set of features that describes a member of an SPL: the member contains a feature if and only if the feature is in its configuration. A feature configuration is permitted by a feature model if and only if it does not violate constraints imposed by the model...Feature Tree
A Feature Tree is a hierarchical diagram that visually depicts the features of a solution in groups of increasing levels of detail.Feature Trees are great ways to summarize the features that will be included in a solution and how they are related in a simple visual manner.
Feature modeling notations
Current feature modeling notations may be divided into three main groups, namely:- Basic feature models
- Cardinality-based feature models
- Extended feature models
Basic feature models
Relationships between a parent feature and its child features are categorized as:- Mandatory – child feature must be selected.
- Optional – child feature can be selected or not selected.
- Or – at least one of the sub-features must be selected.
- Alternative – exactly one of the sub-features must be selected.
- A requires B – The selection of A in a product implies the selection of B.
- A excludes B – A and B cannot be part of the same product.
Cardinality-based feature models
Some authors propose extending basic feature models with UML-like multiplicities of the form with n being the lower bound and m the upper bound. These are used to limit the number of sub-features that can be part of a product whenever the parent is selected.If the upper bound is * the feature can be cloned as many times as we want. This notation is useful for products extensible with an arbitrary number of components.
Extended feature models
Others suggest adding extra-functional information to the features using "attributes". These are mainly composed of a name, a domain, and a value.Semantics
The semantics of a feature model is the set of feature configurations that the feature model permits. The most common approach is to use mathematical logic to capture the semantics of a feature diagram. Each feature corresponds to a boolean variable and the semantics is captured as a propositional formula. The satisfying valuations of this formula correspond to the feature configurations permitted by the feature diagram.For instance, if is a mandatory sub-feature of, the formula will contain the constraint.
The following table provides a translation of the basic primitives. We assume that the diagram is a rooted tree with root. The semantics of a whole diagram is a conjunct of the translations of the elements contained in the diagram. Therefore, in case all elements are written in Conjunctive normal form, then the terms can easily be combined with logical AND and the whole logical expression will remain in CNF.
| Feature Diagram Primitive | Semantics | Semantics in Conjunctive normal form |
| is the root feature | ||
| mandatory sub-feature of | ||
| optional sub-feature of | ||
| or sub-features of | ||
| alternative sub-features of | ||
| requires | ||
| excludes |