Reverse Engineering Feature Models. . . S. She, R. Lotufo, T. - - PowerPoint PPT Presentation

reverse engineering feature models
SMART_READER_LITE
LIVE PREVIEW

Reverse Engineering Feature Models. . . S. She, R. Lotufo, T. - - PowerPoint PPT Presentation

Reverse Engineering Feature Models. . . S. She, R. Lotufo, T. Berger, A. Wasowski, K. Czarnecki Generative Software Development Lab University of Waterloo . . International Conference on Software Engineering, Honolulu, Hawaii, USA.


slide-1
SLIDE 1

Reverse Engineering Feature Models.

. .

  • S. She, R. Lotufo, T. Berger, A. Wasowski, K. Czarnecki

Generative Software Development Lab University of Waterloo

. .

International Conference on Software Engineering, Honolulu, Hawaii, USA.

slide-2
SLIDE 2

Outline.

1

Introduction

2

Feature Models

3

Procedures

4

Evaluation

5

Conclusions

. . Steven She. . Reverse Engineering Feature Models. . 2 / 29

slide-3
SLIDE 3

Timeline.

. . SPLC ’07 . SPLC ’08 . VaMoS ’10 . SPLC ’10 . ASE ’10 . ICSE ’11 . Propositional logic and FMs. . Sample spaces and FMs. . Initial study on the Linux FM. . Evolution of Linux feature models. . Linux and eCos feature models. .

  • Rev. engineering Linux, eCos, and

parts of the FreeBSD FMs.

. . Steven She. . Reverse Engineering Feature Models. . 3 / 29

slide-4
SLIDE 4

Motivation.

  • Feature models are great for representing variability in

software product lines (SPLs), e.g. Linux and eCos.

  • Some SPLs don’t have feature models, e.g. FreeBSD.
  • Without a feature model, dependencies are hard to

understand for users and developers.

  • Solution: Reverse engineer a feature model from existing

project artifacts.

  • We present procedures to address this task.

. . Steven She. . Reverse Engineering Feature Models. . 4 / 29

slide-5
SLIDE 5

Outline.

1

Introduction

2

Feature Models

3

Procedures

4

Evaluation

5

Conclusions

. . Steven She. . Reverse Engineering Feature Models. . 5 / 29

slide-6
SLIDE 6

A Propositional Feature Model…

is a Tree + Cross-Tree Constraints.

powersave cpu_hotplug cpu_freq performance acpi pm acpi_system

powersave ∧ acpi → cpu_hotplug

. . Steven She. . Reverse Engineering Feature Models. . 6 / 29

slide-7
SLIDE 7

Configuration Semantics.

A feature model describes a set of legal configurations. Legal configurations can be represented by a formula.

[ [FM] ] ≡ φ

. . Steven She. . Reverse Engineering Feature Models. . 7 / 29

slide-8
SLIDE 8

Formula.

powersave cpu_hotplug cpu_freq performance acpi pm acpi_system

powersave ∧ acpi → cpu_hotplug φ = child-parent impl. ∧ mandatory impl. ∧ implies edges ∧ excludes edges ∧ feature groups ∧ cross-tree constraints

. . Steven She. . Reverse Engineering Feature Models. . 8 / 29

slide-9
SLIDE 9

Propositional Logic to Feature Models.

Given φ, there are many possible feature models that describe its legal configurations. FM = tree + cross-tree constraints.

. . Steven She. . Reverse Engineering Feature Models. . 9 / 29

slide-10
SLIDE 10

Ontological semantics.

Linux net staging dst Linux net staging dst

dst is an experimental feature.

  • Two FMs with the same configuration semantics, but

different ontological semantics.

  • We need a human to decide the placement of a feature.
  • But, names and descriptions can be used to provide

assistance.

. . Steven She. . Reverse Engineering Feature Models. . 10 / 29

slide-11
SLIDE 11

Ontological semantics.

Linux net staging dst Linux net staging dst

dst is an experimental feature.

  • Two FMs with the same configuration semantics, but

