ArticleslgStudy

computer science

Feature model

Feature model is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Feature model rather than just read about it. In short: 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 model — main illustration
Feature model — illustration

Key takeaways

  • Feature model belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Feature model to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Feature model from memory before moving on to harder problems.

Reference excerpt

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. 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. 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 (a.k.a. cross-tree) 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 (sometimes also known as a Feature Model or Feature Diagram) 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 (or sub-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 (xor) – exactly 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 to the right 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.

Cardinality-based feature models 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. If the upper bound is * 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 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 f1 is a mandatory sub-feature of f2, the formula will contain the constraint f1⇔f2. The following table provides a translation of the basic primitives. We assume that the diagram is a rooted tree with root r. 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 (CNF), then the terms can easily be combined with logical AND and the whole logical expression will remain in CNF.

Configuring products 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 and CSP solvers.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Feature model

Start with the simplest possible case. Write down what Feature model claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Feature model before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Feature model ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Feature model

In research
Feature model appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Feature model in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Feature model is common in secondary-school and first-year university syllabi. It links to neighbouring topics Software requirements, so understanding it makes those chapters shorter.
In everyday life
Look for Feature model outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Feature model” →

How to study Feature model in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Feature model means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Feature model out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Feature model in simple terms?

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.

Why does Feature model matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Feature model?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Feature model.

Tags

  • Software requirements

Keep exploring