an introduction to automated analysis of feature models through propositional logic

24
An introduction to automated analysis of feature models through propositional logic SSC5793 - Especificação Formal de Software (Seminários) Sidgley Camargo de Andrade PhD student in computer science Institute of Computer Science and Mathematics University of São Paulo December 2015 1 / 24

Upload: federal-university-of-technology-paranabrazil-utfpr

Post on 24-Jan-2018

687 views

Category:

Education


2 download

TRANSCRIPT

Page 1: An introduction to automated analysis of feature models through propositional logic

An introduction to automated analysis of featuremodels through propositional logic

SSC5793 - Especificação Formal de Software(Seminários)

Sidgley Camargo de AndradePhD student in computer science

Institute of Computer Science and MathematicsUniversity of São Paulo

December 2015

1 / 24

Page 2: An introduction to automated analysis of feature models through propositional logic

Agenda

Product line, feature model, and automated analysis

Operations with automated support

Background and propositional logic

Identification of core features (how it works 1)

Finding a valid product or configuration (how works 2)

FaMa Tool

Challenges

Ongoing researches

References

2 / 24

Page 3: An introduction to automated analysis of feature models through propositional logic

Product line, feature model, and automatedanalysis

Feature-Oriented Domain Analysis was proposed by Kyo C. Kangand extended and applied by other researchers

Kang Schobbens Batory Benavides Beek Janota Czarnecki Maßen Zhang Mendonca

Figure: A sample feature model (Benavides et al., 2010)3 / 24

Page 4: An introduction to automated analysis of feature models through propositional logic

Extended feature model and cardinality

Figure: A sample extended feature model (Benavides et al., 2010)

Czarnecki proposed extending feature models with UML-likemultiplicities due to practical applications – cardinality [n,m].

4 / 24

Page 5: An introduction to automated analysis of feature models through propositional logic

Initial review

Benavides, D., Segura, S., Ruiz-Cortés, A. (2010). Automatedanalysis of feature models 20 years later: A literature review.Information Systems, 35(6), 615–636.

Batory, D. (2005). Feature Models, Grammars, and PropositionalFormulas. In Software Product Lines (pp. 7–20).

Perez-Morago, H., Heradio, R., Fernandez-Amoros, D., Bean, R.,Cerrada, C. (2015). Efficient Identification of Core and DeadFeatures in Variability Models. IEEE Access, 3, 2333–2340.

Mannion, M. (2002). Using First-Order Logic for Product LineModel Validation. In Software Product Lines (pp. 176–187).

5 / 24

Page 6: An introduction to automated analysis of feature models through propositional logic

Some operations with automated support

I void feature is related to wrong usage of cross-treeconstraints.

I valid product or partial configuration verifies whether agiven product or partial configuration is valid.

I all products returns all possible complete configurations andit is helpful to identify new valid requirement combinations.

I number of products provides information about the flexibilityand complexity of the product line.

I filter returns the set of products given a initial configuration.

I core features returns the set of features that are part of allthe products.

I anomalies detection and explanations, . . . , and other.

6 / 24

Page 7: An introduction to automated analysis of feature models through propositional logic

Background – logic vs automatized analyse

I Propositional logic and order logic1I SAT-solvers (e.g. SAT4J), Binary Decision Diagram

(BDD) solvers (e.g. JavaBDD), Alloy, Z

I Constraint programming2– Constraint Satisfaction ProblemI CSP/CSOP-solvers (e.g. JaCoP, Choco, OPL studio)

I Description logic3– semantic and ontologyI OWL-DL

I Heuristics4– ad hoc solutions

1(Mannion, 2002; Batory, 2005; Zhang et al., 2004; Janota and Kiniry, 2007; Mendonca et al.,2009; Benavides et al., 2007; Gheyi et al., 2006; Sun et al., 2005) and other

2 (Benavides et al., 2006, 2007; White et al., 2009) and other3 (Fan and Zhang, 2006; Zaid et al., 2009)4 (von der Massen and Lichter, 2005; Hemakumar, 2008; Fernandez-Amoros et al., 2009) and other

7 / 24

Page 8: An introduction to automated analysis of feature models through propositional logic

Mapping to propositional logic

Figure: Mapping from feature model to propositional logic (Benavideset al., 2010)

8 / 24

Page 9: An introduction to automated analysis of feature models through propositional logic

HOW IT WORKS – 1

Identification of core features through SAT-solvers

9 / 24

Page 10: An introduction to automated analysis of feature models through propositional logic

Step 1: label the features – (HW 1)

All features of feature model must be labelled. Usually, it is doneby means of modelling tools and automated tools.

10 / 24

