a study of variability spaces in open source software
DESCRIPTION
ICSE '13 Doctoral SymposiumTRANSCRIPT
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
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
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
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)
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]
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?
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
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
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
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
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]
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!
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
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!
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
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
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
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