SPLC Presentation

74
Coevolution of Variability Models and Related Artifacts A Case Study from the Linux Kernel Leonardo Passos 1 Jianmei Guo 1 Leopoldo Teixeira 2 Krzysztof Czarnecki 1 Andrzej Wąsowski 3 Paulo Borba 2 1 University of Waterloo 2 Federal University of Pernambuco 3 IT University 17th International Software Product Line Conference 1/32

description

The extension of our FOSD paper

Transcript of SPLC Presentation

Page 1: SPLC Presentation

Coevolution of Variability Models and Related ArtifactsA Case Study from the Linux Kernel

Leonardo Passos1 Jianmei Guo1 Leopoldo Teixeira2

Krzysztof Czarnecki1 Andrzej Wąsowski3 Paulo Borba2

1University of Waterloo 2Federal University of Pernambuco 3IT University

17th International Software Product Line Conference

1/32

Page 2: SPLC Presentation

A concrete change from the Linuxkernel

2/32

Page 3: SPLC Presentation

Ralink Drivers

RT2860

...

... ...RT3090

2/32

Page 4: SPLC Presentation

Ralink Drivers

RT2860

...

... ...RT3090

2/32

Page 5: SPLC Presentation

Ralink Drivers

RT2860

...

... ...

Does it mean that RT3090 is no longer supported?

2/32

Page 6: SPLC Presentation

Ralink Drivers

RT2860

...

... ...

Does it mean that RT3090 is no longer supported?

2/32

Page 7: SPLC Presentation

Existing evolution studies tend to focuson the variability model alone

3/32

Page 8: SPLC Presentation

That doesn’t tell the whole story. . .

4/32

Page 9: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

5/32

Page 10: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

Variability model(Kconfig)

5/32

Page 11: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

Mapping(Makefiles)

5/32

Page 12: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

Implementation(.h and .c files)

5/32

Page 13: SPLC Presentation

Different artifacts, in different spaces,are connected. . .

5/32

Page 14: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

5/32

Page 15: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

5/32

Page 16: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

5/32

Page 17: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

Implementation file(.c or .h)

5/32

Page 18: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

