Top Banner
root F0 F1 F2 F3 A1 A2 Yes Yes Yes No Yes 3 0 Yes Yes No Yes Yes 2 2 Yes Yes Yes No No 2 0 Yes Yes No Yes No 0 8 Synthesis root F1 F3 F2 F0 A1 A2 A2 < 8 => A1 >= 2 A1 > 0 => A2 <= 2 Guillaume Bécan, Razieh Behjati, Arnaud Gotlieb, Mathieu Acher Synthesis of Attributed Feature Models From Product Descriptions
24

Synthesis of Attributed Feature Models From Product Descriptions

Aug 15, 2015

Download

Science

Acher
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Synthesis of Attributed Feature Models From Product Descriptions

root F0 F1 F2 F3 A1 A2

Yes Yes Yes No Yes 3 0

Yes Yes No Yes Yes 2 2

Yes Yes Yes No No 2 0

Yes Yes No Yes No 0 8

Synthesis

root

F1

F3

F2F0A1 A2

A2 < 8 => A1 >= 2A1 > 0 => A2 <= 2

Guillaume Bécan, Razieh Behjati, Arnaud Gotlieb, Mathieu Acher

Synthesis of Attributed Feature ModelsFrom Product Descriptions

Page 2: Synthesis of Attributed Feature Models From Product Descriptions

Notes

● Slides have been presented at SPLC'15 (Nashville, USA)

● Guillaume Bécan has made the vast majority of the slides

● Some slides were previously presented at FOSD'15 meeting

● Paper here: https://hal.inria.fr/hal-01178454

Page 3: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 3

Product Lines/Highly configurable systems

config NR_CPUSint "Maximum number of CPUs" if SMP && !MAXSMPrange 2 8 if SMP && X86_32 && !X86_BIGSMPrange 2 512 if SMP && !MAXSMP && !CPUMASK_OFFSTACKrange 2 8192 if SMP && !MAXSMP && CPUMASK_OFFSTACK && X86_64default "1" if !SMPdefault "8192" if MAXSMPdefault "32" if SMP && X86_BIGSMPdefault "8" if SMP---help--- This allows you to specify the maximum number of CPUs which this kernel will support. If CPUMASK_OFFSTACK is enabled, the maximum supported value is 4096, otherwise the maximum value is 512. The minimum value which makes sense is 2.

This is purely to save memory - each supported CPU adds approximately eight kilobytes to the kernel image.

Linux kernel

Page 4: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 4

● 2000+ options in about:config

● 3 types: boolean, integers, stringFirefox

Product Lines/Highly configurable systems

Page 5: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 5

Product Lines

Product comparison matrices

Comparison of digital SLRs

Page 6: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 6

Modeling and Synthesis

● Boolean feature models (FMs) are nice but options are not only boolean. Languages/operations have been defined on top of attributed FMs; so where are attributed feature models?

● Numerous works address the synthesis of Boolean feature models, eg [Czarnecki et al. SPLC'07, Andersen et al. SPLC'12, Davril et al. FSE'13, Becan et al. ESE'15] but none of them consider attributes

We introduce for the first time an algorithmic and parameterizable approach for synthesizing attributed FMs from product descriptions

Page 7: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 7

From Configuration Matrix to AFM

#2 synthesis procedure#3 scalability evaluation

#1 semantics

Page 8: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 8

Attributed Feature Model (AFM)● AFM = attributed feature diagram + an arbitrary constraint

● Attributed feature diagram =

– Hierarchy of features

– Attributes: placed in features, they take a value in a domain

– Domain = set of values, null value and a partial order

– A set of human readable constraints

Page 9: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 9

Formalizing the AFM Synthesis Problem

● Configuration matrix = intermediate representation of a set of configurations

● Given a configuration matrix, synthesize an AFM which is

– Maximal = the feature diagram contains as much as possible information

– Sound and Complete = represent exactly the set of configurations

Page 10: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 10

Formalizing the AFM Synthesis Problem

● Theoretical contributions (more details in the paper)

– Over-approximation of the attributed feature diagram

– Several AFMs are possible for one configuration matrix

root F0 F1 F2 F3 A1 A2

Yes Yes Yes No Yes 3 0

Yes Yes No Yes Yes 2 2

Yes Yes Yes No No 2 0

Yes Yes No Yes No 0 8

root

F1

F3

F2F0A1 A2

root

F1

F3F2F0A1

A2

excludes

Synthesis

Page 11: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 11

Synthesis algorithm● Input: Configuration Matrix + Domain Knowledge ( )

● Output: AFM which is maximal, sound and complete

= user input + default heuristics

Tool name : FOReverSE

Page 12: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 12

Synthesis algorithm● Extract feature, attributes and their domains

Features● Root● F0● F1● F2● F3

Attributes● A1 : {0,2,3}, 0● A2 : {0,2,8}, 0

root F0 F1 F2 F3 A1 A2

Yes Yes Yes No Yes 3 0

Yes Yes No Yes Yes 2 2

Yes Yes Yes No No 2 0

Yes Yes No Yes No 0 8

● Compute binary implications

root F0 F1 F2 F3 A1 A2

Yes Yes Yes No Yes 3 0

Yes Yes No Yes Yes 2 2

Yes Yes Yes No No 2 0

Yes Yes No Yes No 0 8

...F2 => ¬ F1¬ F2 => F1F2 => A1 ∈ {0,2}¬ F2 => A1 ∈ {2,3}F2 => A2 ∈ {2,8}¬ F2 => A2 ∈ {0}…A1 = 2 => A2 ∈ {0,2}

