Skip to content

se-buw/fm4se-featuremodels

Repository files navigation

💯Points: Points bar

📝 Report


Feature Model analysis using limboole

This is a basic template to get started implementing feature model analysis via a translation from a simple FM language to propositional logic formulas in the syntax of Limboole.

As part of the assignment you will need to implement the TODOs in FeatureModelTranslator and FeatureModelAnalyzer.

Project Setup

📼 see the project setup video

  1. Install OpenJDK/JDK
  2. Clone your repository (either created from this template or the classroom)
  3. Open in any IDE of your choice (e.g. Eclipse, VS Code, etc.)
  4. Run src\main\java\de\buw\fm4se\featuremodels\PrinterExample.java. You should see the output as -
feature car is optional and has 2 children
    feature motor is mandatory and has 2 children in a XOR-group
        feature gasoline is optional and has 0 children
        feature electric is optional and has 0 children
    feature comfort is optional and has 2 children in a OR-group
        feature heating is optional and has 0 children
        feature entertainment is optional and has 0 children
electric REQUIRES heating

Note: Limboole executor is currently avaiable for Windows, Linux and Mac and x86 architecture only. If you are using a different architecture (e.g., arm64, M1) or OS (e.g., BSD), you may need to build the limboole executor from source available at limboole

Task 1: Feature Model Translation

📼 see the code walk-through and explanation of this task

For this task, you need to implement the translateToFormula(FeatureModel fm) method in FeatureModelTranslator which will return the combined formula in limboole format for a given Feature Model. The translation rules are (as in Lecture Slide 3):

Feature Model Relation Corresponding Formula
r is the root feature r
p is parent of feature c c -> p
m is a mandatory subfeature of p p -> m
p is the parent of [1..n] grouped features feature g1,...,gn p -> (g1 | ... |gn)
p is the parent of [1..1] grouped features feature g1,...,gn p -> 1-of-n (g1,...,gn)

After a correct translation all JUnit tests relating to consistency checks should pass.

Task 2: Analyze mandatory and dead features

📼 see the code walk-through and explanation of this task

  • Implement the deadFeatureNames(FeatureModel fm) method in FeatureModelAnalyzer Class which will compute a (potentially empty) list of all dead features.

  • Implement the mandatoryFeatureNames(FeatureModel fm) method in FeatureModelAnalyzer Class which will compute a (potentially empty) list of all mandatory features.

For this, reuse the formula you get from Task 1.

Some very basic test cases exist. Run the test cases.

Task 3: Product preservation

In this task you implement an analysis relating two feature models. Your code should check whether all products of one feature model are also products of a second feature model.

  • if a feature of the first feature model does not appear in the second, then a product with that feature cannot be a product of the second feature model.
  • if additional features appear in the second feature model, then a product with those features cannot be a product of the first feature model.

Implement the checkAllProductsPreserved(FeatureModel fm1, FeatureModel fm2) method in FeatureModelAnalyzer Class which will return true if and only if all products of fm1 are also products of fm2 (we don't care if fm2 has additional products).

For this, task reuse the formula you get from Task 1.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published