different ontological semantics.

  • We need a human to decide the placement of a feature.
  • But, names and descriptions can be used to provide

assistance.

. . Steven She. . Reverse Engineering Feature Models. . 10 / 29

slide-12
SLIDE 12

Outline.

1

Introduction

2

Feature Models

3

Procedures

4

Evaluation

5

Conclusions

. . Steven She. . Reverse Engineering Feature Models. . 11 / 29

slide-13
SLIDE 13

Overview.

Key challenge.

  • Building the feature hierarchy.
  • Task—Select a parent for each feature.

Reverse-Engineering Procedures.

  • Interactive—procedures provides assistance to the user for

building hierarchy.

  • Robust—we consider and evaluate on incomplete input.
  • Mandatory features, feature groups, implies and excludes

edges are automatically detected.

. . Steven She. . Reverse Engineering Feature Models. . 12 / 29

slide-14
SLIDE 14

Overview.

Key challenge.

  • Building the feature hierarchy.
  • Task—Select a parent for each feature.

Reverse-Engineering Procedures.

  • Interactive—procedures provides assistance to the user for

building hierarchy.

  • Robust—we consider and evaluate on incomplete input.
  • Mandatory features, feature groups, implies and excludes

edges are automatically detected.

. . Steven She. . Reverse Engineering Feature Models. . 12 / 29

slide-15
SLIDE 15

Required Input.

. .

F

Feature Names .

D

Descriptions .

φ

Dependencies

. . Steven She. . Reverse Engineering Feature Models. . 13 / 29

slide-16
SLIDE 16

Names and Descriptions.

pm Power management, CPU and ACPI options acpi Adv. Configuration and Power Interface support acpi_system Enable your system to shut down using ACPI cpu_freq CPU frequency scaling cpu_hotplug Allows turning CPU on and off powersave This CPU governor uses the lowest frequency performance This CPU governor uses the highest frequency

. . Steven She. . Reverse Engineering Feature Models. . 14 / 29

slide-17
SLIDE 17

Dependencies.

(acpi → acpi_system ∧ pm) ∧ (acpi_system → acpi) ∧ (cpu_freq → pm) ∧ (cpu_freq → powersave ∨ performance) ∧ (cpu_hotplug → powersave) ∧ (cpu_hotplug → ¬performance) ∧ (cpu_hotplug → acpi ∧ cpu_freq) ∧ (powersave → ¬performance) ∧ (powersave → cpu_freq) ∧ (performance → cpu_freq) ∧ (powersave ∧ acpi → cpu_hotplug)

. . Steven She. . Reverse Engineering Feature Models. . 15 / 29

slide-18
SLIDE 18

Parent Candidates.

Ranked Implied Features Ranked All-Features

Selected: cpu_hotplug

1 . 2. 3. 4. 5. powersave acpi acpi_system cpu_freq pm CPU frequency scaling. 1 . 2. 3. 4. 5. cpu_freq powersave performance acpi acpi_system ...

  • Ranked Implied Features (RIFs): set of features the selected

feature implies sorted by similarity.

  • Ranked All-Features (RAFs): all features sorted by their

similarity.

. . Steven She. . Reverse Engineering Feature Models. . 16 / 29

slide-19
SLIDE 19

Implication Graph.

pm cpu_freq powersave performance acpi acpi_system cpu_hotplug

  • An edge v → w: implication from v to w exists in φ.
  • Direct implications are the thick edges.
  • Calculated using a SAT solver.

. . Steven She. . Reverse Engineering Feature Models. . 17 / 29

slide-20
SLIDE 20

Similarity Heuristic.

  • Similarity function δ compares two features and measures

how many words they share.

  • Removes stop words, then calculates the sum of the inverse

document frequency (IDF) between the two features.

  • RIFs(f): Using the implication graph, prioritize direct

implications then all remaining implications, sorted by δ.

  • RAFs(f): All features, sorted by δ.

. . Steven She. . Reverse Engineering Feature Models. . 18 / 29