Page 11: An introduction to automated analysis of feature models through propositional logic

Step 2: generate the directed graph – (HW 1)

Identify the dependencies and incompatibilities of feature model ina directed graph. In this step, only the mandatory, alternative,requires, and excludes relationship must be represented.

11 / 24

Page 12: An introduction to automated analysis of feature models through propositional logic

Step 3: Boolean formula encoding – (HW 1)

φ = (f1 ∨ f2 ∨ f4 ∨ f6 ∨ f7 ∨ f8)∧(¬f1 ∨ f2) ∧ (¬f1 ∨ f4) ∧ (¬f4 ∨ f6) ∧ (¬f4 ∨ f7) ∧ (¬f4 ∨ f8)∧(¬f6 ∨ ¬f7) ∧ (¬f6 ∨ ¬f8) ∧ (¬f7 ∨ ¬f8)

12 / 24

Page 13: An introduction to automated analysis of feature models through propositional logic

Step 4: identify core features – (HW 1)

It is an approach top-down (from f1 to f8). It is also appliedrecursively the logical expression for all features to identify the core.

A feature f ′ is core if φ 7→ f ′ is a tautologyor when ¬f ′ ∧ φ is unsat. (Perez-Morago et al., 2015)

13 / 24

Page 14: An introduction to automated analysis of feature models through propositional logic

HOW WORKS – 2

Finding a valid product or configuration through BDD

14 / 24

Page 15: An introduction to automated analysis of feature models through propositional logic

Selected features and configuration – (HW 2)

For this example was selected a subset of the previous featuremodel.

In general, a configuration is a 2-tuple (S ,R) | S ,R ⊆ F .

({f1, f4, f7}, {f3, f6}) ⊆ {f1, f3, f4, f6, f7}

15 / 24

Page 16: An introduction to automated analysis of feature models through propositional logic

Step 1: binary decision tree from theφ subset – (HW 2)

The binary decision tree corresponds the output of the truth table.Solid edge means that a feature appears in the configuration (value1); otherwise is a dashed edge (value 0). The leaves show whetherproduct or partial configuration is valid or not.

16 / 24

Page 17: An introduction to automated analysis of feature models through propositional logic

Step 2: binary decision diagrams – (HW 2)

BDD according to the variable ordering f1 ≺ f4 ≺ f6 ≺ f7 ≺ f3(subset φ). It is an optimized binary decision tree.

17 / 24

Page 18: An introduction to automated analysis of feature models through propositional logic

Step 3: identify a configuration valid – (HW 2)

P1 = {f1, f4, f6, f3} P2 = {f1, f4, f6, f7}

P1 is a valid configuration (1-leaf), but P2 is not (0-leaf).

18 / 24

Page 19: An introduction to automated analysis of feature models through propositional logic

FeAture Model Analyser (FaMa Tool)

Syntax

%RelationshipsMobile_Phone: Calls [GPS] Screen [Media];Screen: [1,1]Basic Colour High_Resolution;Media: [0,2]Camera Mp3;

%ConstraintsCamera REQUIRES High_Resolution;Basic EXCLUDES GPS;

Let’s have fun!

http://www.isa.us.es/fama/19 / 24

Page 20: An introduction to automated analysis of feature models through propositional logic

Challenges

I Formal definition of operations and minimize ambiguity

I Propose new operations of analysis leveraging extended featuremodels

I Improving performance and scalability of the operations

I Reasoning about variability at runtime

I Benchmarks

20 / 24

Page 21: An introduction to automated analysis of feature models through propositional logic

Ongoing researches (some topics)

I Composition and decomposition of feature models(Dhungana et al., 2011)

I Mapping among implementation artifacts and features(Thum et al., 2011)

I Improving the operations on features models (optimization)(Perez-Morago et al., 2015; Heradio-Gil et al., 2011)

21 / 24

Page 22: An introduction to automated analysis of feature models through propositional logic

Further information – repositories on automatedanalysis of feature models

I Publications – since 1990www.isa.us.es/featuremodelanalysis/repository

I Tools – specific and related)www.isa.us.es/toolshttp://www.splot-research.org/

22 / 24

Page 23: An introduction to automated analysis of feature models through propositional logic

References IBatory, D. (2005). Feature models, grammars, and propositional formulas. In Proceedings of the 9th

International Conference on Software Product Lines, SPLC’05, pages 7–20, Berlin, Heidelberg.Springer-Verlag.

Benavides, D., Segura, S., and Ruiz-Cortés, A. (2010). Automated analysis of feature models 20 yearslater: A literature review. Information Systems, 35(6):615 – 636.