Page 13: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 13

Synthesis algorithm● Define hierarchy (feature tree + place of attributes)

Binary implications...F2 => ¬ F1¬ F2 => F1F2 => A1 ∈ {0,2}¬ F2 => A1 ∈ {2,3}F2 => A2 ∈ {2,8}¬ F2 => A2 ∈ {0}...

root

F1

F3

F2F0

Binary implication graph (all possible hierarchies)

root

F1

F3

F2F0

HierarchyPossible places for attributes¬ f => ( a = null value of a )

A1 : root, F0 A2 : root, F0, F2

A1 A2

Page 14: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 14

Synthesis algorithm● Compute variability information (mandatory features, features groups)

– Only based on features

– Reuse existing algorithms (She et al., Inform Software Tech, 2014)

Xor: {F1, F2}

rootF1

F3F2 F0

Mutex graph

Solver

Binary implications

Possible feature groups

(Mutex, Or, Xor)

root

F1

F3

F2F0A1 A2+

+

Binary implication graph Hierarchy+ Mandatoryfeatures

Page 15: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 15

Synthesis algorithm● Compute readable constraints

Readable constraintsA1 > 0 => A2 <= 2A2 < 8 => A1 >= 2

Interesting valuesfor attributesA1 → 0A2 → 8

Binary implications...A1 = 0 => A2 ∈ {8}A1 = 2 => A2 ∈ {0,2}A1 = 3 => A2 ∈ {0}

A2 = 0 => A1 ∈ {2,3}A2 = 2 => A1 ∈ {2}A2 = 8 => A1 ∈ {0}…

Mergeconstraints

Grammar of readable constraints

Page 16: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 16

User Effort

Domain knowledge =

● user input

● default heuristics

No user effortArbitrary choicesFully automated algorithm

More user effort => better AFM● Feature or attribute?● Interpretation of the cells (“Yes”

= true)● Hierarchy (F3 below F0)● Overlapping feature groups● Bounds in constraints (“0” is an

interesting value for A1)

Page 17: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 17

ScalabilityRandom dataset

● Generator of configuration matrices

– Number of variables (features + attributes)

– Number of configurations

– Maximum domain size (number of distinct values in a column)

● Execution time of or-group computation

● 1000 configurations● max domain size of 10

Timeout always reached with more than 60 variables

Or groups do not scale !

= default heuristics only

Page 18: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 18

ScalabilityRandom dataset

● Execution time (no or-groups)

● Up to 2,000 variables● 1,000 configurations● Max domain size of 10

● 100 variables● Up to 200,000 configurations● Max domain size of 10

● 10 variables● 10,000 configurations● Up to 6000 distinct values

= default heuristics only

On all experiments:Average: 2.6 minMax: 62 min

Page 19: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 19

ScalabilityBest Buy dataset

Execution time of 2.1s for the most challenging matrix:● 77 variables● 185 configurations● Maximum domain size of 185

Execution time is similar to the random dataset

● 242 matrices● < 25% of empty cells● Interpretation of empty cells = default heuristics only

Page 20: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 20

Conclusion

We introduce for the first time an algorithmic and parameterizable approach for synthesizing attributed FMs from product descriptions

Three key contributions:

● Semantics of attributed feature models/configuration matrix (over- approximation, equivalence)

● We designed and implemented a tool-supported synthesis algorithm

● We empirically evaluated the scalability of the synthesis algorithm on random and real-world matrices.

Page 21: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 21

Future Work

● Empirical experiments provide evidence that the number of constraints can be huge

– Random dataset: 237 constraints in average, 8906 max

– Best Buy dataset: 6821 constraints in average, 28300 max

● How to address the problem?

– Minimization, prioritization, user-specified

– Combination thereof

● Opencompare.org

– More empirical studies on realistic matrices (beyond Best Buy)

Page 22: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 22

Future Work

● Take a set of constraints as input (rather than a set of configurations)– arbitrary propositional formula

– require the use of SMT/CP solvers

● Develop other operations on attributed feature models: aggregate, merge, slice...– Instance of synthesis problem

Page 23: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 23

Questions?

root F0 F1 F2 F3 A1 A2

Yes Yes Yes No Yes 3 0

Yes Yes No Yes Yes 2 2

Yes Yes Yes No No 2 0

Yes Yes No Yes No 0 8

Synthesis

root

F1

F3

F2F0A1 A2

A2 < 8 => A1 >= 2A1 > 0 => A2 <= 2

Page 24: Synthesis of Attributed Feature Models From Product Descriptions

Synthesis of Attributed Feature Models: Foundations 24

Product Lines

{ "name": "Luke Skywalker", "height": "1.72 m", "mass": "77 Kg", "hair_color": "Blond", "skin_color": "Caucasian", "eye_color": "Blue", "birth_year": "19 BBY", "gender": "Male", "homeworld": "http://swapi.co/api/planets/1/", "films": [ "http://swapi.co/api/films/1/", "http://swapi.co/api/films/2/", "http://swapi.co/api/films/3/" ],

...}

The Star Wars API (http://swapi.co/){

"name": "Darth Vader","height": "202","mass": "136","hair_color": "none","skin_color": "white","eye_color": "yellow","birth_year": "41.9BBY","gender": "male","homeworld":

"http://swapi.co/api/planets/1/","films": [

"http://swapi.co/api/films/6/","http://swapi.co/api/films/3/","http://swapi.co/api/films/2/","http://swapi.co/api/films/1/"

],...

}