slide-21
SLIDE 21

Groups and Cross-Tree Constraints.

  • Construct a Mutex Graph to detect exclusions.
  • Detect mutex and xor-groups.
  • Implies and excludes edges are found using the hierarchy,

groups, and the remaining edges in the implication and mutex graphs.

. . Steven She. . Reverse Engineering Feature Models. . 19 / 29

slide-22
SLIDE 22

Outline.

1

Introduction

2

Feature Models

3

Procedures

4

Evaluation

5

Conclusions

. . Steven She. . Reverse Engineering Feature Models. . 20 / 29

slide-23
SLIDE 23

Linux and eCos Feature Models.

. .

  • Kconfig and CDL languages.
  • Reference models to evaluate our procedures.

. . Steven She. . Reverse Engineering Feature Models. . 21 / 29

slide-24
SLIDE 24

FreeBSD Reference Model.

. .

  • Dependencies and descriptions extracted from various artifacts in

FreeBSD kernel.

  • Manually created ontology of 192 features.
  • Reference FM of 90 features extracted from ontology.
  • Thorsten’s area of expertise.

. . Steven She. . Reverse Engineering Feature Models. . 22 / 29

slide-25
SLIDE 25

Characterization of Input Data.

Number of Words Number of Features

50 100 150 200 100 200 300 400 500 600 2 4 6 8 10 100 200 300 400 500 600 700 50 100 150

Number of Implications

10 20 30 40 50 200 400 600 800 20 40 60 80 500 1000 1500 2000 20 40 60 80 100

ecos freebsd freebsd−ref linux . Steven She. . Reverse Engineering Feature Models. . 23 / 29

slide-26
SLIDE 26

Measuring Effectiveness.

RIFs RAFs Is the reference parent in the Top 5 results? How many features do we have to examine to have a 75% chance of finding the reference parent?

  • Applied measures to complete and incomplete data sets.
  • Generated sets of incomplete data for Linux and eCos by

randomly removing implications and words.

. . Steven She. . Reverse Engineering Feature Models. . 24 / 29

slide-27
SLIDE 27

RIFs.

% of words in descriptions % in top 5

20 40 60 80 100 20 40 60 80 100

25% Impls

  • 25

50 75 100

50% Impls

  • 25

50 75 100

75% Impls

  • 25

50 75 100

100% Impls

  • 25

50 75 100

linux ecos

  • With all implications, 76% for Linux and 79% for eCos.
  • If we don’t consider features at root, then 90% for Linux

and 81% for eCos.

. . Steven She. . Reverse Engineering Feature Models. . 25 / 29

slide-28
SLIDE 28

RAFs.

% of words in descriptions % of features to examine

10 20 30 40 50 60 10 20 30 40 50 60

  • 25

50 75 100

linux ecos

  • With all descriptions, 3% for Linux, and 6% for eCos.

. . Steven She. . Reverse Engineering Feature Models. . 26 / 29

slide-29
SLIDE 29

Feature Groups.

% of exclude edges Number of groups

5 10 15 20 2 4 6 8 10

  • 20

40 60 80 100

linux ecos

  • xor-groups are detected as mutex-groups if the

dependencies are incomplete.

. . Steven She. . Reverse Engineering Feature Models. . 27 / 29

slide-30
SLIDE 30

Outline.

1

Introduction

2

Feature Models

3

Procedures

4

Evaluation

5

Conclusions

. . Steven She. . Reverse Engineering Feature Models. . 28 / 29

slide-31
SLIDE 31

Conclusions.

Future Work.

  • Develop a tool that incorporates these procedures.
  • A study on how people create feature models; usability.

Conclusions.

  • Key challenge: decide a parent for each feature.
  • Ranked implied features (RIFs) and ranked all-features

(RAFs) lists.

  • Automatically add mandatory features, implies and

excludes edges and feature groups.

  • Reverse-engineer FM from project that didn’t have one.

. . Steven She. . Reverse Engineering Feature Models. . 29 / 29