850 likes | 1.03k Views
Managing Feature Models. Mathieu Acher. Learning Feature Models with (a.k.a implementing the introductory example). ( FeAture Model scrIpt Language for manIpulation and Automatic Reasoning ) . http:// familiar-project.github.com /. φ. TVL DIMACS.
E N D
Managing Feature Models Mathieu Acher
Learning Feature Models with (a.k.a implementing the introductory example)
(FeAture Model scrIptLanguage for manIpulation and AutomaticReasoning) http://familiar-project.github.com/ φ TVL DIMACS Mathieu Acher, Philippe Collet, Philippe Lahire, Robert B. France « A Domain-SpecificLanguage for Large-Scale Management of FeatureModels » Science of Computer Programming (SCP), 2013
{CarEquipment, Comfort, DrivingAndSafety, Healthing} {AirConditioning, FrontFogLights} {AutomaticHeadLights, AirConditioning, FrontFogLights} {AutomaticHeadLights, FrontFogLights, AirConditioningFrontAndRear} {AirConditioningFrontAndRear} {AirConditioning} {AirConditioningFrontAndRear, FrontFogLights} X
Much more than that! Let us have a deeper look
(FeAture Model scrIptLanguage for manIpulation and AutomaticReasoning) http://familiar-project.github.com/ φ TVL DIMACS importing, exporting, composing, decomposing, editing, configuring, reverse engineering, computing"diffs", refactoring, testing, and reasoning about (multiple) variabilitymodels Mathieu Acher, Philippe Collet, Philippe Lahire, Robert B. France « A Domain-SpecificLanguage for Large-Scale Management of FeatureModels » Science of Computer Programming (SCP), 2013
Multi-* variability *systems, perspectives, or stakeholders 12
Two Key Requirements • #1 Automatedanalysis • Akasupporttobetterunderstandandplaywithyourfeaturemodel (TVL model) • #2 Managing multiple feature models • Composing / Decomposing / Diff and Reasoning about their relationships • Combining these operators
languageandenvironment Language facilities Environment Interoperability // foo.fml fm1 = FM (“foo1.tvl”) fm2 = FM (“foo2.m”) fm3 = merge intersection { fm1 fm2 } c3 = counting fm3 renameFeature fm3.TV as “OutputTV” fm5 = aggregate { fm3 FM (“foo4.xml”) } assert (isValidfm5) fm6 = slice fm5 including fm5.TV.* export fm6 True/False 8759 “OutputTV”, “TV”
features configuration select deselect asFM deads configs counting Interoperability cores Reasoning isValid falseOptionals compare cleanup insert merge diff intersection sunion aggregate map unmap extract slicing De/Composition fm1 = FM(“foo.tvl”) fm2 = FM (“foo.m”) serialize fm4 into SPLOT serialize fm1 into featureide fm3 = FM (“foo.xmi”) fm4 = FM (A : B ….) setOptional setMandatory renameFeature removeFeature accessors copy Editing setAlternatives setOr modular mechanisms restricted set of types Language Facilities fm1.* fm1.B iterator/conditional assertion
helloworld.fml Hello World
basics2.fml Typed language • Domain-specific types • Feature Model, • Configuration, • Feature, • Constraint • Other types include • Set • String • Boolean, • Enum, • Integer and Real. • A set of operations, called operators, are defined for a given type.
basics2.fml Typed language
basics2.fml Typed language
basics3.fml Importing/Exporting feature models Internal notation or by “filename extensions”
ftAccessors.fml Feature Accessors (1)
ftAccessors2.fml Other constructs
conf.fml Configuration
A ^ A B ^ C => A ^ D => A φ FM
operatorsFM.fml Operations for Feature Models (1) φ
operatorsFM2.fml Operations for Feature Models (2) φ
operatorsFM3.fml Operations for Feature Models (3)
SoC support = Composition/Decomposition for managing large, complex and multiple feature models FORM 1998, Tun et al. 2009 (SPLC), Hartmann 2008 (SPLC), Lee et al. 2010, Czarnecki 2005, Reiser et al. 2007 (RE journal), Hartmann et al. 2009 (SPLC), Thuem et al. 2009 (ICSE), Classen et al. 2009 (SPLC), Mendonca et al. 2010 (SCP), Dunghanaet al. 2010, Hubauxet al. 2011 (SoSyM), Zaid et al. 2010 (ER), She et al., 2011 (ICSE), etc.
aggregateBasics.fml Composing Feature Models (1)
aggregate1.fml Composing Feature Models (2) Previous version
mergeMI.fml Composing Feature Models (3) Mathieu Acher, Philippe Collet, Philippe Lahire, Robert B. France « ComparingApproaches for ImplementingFeature Model Composition » ECMFA’10
compare.fml Comparing Feature Models see also Thuem, Kastner and Batory, ICSE’09
Combining operators: an example
Merge Intersection: Available Suppliers Suppliers? Products? ∩ ∩ A customer has some requirements
suppliersExample0.fml In FAMILIAR
Merge Union: Availability Checking Yes! Can suppliers provide all products? ∩ “compare”
suppliersExample.fml In FAMILIAR
Merging operation: implementation issues How to synthesise a feature model that represents the union of input sets of configurations?
Merging operation: semantic issues (2) φ Union Intersection Diff How to synthesise a feature model that represents the union of input sets of configurations?
Merging operation: algorithm φ φ φ φ 1 2 3 123 How to synthesise a feature model that represents the union of input sets of configurations? + merged hierarchy merged propositional formula Set mandatory features Detect Xor and Or-groups Compute “implies/excludes” constraints see also [Czarnecki SPLC’07 or SPLC’12]
mergeNonPC.fml Merging operation: back to hierarchy ? > configsfm4 res12: (SET) {{C;A};{A;B};{A};{A;B;C}} Mathieu Acher, Benoit Combemale, Philippe Collet, Olivier Barais, Philippe Lahire, Robert B. France « Composingyour Compositions of VariabilityModels » MODELS’13
Related Works • Well-defined semantics • Guarantee semantics properties by construction • More compact feature models than reference-based techniques [Schobbens et al., 2007], [Hartmann et al., 2007] • Easier to understand • Easier to analyze (e.g., compare with another) • Applicable to any propositional feature models • Full support of propositional constraints • Different hierarchies [Van Den Broek et al., SPLC’2010/2012] • Syntactical strategies fail [Alves et al., 2006], [Segura et al., 2007] see also [Acher et al., ECMFA’10 / MODELS’13]
Another application of composing feature models (purpose: automated synthesis of feature models)
Problem: multiple „carmodels“ #1 – top-down: specify constraints (e.g., excludes) of all model lines upfront Two modeling approaches #2 – bottom-up: elaborate a feature model for each model line and merge them
#1 bottom-up FM_1 merge FM_r FM_2 FM_3
#1 bottom-up (FAMILIAR) audiMerge.fml FM_1 merge FM_r FM_2 FM_3