a study of variability spaces in open source software

18
A Study of Variability Spaces in Open Source Software Sarah Nadi University of Waterloo, Canada PhD Advisor: Richard C. Holt ICSE ’13 Doctoral Symposium – May 21 st 2013 San Francisco, USA

Upload: sarahnadi

Post on 23-Dec-2014

82 views

Category:

Technology


1 download

DESCRIPTION

ICSE '13 Doctoral Symposium

TRANSCRIPT

Page 1: A Study of Variability Spaces in Open Source Software

A Study of Variability Spaces in Open Source SoftwareSarah NadiUniversity of Waterloo, Canada

PhD Advisor: Richard C. Holt

ICSE ’13 Doctoral Symposium – May 21st 2013

San Francisco, USA

Page 2: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 2

Variability in Real Life

Sarah Nadi

• Integrated Garage Door Opener• Electronic Compass

Command navigation package

• Heated Front Seats• Exterior Power Folding Mirrors

Premium Package

Page 3: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 3

Example of Software Variability

The Linux kernel

I want usb support on

ARM architecture!

User 1

I want sound support on

x86 architecture!

User 2

Variant 2 Variant 1

Sarah Nadi

Page 4: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 4

What functionality will each choice

provide?Code Space

Supporting Variability

Sarah Nadi

What can I configure?

How will my choices select the right implementation

parts?

Configuration Space

Build Space

[Czarnecki & Eisenecker., 2000] [Svahnberg et al., 2005] [Tartler et al., 2011]

Feature1 -> Feature2

Block1 -> Feature2

File1 -> Feature1

(e.g., Kconfig files)

(e.g., C code files) (e.g., Makefiles)

Page 5: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 5

Build SpaceCode Space

Configuration Space

Previous Work

Sarah Nadi

Change evolution [Adams et al. 2008, McIntosh et al. 2011]

Feasibility of mapping extraction [Berger et al., 2010]

Change evolution (Lotufo et al. 2009 & 2011)

Use of feature modeling concepts [She et al., 2010][Berger et al., 2010]

Consistency with code space[Tartler et al. 2011]

Studying & extracting implemented variability [Liebig et al., 2010, Sincero et al, 2010]

Variability aware parsing [Kaestner et al.,2011]

Consistency with configuration space [Tartler et al. 2011]

Page 6: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 6

What is the origin of theseanomalies? How are theyfixed?

What variability constraints does each space provide?

So, What’s the Problem?

?

??

?

?

?Are the spaces consistent?

Sarah Nadi

?

What role does the Build

Space play?

Page 7: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 7

Examples of Systems Supporting Build-time Variability

Sarah Nadi

BusyBoxLinux kernel

> 12,000 features > 1,000 features > 800 features

Page 8: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 8

RQ1: Variability Constraints in 3 Spaces?

Sarah Nadi

Build SpaceCode Space

Configuration Space

= ?• Identify overlap in constraints• Identify constraints that are only in one side

Challenges

• Accurately extract code constraints• Meaningfully compare constraints

Benefits

• Uncover limits of static analysis• Accurate reverse engineering• Better maintenance

BusyBox

Page 9: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 9

RQ2: Role of Build System in Variability?

Sarah Nadi

Makefile Constraint Extractor

Build Space Constraints

≈ 50% of configuration space features are only used in the build space!

[Nadi & Holt, JSEP ‘13]

[Liebig et al., 2010]

Limitations

• Extractor specific to Kbuild• Relies on text parsing of Makefiles

Benefits• Show which parts of the system control most of variability

Page 10: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 10

RQ3: Is Variability Consistent?

Sarah Nadi

Code Space

Configuration Space

Build Space

[Tartler et al., 2011]

Syntactic Anomalies

• Don’t deal with constraints• Related to the setup of conditional compilation in Kbuild

Semantic Anomalies

• Conflicts between constraints• Requires a SAT solver• Dead (never selected) & undead (always selected) code blocks and files

Page 11: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 11

RQ3 Cont’d: Detecting Syntactic Anomalies

XXX

X

X

Variable Not Used anomaly

X

File Not Used anomaly

Feature Not Defined anomaly

Sarah Nadi

[Nadi & Holt, WCRE ‘11]

Page 12: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 12

RQ3 Cont’d: Detecting Semantic Variability Anomalies• '

Sarah Nadi

[Nadi&Holt, CSMR ‘12]

More anomalies detected when build space constraints are considered!

Page 13: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 13

#ifdef X //B1#else //B2#endif

foo.c(Code Space)

RQ3 Cont’d: Example of a Code Block Anomaly

Undead block!

Dead block!

foo.c => X

Build Space

foo.c will be compiled

only if X is selected“Testing X inside foo.c is a waste 

of text, since foo.c is built only when X is selected”

Sarah Nadi

Page 14: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 14

RQ4: Intro. & Fix of Variability Anomalies?

Sarah Nadi

1 Exploratory study with existing patches

2 Mine git repository acrossseveral releases to confirm patterns

Variability Anomalies

[Nadi et al., MSR ’13]

Incomplete configuration

patchesCode patches

Time

cause fix

14% 26%

Avoid future anomalies & provide automatic fix solutions!

Page 15: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 15

Limitations & Future Work• Build time variability

• External validity

• Focused on certain types of anomalies

Sarah Nadi

Future Work

• Study other systems

• Analyze other types of anomalies

Page 16: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 16

Overall Contributions & Benefits• Contributions

• Established the importance of build system variability• Quantified build system variability• Detected variability anomalies in the Linux kernel• Studied causes and fixes of variability anomalies

• Benefits• Guide future variability analysis by determining overlaps between

variability spaces• Decrease variability anomalies in software systems• Improve maintainability of variable software

Sarah Nadi

Page 17: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 17

Acknowledgements• University of Waterloo

• Ric Holt (Supervisor)• Krzysztof Czarnecki • Mike Godfrey

• Friedrich-Alexander-Universität Erlangen-Nürnberg• Christian Dietrich• Reinhard Tartler• Daniel Lohmann

• Leipzig University• Thorsten Berger

• Carnegie Mellon University• Christian Kästner

Sarah Nadi

Page 18: A Study of Variability Spaces in Open Source Software

Study of Variability Spaces - ICSE DS 2013 18Sarah Nadi

Time2011

WCRE ‘11

CSMR ‘12

2012 2013 2014

MSR ‘13

In progress

JSEP ‘13

BusyBox

Other anomalies

Questions?

[email protected]://swag.uwaterloo.ca/~snadi