Benavides, D., Segura, S., Trinidad, P., and Ruiz-Cortés, A. (2006). Using java csp solvers in theautomated analyses of feature models. In Lämmel, R., Saraiva, J., and Visser, J., editors, Generativeand Transformational Techniques in Software Engineering, volume 4143 of Lecture Notes inComputer Science, pages 399–408. Springer Berlin Heidelberg.

Benavides, D., Segura, S., Trinidad, P., and Ruiz-cortés, A. (2007). Fama: Tooling a framework for theautomated analysis of feature models. In In Proceeding of the First International Workshop onVariability Modelling of Softwareintensive Systems (VAMOS, pages 129–134.

Dhungana, D., Seichter, D., Botterweck, G., Rabiser, R., Grunbacher, P., Benavides, D., and Galindo, J.(2011). Configuration of multi product lines by bridging heterogeneous variability modelingapproaches. In Software Product Line Conference (SPLC), 2011 15th International, pages 120–129.

Fan, S. and Zhang, N. (2006). Feature model based on description logics. In Gabrys, B., Howlett, R.,and Jain, L., editors, Knowledge-Based Intelligent Information and Engineering Systems, volume4252 of Lecture Notes in Computer Science, pages 1144–1151. Springer Berlin Heidelberg.

Fernandez-Amoros, D., Gil, R. H., and Somolinos, J. C. (2009). Inferring information from featurediagrams to product line economic models. In Proceedings of the 13th International SoftwareProduct Line Conference, SPLC ’09, pages 41–50, Pittsburgh, PA, USA. Carnegie Mellon University.

Gheyi, R., Massoni, T., and Borba, P. (2006). A theory for feature models in alloy. In Proceedings ofthe ACM SIGSOFY First Alloy Workshop, page 71–80, Portland, United States.

Hemakumar, A. (2008). Finding contradictions in feature models. In First International Workshop onAnalyses of Software Product Lines (ASPL’08), pages 183–190.

Heradio-Gil, R., Fernandez-Amoros, D., Cerrada, J., and Cerrada, C. (2011). Supportingcommonality-based analysis of software product lines. Software, IET, 5(6):496–509.

23 / 24

Page 24: An introduction to automated analysis of feature models through propositional logic

References IIJanota, M. and Kiniry, J. (2007). Reasoning about feature models in higher-order logic. In Software

Product Line Conference, 2007. SPLC 2007. 11th International, pages 13–22.

Mannion, M. (2002). Using first-order logic for product line model validation. In Proceedings of theSecond International Conference on Software Product Lines, SPLC 2, pages 176–187, London, UK,UK. Springer-Verlag.

Mendonca, M., Wąsowski, A., and Czarnecki, K. (2009). Sat-based analysis of feature models is easy. InProceedings of the 13th International Software Product Line Conference, SPLC ’09, pages 231–240,Pittsburgh, PA, USA. Carnegie Mellon University.

Perez-Morago, H., Heradio, R., Fernandez-Amoros, D., Bean, R., and Cerrada, C. (2015). Efficientidentification of core and dead features in variability models. Access, IEEE, 3:2333–2340.

Sun, J., Zhang, H., and Wang, H. (2005). Formal semantics and verification for feature modeling. InProceedings of the 10th IEEE International Conference on Engineering of Complex ComputerSystems, ICECCS ’05, pages 303–312, Washington, DC, USA. IEEE Computer Society.

Thum, T., Kastner, C., Erdweg, S., and Siegmund, N. (2011). Abstract features in feature modeling. InSoftware Product Line Conference (SPLC), 2011 15th International, pages 191–200.

von der Massen, T. and Lichter, H. (2005). Determining the variation degree of feature models. InObbink, H. and Pohl, K., editors, Software Product Lines, volume 3714 of Lecture Notes inComputer Science, pages 82–88. Springer Berlin Heidelberg.

White, J., Dougherty, B., Schmidt, D. C., and Benavides, D. (2009). Automated reasoning formulti-step feature model configuration problems. In Proceedings of the 13th International SoftwareProduct Line Conference, SPLC ’09, pages 11–20, Pittsburgh, PA, USA. Carnegie Mellon University.

Zaid, L. A., Kleinermann, F., and De Troyer, O. (2009). Applying semantic web technology to featuremodeling. In Proceedings of the 2009 ACM Symposium on Applied Computing, SAC ’09, pages1252–1256, New York, NY, USA. ACM.

Zhang, W., Zhao, H., and Mei, H. (2004). A propositional logic-based method for verification of featuremodels. In Davies, J., Schulte, W., and Barnett, M., editors, Formal Methods and SoftwareEngineering, volume 3308 of Lecture Notes in Computer Science, pages 115–130. Springer BerlinHeidelberg.

24 / 24