Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Using MS Solver Foundation to analyze Feature Models and Configurations

Juan Carlos Navarro, Jaime Chavarriaga.
Using MS Solver Foundation to analyze Feature Models and Configurations
EATIS 2016. 2016

Ähnliche Bücher

Kostenlos mit einer 30-tägigen Testversion von Scribd

Alle anzeigen

Ähnliche Hörbücher

Kostenlos mit einer 30-tägigen Testversion von Scribd

Alle anzeigen
  • Als Erste(r) kommentieren

Using MS Solver Foundation to analyze Feature Models and Configurations

  1. 1. Juan Carlos Navarro Jaime Chavarriaga Using Microsoft Solver Foundation to analyze Feature Models and Configurations 1
  2. 2. Context • Feature Models are the de facto standard for documenting, checking and reasoning about the configurations of a software system • Well-known Applications: • Domain Analysis in Software Product Lines • Engineering of Product Configurators 2
  3. 3. Domain Analysis for Product Lines MS Office It is a Software Product Line Multiple products are built based on a predefined set of assets (components) 3
  4. 4. Domain Analysis for Product Lines MS Office 4
  5. 5. Domain Analysis for Product Lines Feature Model Represents the variability of the products 5
  6. 6. • C1 = { Word, Excel, Powerpoint, OneNote} • C2 = { Word, Excel, Powerpoint, OneNote , Access} • C3 = { Word, Excel, Powerpoint, OneNote , Access, Publisher} • C4 = { Word, Excel, Powerpoint, OneNote, Outlook} • C5 = { Word, Excel, Powerpoint, OneNote , Access, Outlook} • C6 = { Word, Excel, Powerpoint, OneNote , Access, Publisher, Outlook} Domain Analysis for Product Lines Feature Configuration Represents a selection of features 6
  7. 7. Domain Analysis for Product Lines Variability Analysis There are features common to all the products and features that are optional 7 Commonalities Variabilities • C1 = { Word, Excel, Powerpoint, OneNote} • C2 = { Word, Excel, Powerpoint, OneNote , Access} • C3 = { Word, Excel, Powerpoint, OneNote , Access, Publisher} • C4 = { Word, Excel, Powerpoint, OneNote, Outlook} • C5 = { Word, Excel, Powerpoint, OneNote , Access, Outlook} • C6 = { Word, Excel, Powerpoint, OneNote , Access, Publisher, Outlook}
  8. 8. Problem (I) 8 Given a Feature Model for a Family of Products… • Is this model valid? • Are there constraints that cannot be satisfied at the same time? • All the features can be selected by a user ? • Which features cannot be selected?
  9. 9. Related Work There are some proposals to analyze feature models Approach Representative works Propositional Logic Convert FM to propositional logic expressions Batory[2005], Czarnecki[2005], Gheyi[2006], Mendonca[2010] CSP Convert FMs to Constraint Satisfaction Problems Benavides[2005], Karatas[2010], Alvarez[2011], Mazo[2011] Description Logics Convert FMs to Ontologies Zaho[2004], Fan [2006], Wang [2007] Others Use other processing techniques Mannion[2002], Janota[2007], Gheyi[2008], Van der Broek [2010] 9
  10. 10. Related Work Existing tools and libraries Scope Technology SPLOT Supports feature model and configuration validation. Also it supports configuration processes. Java FAMA Supports feature model and configuration validation. Partial supports configuration processes Java FAMILIAR Provides a DSL to process feature models. Support validation and configuration processes. Java 10
  11. 11. Problem (II) • Existing works cannot be used in .Net Platforms • Existing works do not use CSP + Optimization Solvers such as the MS Solver Foundation. 11
  12. 12. How can we analyse Feature Models and Configurations using Microsoft Solver Foundation? 12
  13. 13. Our Approach ❶ Understand semantics for Feature Models and Configurations ❷ Take the Models and Configurations and Convert them to CSP/Optimization Problems ❸ Take these CSP/Optimization problems and Solve it using MS solver Foundation ❹ Provide an implementation and evaluation 13
  14. 14. ❶ Feature Models and Configurations Semantics 14
  15. 15. Feature Model Semantics 15 Root X Y X Y Root (Concept). It must be selected Mandatory. If X is selected, Y must be selected Optional. If X is selected, Y can be (or not) selected X Y1 Yi… Y1 Yi… X X Y X Y Or-Group. If X is selected, one or more of Y1, .., Yi must be selected. Alternative-Group. If X is selected, only one of Y1, .., Yi must be selected. Requires If X is selected, Y must be selected. Excludes If X is selected, Y must be not selected.
  16. 16. e.g., a FM for Cell Phones 16 Cellular Phone Normal Touch Screen External Memory KeyPad Small Size Large Size LCD Input Device Battery excludes requires Stylus
  17. 17. Feature Configuration 17 C1 = { CellularPhone, LCD, TouchScreen, InputDevice, Stylus, Battery, LargeSize} valid Cellular Phone Normal Touch Screen External Memory KeyPad Small Size Large Size LCD Input Device Battery excludes requires Stylus
  18. 18. Feature Configuration 18 C1 = { CellularPhone, LCD, TouchScreen, InputDevice, Stylus, Battery, SmallSize} invalid Cellular Phone Normal Touch Screen External Memory KeyPad Small Size Large Size LCD Input Device Battery excludes requires Stylus
  19. 19. ❷ Converting Feature Models and Configurations to CSP/Optimization Problems 19
  20. 20. Converting a Feature Model 20 Root X Y X Y Root (Concept). 𝑟 = 1 Mandatory. 𝑥 = 𝑦 Optional. 𝑥 ≥ 𝑦 X Y1 Yi… Y1 Yi… X X Y X Y Or-Group. 𝑥 = 1 → 𝑦𝑖 ≥ 1 Alternative-Group. 𝑥 = 1 → 𝑦𝑖 = 1 Requires 𝑥 ≤ 𝑦 Excludes 𝑥 + 𝑦 ≤ 1
  21. 21. e.g., a FM for Cell Phones • 𝐶𝑒𝑙𝑙𝑃ℎ𝑜𝑛𝑒 = 1 • 𝐿𝐶𝐷 = 𝐶𝑒𝑙𝑙𝑃ℎ𝑜𝑛𝑒 • 𝐿𝐶𝐷 = 𝑇𝑜𝑢𝑐ℎ𝑆𝑐𝑟𝑒𝑒𝑛 + 𝑁𝑜𝑟𝑚𝑎𝑙 • 𝐼𝑛𝑝𝑢𝑡𝐷𝑒𝑣𝑖𝑐𝑒 = 𝐶𝑒𝑙𝑙𝑃ℎ𝑜𝑛𝑒 • 𝐿𝐶𝐷 = 1 → 𝐾𝑒𝑦𝑃𝑎𝑑 + 𝑆𝑡𝑦𝑙𝑢𝑠 ≥ 1 • 𝐶𝑒𝑙𝑙𝑃ℎ𝑜𝑛𝑒 ≥ 𝐸𝑥𝑡𝑀𝑒𝑚𝑜𝑟𝑦 • 𝐵𝑎𝑡𝑡𝑒𝑟𝑦 = 𝐶𝑒𝑙𝑙𝑃ℎ𝑜𝑛𝑒 • 𝐵𝑎𝑡𝑡𝑒𝑟𝑦 = 𝑆𝑚𝑎𝑙𝑙𝑆𝑖𝑧𝑒 + 𝐿𝑎𝑟𝑔𝑒𝑆𝑖𝑧𝑒 • 𝑁𝑜𝑟𝑚𝑎𝑙 + 𝑆𝑡𝑦𝑙𝑢𝑠 ≤ 1 • 𝑇𝑜𝑢𝑐ℎ𝑆𝑐𝑟𝑒𝑒𝑛 ≤ 𝐿𝑎𝑟𝑔𝑒𝑆𝑖𝑧𝑒 Cellular Phone Normal Touch Screen External Memory KeyPad Small Size Large Size LCD Input Device Battery excludes requires Stylus
  22. 22. ❸Solving CSP/Optimization Problems using MS Solver Foundation 22
  23. 23. Analysis Operations Benavides et al. have defined some operations: • Validating a Feature Model: there is at least one valid configuration • Validating a Product Configuration • Validating a Partial Configuration • Obtaining all the valid Product Configurations • Calculating the number of Product Configurations • Obtaining core features (mandatory) • Obtaining dead features (non-selectable) • Obtaining variant features
  24. 24. Operations: Validating a FM ConvertFM( fm ) : ConstraintSystem ConstraintSystem model; model = ConstraintSystem.CreateSolver(); : // introduces variables and constraints : return model;
  25. 25. Operations: Validating a FM IsValid( ConstraintSystem model ) ConstraintSolverSolution solution = model.Solve(); return solution.HasFoundSolution;
  26. 26. Operations: Obtaining all Products GetAllProducts( ConstraintSystem model ) List <Configuration> list; list = new List <Configuration>() ; ConstraintSolverSolution solution = model.Solve(); while ( solution.HasFoundSolution ) { list.Add(new Configuration( solution )); } return list ;
  27. 27. Operations: Core Features GetDeadFeatures( List<Feature> features, ConstraintSystem model ) List <Feature> list = new List <Feature>(); foreach ( Feature f in features ) { CspTerm constraint = model.Equal (0 , f); model.AddConstraints ( constraint ); ConstraintSolverSolution solution = model.Solve(); if (! solution.HasFoundSolution ) { list.Add(f); } model.RemoveConstraints( constraint ); } return list ;
  28. 28. Operations: Dead Features GetDeadFeatures( List<Feature> features, ConstraintSystem model ) List <Feature> list = new List <Feature>(); foreach ( Feature f in features ) { CspTerm constraint = model.Equal (1 , f); model.AddConstraints ( constraint ); ConstraintSolverSolution solution = model.Solve(); if (! solution.HasFoundSolution ) { list.Add(f); } model.RemoveConstraints( constraint ); } return list ;
  29. 29. Operations: Validating a Config IsValidConfiguration(Configuration config , List <Feature> features , ConstraintSystem model ) foreach ( Feature f in features ) { if ( config.Contains(f)) model.AddConstraints ( model.Equal (1 , f)); else model.AddConstraints ( model.Equal (0 , f)); } ConstraintSolverSolution solution = model.Solve() ; return solution.HasFoundSolution ;
  30. 30. Operations: Partial Config IsValidPartialConfiguration(Configuration config , List <Feature> features , ConstraintSystem model ) foreach ( Feature f in features ) { if ( config.Contains(f)) model.AddConstraints ( model.Equal (1 , f)); } ConstraintSolverSolution solution = model.Solve() ; return solution.HasFoundSolution ;
  31. 31. ❹ Implementation and Evaluation 31
  32. 32. Implementation & Evaluation Implementation https://github.com/FaMoSA/fma.net • A .Net based library • Can load SPLOT, FeatureIDE and FAMA feature models. • Can process feature models and configuration using MS Solver Foundation 32
  33. 33. Implementation & Evaluation Evaluation • Test with: Fama Test Suite http://www.isa.us.es/fama/?FaMa_Test_Suite • Test with models from SPLOT http://www.splot-research.org/ • Test with Feature IDE test suite http://wwwiti.cs.uni-magdeburg.de/iti_db/research/featureide/ Our implementation performs the analysis correctly. 33
  34. 34. Validate Model Performance 34 It may take 10 – 26 milliseconds. Other solvers take between 10 – 30 ms
  35. 35. All Products Performance 35 Depends on the # of products. It invokes the solver for each product.
  36. 36. Dead Features Performance 36 Depends on the # of features. It invokes the solver for each feature.
  37. 37. Conclusions • Our approach • Implements the operations defined by Benavides et al. • Works on .Net platforms • Obtains the same results that the other libraries. • Performs as fast as the related solutions in Java. 37
  38. 38. Conclusions • However, our implementation • Does not support optimizations proposed by other authors (e.g., by combining solvers or by eliminating non-relevant features from the processing) • Does not support transforming operations such as slice r merge of feature models • Does not support operations for product configuration such as recommending or optimizing selections. • Future work is planned to implement optimizations and additional operations using the MS Solver Foundation. 38
  39. 39. Questions? Juan Carlos Navarro juan-navarro@unipiloto.edu.co Jaime Chavarriaga ja.chavarriaga908@uniandes.edu.co 39

×