macro directive(e.g.:, #ifdef RT2860)

5/32

Page 19: SPLC Presentation

With the three spaces in mind, the realpicture of . . .

6/32

Page 20: SPLC Presentation

Ralink Drivers

RT2860

...

... ...RT3090

is

6/32

Page 21: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

6/32

Page 22: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

copy

copy

copy

Therefore, RT3090 is merged into RT2860

6/32

Page 23: SPLC Presentation

Ralink Drivers

RT2860... ...RT3090

copy

copy

copy

Therefore, RT3090 is merged into RT28606/32

Page 24: SPLC Presentation

But, what can be said about the fewstudies that take coevolution into

account?

7/32

Page 25: SPLC Presentation

Studies that consider coevolution

• Borba et al., GPCE 2011

◦ Small case study: Mobile Media and TaRGeT ≈ 40 features

◦ Unlikely to capture the complexity typically found in large systems

◦ Case study restricted to refinement changes (guarantee productcompatibility)

• Seidl et al., SPLC 2012

◦ Validated over a small and fictitious example

8/32

Page 26: SPLC Presentation

Studies that consider coevolution

• Borba et al., GPCE 2011

◦ Small case study: Mobile Media and TaRGeT ≈ 40 features

◦ Unlikely to capture the complexity typically found in large systems

◦ Case study restricted to refinement changes (guarantee productcompatibility)

• Seidl et al., SPLC 2012

◦ Validated over a small and fictitious example

8/32

Page 27: SPLC Presentation

Studies that consider coevolution

• Borba et al., GPCE 2011

◦ Small case study: Mobile Media and TaRGeT ≈ 40 features

◦ Unlikely to capture the complexity typically found in large systems

◦ Case study restricted to refinement changes (guarantee productcompatibility)

• Seidl et al., SPLC 2012

◦ Validated over a small and fictitious example

8/32

Page 28: SPLC Presentation

Studies that consider coevolution

• Borba et al., GPCE 2011

◦ Small case study: Mobile Media and TaRGeT ≈ 40 features

◦ Unlikely to capture the complexity typically found in large systems

◦ Case study restricted to refinement changes (guarantee productcompatibility)

• Seidl et al., SPLC 2012

◦ Validated over a small and fictitious example

8/32

Page 29: SPLC Presentation

Studies that consider coevolution

• Borba et al., GPCE 2011

◦ Small case study: Mobile Media and TaRGeT ≈ 40 features

◦ Unlikely to capture the complexity typically found in large systems

◦ Case study restricted to refinement changes (guarantee productcompatibility)

• Seidl et al., SPLC 2012

◦ Validated over a small and fictitious example

8/32

Page 30: SPLC Presentation

Studies that consider coevolution

• Borba et al., GPCE 2011

◦ Small case study: Mobile Media and TaRGeT ≈ 40 features

◦ Unlikely to capture the complexity typically found in large systems

◦ Case study restricted to refinement changes (guarantee productcompatibility)

• Seidl et al., SPLC 2012

◦ Validated over a small and fictitious example

8/32

Page 31: SPLC Presentation

We need practical case studies ofvariability coevolution in large complex

variability rich software

9/32

Page 32: SPLC Presentation

Better understanding

tools mirroring coevolution as ithappens in practice

10/32

Page 33: SPLC Presentation

Our work

11/32

Page 34: SPLC Presentation

A catalog of 13 coevolution patternsfrom a large and complex system

(Linux kernel)

Provides a concrete set of coevolutionoperations performed in practice

12/32

Page 35: SPLC Presentation

A set of findings from the analyses ofthe catalog and its instances

Presented as take home lessons

13/32

Page 36: SPLC Presentation

Linux as a subject of study

• Mature: over 20 years of development

• Complex (in v3.3), with over

◦ 12, 000 features

◦ 80, 000 compile-time variation points

◦ 16, 000 Makefiles

◦ 30, 000 header and C files

14/32

Page 37: SPLC Presentation

Linux as a subject of study

• Mature: over 20 years of development

• Complex (in v3.3), with over

◦ 12, 000 features

◦ 80, 000 compile-time variation points

◦ 16, 000 Makefiles

◦ 30, 000 header and C files

14/32

Page 38: SPLC Presentation

Linux as a subject of study

• Mature: over 20 years of development

• Complex (in v3.3), with over

◦ 12, 000 features

◦ 80, 000 compile-time variation points

◦ 16, 000 Makefiles

◦ 30, 000 header and C files

14/32

Page 39: SPLC Presentation

Linux as a subject of study

• Mature: over 20 years of development

• Complex (in v3.3), with over

◦ 12, 000 features

◦ 80, 000 compile-time variation points

◦ 16, 000 Makefiles

◦ 30, 000 header and C files

14/32

Page 40: SPLC Presentation

Linux as a subject of study

• Mature: over 20 years of development

• Complex (in v3.3), with over

◦ 12, 000 features

◦ 80, 000 compile-time variation points

◦ 16, 000 Makefiles

◦ 30, 000 header and C files

14/32

Page 41: SPLC Presentation

Linux as a subject of study

• Mature: over 20 years of development

• Complex (in v3.3), with over

◦ 12, 000 features

◦ 80, 000 compile-time variation points

◦ 16, 000 Makefiles

◦ 30, 000 header and C files

14/32

Page 42: SPLC Presentation

Linux as a subject of study

• Changes are kept in a publicly available SCM Repository (git)

• Continuous development

• Variability spreads different artifacts (spaces):

◦ Variability model: Kconfig

◦ Mapping: Makefile

◦ Implementation: annotated C code (CPP directives: #ifdefs)

14/32

Page 43: SPLC Presentation

Linux as a subject of study

• Changes are kept in a publicly available SCM Repository (git)

• Continuous development

• Variability spreads different artifacts (spaces):

◦ Variability model: Kconfig

◦ Mapping: Makefile

◦ Implementation: annotated C code (CPP directives: #ifdefs)

14/32

Page 44: SPLC Presentation

Linux as a subject of study

• Changes are kept in a publicly available SCM Repository (git)

• Continuous development

• Variability spreads different artifacts (spaces):

◦ Variability model: Kconfig

◦ Mapping: Makefile

◦ Implementation: annotated C code (CPP directives: #ifdefs)

14/32

Page 45: SPLC Presentation

Linux as a subject of study

• Changes are kept in a publicly available SCM Repository (git)

• Continuous development

• Variability spreads different artifacts (spaces):

◦ Variability model: Kconfig

◦ Mapping: Makefile

◦ Implementation: annotated C code (CPP directives: #ifdefs)

14/32

Page 46: SPLC Presentation

Linux as a subject of study

• Changes are kept in a publicly available SCM Repository (git)

• Continuous development

• Variability spreads different artifacts (spaces):

◦ Variability model: Kconfig

◦ Mapping: Makefile

◦ Implementation: annotated C code (CPP directives: #ifdefs)

14/32

Page 47: SPLC Presentation

Linux as a subject of study

• Changes are kept in a publicly available SCM Repository (git)

• Continuous development

• Variability spreads different artifacts (spaces):

◦ Variability model: Kconfig

◦ Mapping: Makefile

◦ Implementation: annotated C code (CPP directives: #ifdefs)

14/32

Page 48: SPLC Presentation

Catalog of evolution patterns

15/32

Page 49: SPLC Presentation

Methodology for extracting patterns

2.6.2

6

2.6.2

7

3.1 3.2

. . .

added feature names

removed feature names

time

feature name fprimary commit

commit window (cw)

1. Sample Collection

Added feature names: 206 (5%)

Sample of removed feature names: 101 (10%)

2. Commit retrieval

(adds/removes f fromthe variability model)

complements the primary commit(changes of f are in other spaces)

3. Analysis & Clustering 4. Pattern extraction

almost 4 years of development

(Additions sample)

(Removals sample)

16/32

Page 50: SPLC Presentation

Catalog of evolution patterns

(additions sample)

17/32

Page 51: SPLC Presentation

Pattern catalog (additions sample)

Rename

(Sample size = 206, Population size = 4,112)

Additions sample

18/32

Page 52: SPLC Presentation

Pattern catalog (additions sample)

Creation offeature from

existing code

(Sample size = 206, Population size = 4,112)

Additions sample

18/32

Page 53: SPLC Presentation

Pattern catalog (additions sample)

Creation offeature from

newelements

(Sample size = 206, Population size = 4,112)

Additions sample

18/32

Page 54: SPLC Presentation

Pattern catalog (additions sample)

Not patterns

(Sample size = 206, Population size = 4,112)

Additions sample

18/32

Page 55: SPLC Presentation

Pattern catalog (additions sample)

Two most frequent patterns:

Add Visible Optional Modular Feature(AVOMF)

Add Visible Optional

Non-Modular Feature

(AVONMF)

18/32

Page 56: SPLC Presentation

Add Visible OptionalModular Feature

(Example)

19/32

Page 57: SPLC Presentation

Add Visible Optional Modular Feature

Example: CAPTURE_DAVINCI_DM646_EVM

CAPTURE_DAVINCI_DM646_EVM

VIDEO_DEV

... ...

...

CTC' = CTC + (CAPTURE_DAVINCI_DM646_EVM requires MACH_EVM)

M' = M + new compilation rule:

if CAPTURE_DAVINCI_DM646_EVM is set compile vpfi_capture.c

I'= I + vpfi_capture.c

CTC: set of cross tree constraints

M: Mapping

I: Implementation

(Before state) (After state)

[visible]

VIDEO_DEV

... ...

...

20/32

Page 58: SPLC Presentation

Add Visible OptionalNon-Modular Feature

(Example)

21/32

Page 59: SPLC Presentation

Add Visible Optional Non-Modular Feature

Example: SQUASHFS_4K_DEVBLK_SIZE

SQUASHFS_4K_DEVBLK_SIZE

SQUASHFS

... ...

...

CTC' = CTC + constraints of SQUASHFS_4K_DEVBLK_SIZE

I'= I + < #ifdef SQUASHFS_4K_DEVBLK_SIZE #define SQUASHFS_DEVBLK_SIZE 4096 #else #define SQUASHFS_DEVBLK_SIZE 1024 #endif >

CTC: set of cross tree constraints

M: Mapping

I: Implementation

(Before state) (After state)

[visible]

SQUASHFS

... ...

...

M: Mapping

22/32

Page 60: SPLC Presentation

Findings(additions sample)

23/32

Page 61: SPLC Presentation

Findings (additions sample)

• AVOMF:

◦ Most features in Linux are modular

◦ Modular features in AVOMF cause little scattering outside theirmodule

• AVONMF:

◦ ifdefs of non-modular features are coarse-grained, appearing mostly inthe global (e.g., a conditional data structure) or function level (e.g.,conditional statements)

24/32

Page 62: SPLC Presentation

Take home lesson #1(practical)

Disciplined use of annotation-based techniques such as#ifdefs do not hinder evolution (hypothesis)

25/32

Page 63: SPLC Presentation

Catalog of evolution patterns(removals sample)

26/32

Page 64: SPLC Presentation

Pattern catalog (removals sample)

(Sample size = 101, Population size = 1,002)

Removals sample

Remove VisibleOptional Modular

Feature (RVOMF)

27/32

Page 65: SPLC Presentation

Pattern catalog (removals sample)

(Sample size = 101, Population size = 1,002)

Removals sample

Remove VisibleOptional

Non-Modular Feature

(RVONMF)

27/32

Page 66: SPLC Presentation

Pattern catalog (removals sample)

(Sample size = 101, Population size = 1,002)

Removals sample

Inverse removals of

patterns in the additions sample

27/32

Page 67: SPLC Presentation

Pattern catalog (removals sample)

(Sample size = 101, Population size = 1,002)

Removals sample

Merges: feature name is removed from the variability model, but feature continues to be supported elsewhere

Merge Visible Optional Feature

into Sibling

(MVOFS)

Merge of RT3090

into RT2860

27/32

Page 68: SPLC Presentation

Pattern catalog (removals sample)

(Sample size = 101, Population size = 1,002)

Removals sample

Rename

27/32

Page 69: SPLC Presentation

Pattern catalog (removals sample)

(Sample size = 101, Population size = 1,002)

Removals sample

Not patterns

27/32

Page 70: SPLC Presentation

Findings (removals sample)

• Merges:

◦ Evolution requires a holistic view

◦ Merges can only be identified by retrieving coevolving artifacts

• Complete feature removal (e.g., RVOMF = AVOMF−1)

◦ Affect the set of supported products; thus not a refinement

◦ Refinement changes are too restrictive in practice, as complete featureremovals are often frequent (43% of all removals)

28/32

Page 71: SPLC Presentation

Take home lesson #2(methodological)

Effective understanding of variability evolution requireslooking at the coevolution of different artifacts

29/32

Page 72: SPLC Presentation

Take home lesson #3(requirements for tool implementors)

The set of patterns provide concrete operations on howartifacts coevolve

Catalog provides evidence on which operations areimportant (e.g., we did not find split operations)

30/32

Page 73: SPLC Presentation

Conclusion

• We sumarized a catalog of 13 patterns that include coevolution of:

◦ Variability model

◦ Mapping

◦ Implementation

• Subject of analysis: a large and complex software system – theLinux kernel

• Presented three take home lessons (full list of findings in the paper)

31/32

Page 74: SPLC Presentation

Thanks for listening!

32/32