Feature model

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In software development, a feature model is a compact representation of all the products of the Software Product Line (SPL) 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.[citation needed]

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 (FODA) method by Kang in 1990.[1] Since then, feature modeling has been widely adopted by the software product line community and a number of extensions have been proposed.

Background[edit]

A "feature" is defined as a "prominent or distinctive user-visible aspect, quality, or characteristic of a software system or system".[1] 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.[1]

Model[edit]

A feature model is a model that defines features and their dependencies, typically in the form of a feature diagram + left-over (a.k.a. cross-tree) constraints. But also it could be as a table of possible combinations.[citation needed]

Diagram[edit]

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[edit]

A feature configuration is a set of features which 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 modeling notations[edit]

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[edit]

Relationships between a parent feature and its child features (or subfeatures) are categorized as:

  • Mandatory – child feature is required.
  • Optional – child feature is optional.
  • Or – at least one of the sub-features must be selected.
  • Alternative (xor) – one of the sub-features must be selected

In addition to the parental relationships between features, cross-tree constraints are allowed. The most common are:

  • 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.

As an example, the figure below illustrates how feature models can be used to specify and build configurable on-line shopping systems. The software of each application is determined by the features that it provides. The root feature (i.e. E-Shop) identifies the SPL. Every shopping system implements a catalogue, payment modules, security policies and optionally a search tool. E-shops must implement a high or standard security policy (choose one), and can provide different payment modules: bank transfer, credit card or both of them. Additionally, a cross-tree constraint forces shopping systems including the credit card payment module to implement a high security policy.

A feature diagram representing a configurable e-shop system.


Cardinality-based feature models[edit]

Some authors propose extending basic feature models with UML-like multiplicities of the form [n,m] 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.[2]

If the upper bound is m the feature can be cloned as many times as we want (as long as the other constraints are respected). This notation is useful for products extensible with an arbitrary number of components.

Extended feature models[edit]

Others suggest adding extra-functional information to the features using "attributes". These are mainly composed of a name, a domain, and a value.[3]

Semantics[edit]

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 f_1 is a mandatory sub-feature of f_2, the formula will contain the constraint f_1 \Leftrightarrow f_2.[4]

The following table provides a translation of the basic primitives. The semantics of a diagram is a conjunct of the translations of the elements contained in the diagram. We assume that the diagram is a rooted tree.

Feature Diagram Primitive Semantics
r is the root feature r
f_1 optional sub-feature of f f_1 \Rightarrow f
f_1 mandatory sub-feature of f f_1 \Leftrightarrow f
f_1,\dots,f_n alternative sub-features of f \left(f_1 \lor \dots \lor f_n \Leftrightarrow f\right) \land
\bigwedge_{i<j}\lnot(f_i \land f_j)
f_1,\dots,f_n or sub-features of f f_1 \lor \dots \lor f_n \Leftrightarrow f
f_1 excludes f_2 \lnot (f_1  \land f_2)
f_1 requires f_2  f_1 \Rightarrow f_2

Configuring products[edit]

A product of the SPL is declaratively specified by selecting or deselecting features according to user's preferences. Such decisions must respect the constraints imposed by the feature model. A "configurator" is a tool that assists the user during a configuration process. For instance by automatically selecting or deselecting features that must or must not, respectively, be selected for the configuration to be completed successfully. Current approaches use unit propagation[5] and CSP solvers.[3]

Properties and analyses[edit]

An analysis of a feature model targets certain properties of the model which are important for marketing strategies or technical decisions. A number of analyses are identified in the literature.[6][7] Typical analyses determine whether a feature model is void (represents no products), whether it contains dead features (features that cannot be part of any product), or the number of products of the software product line represented by the model. Other analyses focus on comparing several feature models (e.g. to check whether a model is a specialization or refactoring or generalization of another).[8]

Tools[edit]

Some tools supporting the editing and/or analyses of feature models are:

See also[edit]

References[edit]

  1. ^ a b c Kang, K.C. and Cohen, S.G. and Hess, J.A. and Novak, W.E. and Peterson, A.S., "Feature-oriented domain analysis (FODA) feasibility study", Technical Report CMU/SEI-90-TR-021, SEI, Carnegie Mellon University, November 1990 download
  2. ^ Czarnecki, K. and Helsen, S. and Eisenecker, U., "Staged configuration using feature models", Proceedings of the Third International Conference on Software Product Lines (SPLC '04), volume 3154 of Lecture Notes in Computer Science. Springer Berlin/Heidelberg, August 2004. download.
  3. ^ a b D. Benavides, P. Trinidad and A. Ruiz-Cortés. "Automated Reasoning on Feature Models". 17th Conference on Advanced Information Systems Engineering (CAiSE'05). Porto, Portugal. 2005 download
  4. ^ Schobbens, P.-Y.; Heymans, P.; Trigaux, J.-C., "Feature Diagrams: A Survey and a Formal Semantics," Requirements Engineering, 14th IEEE International Conference , vol., no., pp.139-148, 11-15 Sept. 2006 download
  5. ^ Batory, D., "Feature Models, Grammars, and Propositional Formulas", Proceedings of the 9th International Software Product Line Conference (SPLC '05) download
  6. ^ D. Benavides, A.Ruiz-Cortés, P. Trinidad and S. Segura. "A Survey on the Automated Analyses of Feature Models" . Jornadas de Ingeniería del Software y Bases de Datos (JISBD'06). Sitges, Spain. 2006
  7. ^ David Benavides, Sergio Segura and Antonio Ruiz Cortés. Automated Analysis of Feature Models 20 Years Later: A Literature Review http://dx.doi.org/10.1016/j.is.2010.01.001 Information Systems . Elsevier. 2010. 35(6). September 2010.
  8. ^ T. Thuem, D. Batory, and C. Kaestner. "Reasoning about Edits to Feature Models". International Conference on Software Engineering (ICSE), May 2009.

External links[edit]