SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
Assessing Product Line Derivation
Operators Applied to Java Source Code:
An Empirical Study
João Bosco Ferreira Filho, Simon Allier, 

Olivier Barais, Mathieu Acher and Benoit Baudry


SPLC 2015, July 20 - 24, 2015, Nashville,TN, USA
2
Feature
0..1
1
0
1
1
1
Variation Points
Variability is omnipresent
in numerous kinds of artefacts
Given a kind of artefact (expressed in a language)
you want to make it vary
You want variants of a…
3
Word document
Java, HTML, CSS or
C++ program
Class diagram
State machine
model A B C
t1 t3
t2
A B C
t2
A C
You need a solution for (de)activating/adding/
removing, substituting some elements; and thus
deriving variants of a…
4
Ideally applicable to any kind of artefact expressed in a language
Word document
Java, HTML, CSS or
C++ program
Class diagram
State machine
model A B C
t1 t3
t2
A B C
t2
A C
Common Variability Language (CVL): automatically
deriving products (eg models)
5
0..1
0
1
1
0
1
1
t1 t3
t2
A B C
Object Existence1
Link Existence1
Link Existence2
Link Existence3
Derivation Engine
Derivation Operators
t1 t3A B C
t2
A C
Derived Products
Ideally applicable to any kind of artefact expressed in a language
(conformant to a metamodel)
6
0..1
0
1
1
0
1
1
t1 t3
t2
A B C
Object Existence1
Link Existence1
Link Existence2
Link Existence3
Derivation Engine
t1
t2
A C
Derivation Operators
t1 t3A B C
t2
A C
Derived Products
Previous work show
#1 Using CVL “as is” is not working. It is highly beneficial to specialize
derivation operators for a given language [Filho et al. SPLC’13]; mandatory in
industrial context [Filho et al. STTT’14]
#2 Hard for users to do not make mistake: verification techniques eg [Czarnecki
et al. GPCE’06, Batory et al. GPCE’07, Classen et al. ICSE’10]; or support for
preventing errors and guiding users when specifying variability in an IDE
7
0..1
0
1
1
0
1
1
Object Existence1
Link Existence1
Link Existence2
Link Existence3
Derivation Engine
Derivation Operators
Derived Products
Previous work show
#1 Using CVL “as is” is not working. It is highly beneficial to specialize
derivation operators for a given language [Filho et al. SPLC’13]; mandatory in
industrial context [Filho et al. STTT’14]
#2 Hard for users to do not make mistake: verification techniques eg [Czarnecki
et al. GPCE’06, Batory et al. GPCE’07, Classen et al. ICSE’10]; or support for
preventing errors and guiding users when specifying variability in an IDE
e.g., automatically FIND THESE PERCENTAGES!
Which derivation operations are more likely to work? derive uncompilable code?
Can we identify operations subject to specialization?
8
#1 Using CVL “as is” is not working. We need to specialize derivation operators
for a given language [Filho et al. SPLC’13] [Filho et al. STTT’14]
#2 Hard for users to do not make mistake: support for preventing errors and
guiding users when specifying variability in an IDE
Object Existence2
Object Existence3
Object Existence4
Object Existence5
VS1
VS6
VS4
VS5
VS2
0..2
VS3
Object Existence1 >80%
<10%
>40%
t1 t3
t2
A B C
For any
programming/
modeling
“language”
e.g., automatically FIND THESE PERCENTAGES!
Which derivation operations are more likely to work? derive uncompilable code?
Can we identify operations subject to specialization?
9
#1 Using CVL “as is” is not working. We need to specialize derivation operators
for a given language [Filho et al. SPLC’13] [Filho et al. STTT’14]
#2 Hard for users to do not make mistake: support for preventing errors and
guiding users when specifying variability in an IDE
Object Existence2
Object Existence3
Object Existence4
Object Existence5
VS1
VS6
VS4
VS5
VS2
0..2
VS3
Object Existence1
>80%
<10%
>40%
10
http://grepcode.com/file/repo1.maven.org/maven2/com.codahale.metrics/metrics-core/
3.0.0-BETA3/com/codahale/metrics/CsvReporter.java
Object Existence1
Object Existence2
Object Existence3
Kind of derivation operations by example
11
Object existence expresses whether
a determined object will make part or not of the derived variant; its
execution implies on deleting or adding any source code element (e.g.,
statements, assignments, blocks,
literals, etc.) from the original program.
Kind of derivation operations by example
12
Object Substitution expresses that a determined program
element will be replaced by another of its same type
Kind of derivation operations
13
Object existence expresses whether
a determined object will make part or not of the derived variant;
its execution implies on deleting or adding any source code
element (e.g., statements, assignments, blocks,
literals, etc.) from the original program.
Link Existence expresses whether there is a relationship or
not between two elements, in the case of Java programs, we
consider as a link any relationship between classes: association,
composition, inheritance, etc (e.g., to remove an
extends Class A from a class' header).
Object Substitution expresses that a determined program
element will be replaced by another of its same type, e.g., a
method substituted by another method.
Link End Substitution expresses that a relationship between
a class A and a class B will be replaced by another relationship of
the same type between class A and a third class C (e.g., A
extends C instead of A extends B).
e.g., automatically FIND THESE PERCENTAGES!
Which derivation operations are more likely to work? derive uncompilable code?
Can we identify operations subject to specialization?
14
#1 Using CVL “as is” is not working. We need to specialize derivation operators
for a given language [Filho et al. SPLC’13] [Filho et al. STTT’14]
#2 Hard for users to do not make mistake: support for preventing errors and
guiding users when specifying variability in an IDE
Object Existence2
Object Existence3
Object Existence4
Object Existence5
VS1
VS6
VS4
VS5
VS2
0..2
VS3
Object Existence1
>80%
<10%
>40%
Empirical
Study
15
Methodology
16
p
p'
Object Existence
Link Existence
Object Subst.
LinkEnd Subst.
CVLVPs
Derivation

Operation
Compilation
and Testing
CounterexampleVariantSosie
[Baudry ISSTA’14]
Random operator applied to a random

code element in the program
Study (the big picture)
17
p'
86 CVL operations
Derivation
 Compilation
and Testing
Object Existence Field
Object Existence Interface
Object Existence Foreach
Object Existence Break
…
Object Substitution SuperAccess
Object Substitution Annotation
…
Link Existence …
LinkEnd Subst …
8 Java projects
p'p'p'
370,000
programs
%Counterexamples
(does not compile)
%Variants
(only compiles)
%Sosies
(compiles and
pass the test
suites)
Subject Programs
18
All have JUnit tests (statement coverage greater than 70%)
Variables and measurements
19
Derivation

Object Existence Field
Object Existence Interface
Object Existence Foreach
Object Existence Break
…
Object Substitution SuperAccess
Object Substitution Annotation
…
Link Existence …
LinkEnd Subst …
%Counterexamples
(does not compile)
%Variants
(only compiles)
%Sosies
(compiles and pass
Instrumentation
20
Instrumentation (2)
21
370,000 programs
one month of computation
Compilation
and Testing
Results and
Findings
22
Results and Findings
• 86% of the possible pairs (CVL operator + Type of Java
Code Element) resulted in compilable programs at least
once
▪Many possibilities to vary a Java program
• We found 72 types of CVL-based derivation operations that could produce
compilable Java programs
– e.g., substituting one child or parent class by another,
– suppressing an if statement,
– introducing/suppressing a method invocation,
– etc.
23
Results and Findings
• There are operations that will always lead to
counterexamples or to variants
24
Success Rate
~100%
~0%
Results and Findings
• Operations with low success rate may not be directly
discarded, but specialized
▪Looking into those operations
• Qualitatively analysing them with the help of dedicated tooling
25
~0%
Visualization Tool
26
Project

View
Class

View
Operation

View
1 2
3
Results and Findings
• Specialization to avoid recurrent errors
▪Simple specializations
• e.g., removing a try in the case of removing a catch
▪Static-analysis-based specializations
• e.g., identifying strongly connected classes to be removed together
• Specialized and typed operators
▪Object Existence
• Class existence, field existence, parameter existence
27
Results and Findings
• Varying entire blocks of code instead of single instructions is
more likely to generate correct programs
▪ Do, For, ForEach, While, If, Throw
• 70% to 98% of variants when coupled with Object Existence
▪Fine-grained variability works better (ie easier to put variability
inside a method than to manipulate coarse elements like
« interface »)
▪Anomaly: Classes or Methods à 0.1%
– Invoked in other parts of the code
28
Results and Findings
• Object Existence is more likely to generate variants
▪ Object Existence à 21.97% of variants
▪ Link Existence à 11.81% of variants
▪ Object Substitution à 9.22% of variants
▪ Link Substitution à 4.51% of variants
• Overall CVL is not safe to be directly applied to Java
▪ Many different ways to vary a program
• But high probability to break it (90%)
▪ Generic language to vary any base model type but specialization is
clearly required
29
Conclusions
• Large-scale assessment of derivation operations
▪More than 370,000 derived products
• Many kinds of operations
▪86 ways of varying a Java program
• Some of them were never considered before by variability studies
• Quantitatively and qualitatively supported insights
▪Extensive panorama of success rates for each operation
▪Visualization tool for analyzing the transformations
• Open new perspectives for supporting variability in
languages, specially in Java
30
Future Work
• Using the results to
▪Devise specialized derivation operators for Java
▪Help current variability supporting IDEs to incorporate
new possibilities of variation, knowing the risks to do so
• Apply derivation operators in different areas, for
different objectives (e.g., resilience), such as software
diversification
31
32
Object Existence2
Object Existence3
Object Existence4
Object Existence5
VS1
VS6
VS4
VS5
VS2
0..2
VS3
Object Existence1
>80%
<10%
>40%
Long term vision: variability-aware IDE,
(anti-)patterns for any language
through automated exploration



Question?

Más contenido relacionado

La actualidad más candente

9781111530532 ppt ch06
9781111530532 ppt ch069781111530532 ppt ch06
9781111530532 ppt ch06
Terry Yoast
 
9781439035665 ppt ch06
9781439035665 ppt ch069781439035665 ppt ch06
9781439035665 ppt ch06
Terry Yoast
 
Binary code obfuscation through c++ template meta programming
Binary code obfuscation through c++ template meta programmingBinary code obfuscation through c++ template meta programming
Binary code obfuscation through c++ template meta programming
nong_dan
 
9781111530532 ppt ch13
9781111530532 ppt ch139781111530532 ppt ch13
9781111530532 ppt ch13
Terry Yoast
 
9781111530532 ppt ch12
9781111530532 ppt ch129781111530532 ppt ch12
9781111530532 ppt ch12
Terry Yoast
 
9781439035665 ppt ch02
9781439035665 ppt ch029781439035665 ppt ch02
9781439035665 ppt ch02
Terry Yoast
 
9781111530532 ppt ch07
9781111530532 ppt ch079781111530532 ppt ch07
9781111530532 ppt ch07
Terry Yoast
 
9781111530532 ppt ch02
9781111530532 ppt ch029781111530532 ppt ch02
9781111530532 ppt ch02
Terry Yoast
 
9781111530532 ppt ch03
9781111530532 ppt ch039781111530532 ppt ch03
9781111530532 ppt ch03
Terry Yoast
 
9781111530532 ppt ch11
9781111530532 ppt ch119781111530532 ppt ch11
9781111530532 ppt ch11
Terry Yoast
 
9781111530532 ppt ch08
9781111530532 ppt ch089781111530532 ppt ch08
9781111530532 ppt ch08
Terry Yoast
 
9781111530532 ppt ch04
9781111530532 ppt ch049781111530532 ppt ch04
9781111530532 ppt ch04
Terry Yoast
 
Chapter 2 - Basic Elements of Java
Chapter 2 - Basic Elements of JavaChapter 2 - Basic Elements of Java
Chapter 2 - Basic Elements of Java
Adan Hubahib
 

La actualidad más candente (17)

9781111530532 ppt ch06
9781111530532 ppt ch069781111530532 ppt ch06
9781111530532 ppt ch06
 
9781439035665 ppt ch06
9781439035665 ppt ch069781439035665 ppt ch06
9781439035665 ppt ch06
 
Metaprogramming
MetaprogrammingMetaprogramming
Metaprogramming
 
Binary code obfuscation through c++ template meta programming
Binary code obfuscation through c++ template meta programmingBinary code obfuscation through c++ template meta programming
Binary code obfuscation through c++ template meta programming
 
9781111530532 ppt ch13
9781111530532 ppt ch139781111530532 ppt ch13
9781111530532 ppt ch13
 
9781111530532 ppt ch12
9781111530532 ppt ch129781111530532 ppt ch12
9781111530532 ppt ch12
 
9781439035665 ppt ch02
9781439035665 ppt ch029781439035665 ppt ch02
9781439035665 ppt ch02
 
Systematic error management - we ported rudder to zio
Systematic error management - we ported rudder to zioSystematic error management - we ported rudder to zio
Systematic error management - we ported rudder to zio
 
9781111530532 ppt ch07
9781111530532 ppt ch079781111530532 ppt ch07
9781111530532 ppt ch07
 
9781111530532 ppt ch02
9781111530532 ppt ch029781111530532 ppt ch02
9781111530532 ppt ch02
 
9781111530532 ppt ch03
9781111530532 ppt ch039781111530532 ppt ch03
9781111530532 ppt ch03
 
9781111530532 ppt ch11
9781111530532 ppt ch119781111530532 ppt ch11
9781111530532 ppt ch11
 
9781111530532 ppt ch08
9781111530532 ppt ch089781111530532 ppt ch08
9781111530532 ppt ch08
 
C# in depth
C# in depthC# in depth
C# in depth
 
Managing Binary Compatibility in Scala (Scala Lift Off 2011)
Managing Binary Compatibility in Scala (Scala Lift Off 2011)Managing Binary Compatibility in Scala (Scala Lift Off 2011)
Managing Binary Compatibility in Scala (Scala Lift Off 2011)
 
9781111530532 ppt ch04
9781111530532 ppt ch049781111530532 ppt ch04
9781111530532 ppt ch04
 
Chapter 2 - Basic Elements of Java
Chapter 2 - Basic Elements of JavaChapter 2 - Basic Elements of Java
Chapter 2 - Basic Elements of Java
 

Similar a Assessing Product Line Derivation Operators Applied to Java Source Code: An Empirical Study

AEM Clean Code - Miklos Csere
AEM Clean Code - Miklos Csere AEM Clean Code - Miklos Csere
AEM Clean Code - Miklos Csere
Miklos Csere
 
Mining Fix Patterns for FindBugs Violations
Mining Fix Patterns for FindBugs ViolationsMining Fix Patterns for FindBugs Violations
Mining Fix Patterns for FindBugs Violations
Dongsun Kim
 

Similar a Assessing Product Line Derivation Operators Applied to Java Source Code: An Empirical Study (20)

C++ programing lanuage
C++ programing lanuageC++ programing lanuage
C++ programing lanuage
 
STATICMOCK : A Mock Object Framework for Compiled Languages
STATICMOCK : A Mock Object Framework for Compiled Languages STATICMOCK : A Mock Object Framework for Compiled Languages
STATICMOCK : A Mock Object Framework for Compiled Languages
 
Java Persistence API
Java Persistence APIJava Persistence API
Java Persistence API
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design Pattern
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design Patterns
 
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...Defaultification Refactoring: A Tool for Automatically Converting Java Method...
Defaultification Refactoring: A Tool for Automatically Converting Java Method...
 
Looking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelopLooking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelop
 
AEM Clean Code - Miklos Csere
AEM Clean Code - Miklos Csere AEM Clean Code - Miklos Csere
AEM Clean Code - Miklos Csere
 
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
Open Problems in Automatically Refactoring Legacy Java Software to use New Fe...
 
Something for Nothing
Something for NothingSomething for Nothing
Something for Nothing
 
A logic foundation for template-based program transformation in Eclipse
A logic foundation for template-based program transformation in EclipseA logic foundation for template-based program transformation in Eclipse
A logic foundation for template-based program transformation in Eclipse
 
Must.kill.mutants. TopConf Tallinn 2016
Must.kill.mutants. TopConf Tallinn 2016Must.kill.mutants. TopConf Tallinn 2016
Must.kill.mutants. TopConf Tallinn 2016
 
Mining Fix Patterns for FindBugs Violations
Mining Fix Patterns for FindBugs ViolationsMining Fix Patterns for FindBugs Violations
Mining Fix Patterns for FindBugs Violations
 
Design patterns in brief
Design patterns in briefDesign patterns in brief
Design patterns in brief
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patterns
 
Start with swift
Start with swiftStart with swift
Start with swift
 
[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android
 
Objective-C
Objective-CObjective-C
Objective-C
 
Beyond design patterns phpnw14
Beyond design patterns   phpnw14Beyond design patterns   phpnw14
Beyond design patterns phpnw14
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 

Más de University of Rennes, INSA Rennes, Inria/IRISA, CNRS

24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)
24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)
24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
On anti-cheating in chess, science, reproducibility, and variability
On anti-cheating in chess, science, reproducibility, and variabilityOn anti-cheating in chess, science, reproducibility, and variability
On anti-cheating in chess, science, reproducibility, and variability
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
Machine Learning and Deep Software Variability
Machine Learning and Deep Software VariabilityMachine Learning and Deep Software Variability
Machine Learning and Deep Software Variability
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
Transfer Learning Across Variants and Versions: The Case of Linux Kernel Size
Transfer Learning Across Variants and Versions: The Case of Linux Kernel SizeTransfer Learning Across Variants and Versions: The Case of Linux Kernel Size
Transfer Learning Across Variants and Versions: The Case of Linux Kernel Size
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
Software Variability and Artificial Intelligence
Software Variability and Artificial IntelligenceSoftware Variability and Artificial Intelligence
Software Variability and Artificial Intelligence
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
Teaching Software Product Lines: A Snapshot of Current Practices and Challenges
Teaching Software Product Lines: A Snapshot of Current Practices and ChallengesTeaching Software Product Lines: A Snapshot of Current Practices and Challenges
Teaching Software Product Lines: A Snapshot of Current Practices and Challenges
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
From Basic Variability Models to OpenCompare.org
From Basic Variability Models to OpenCompare.orgFrom Basic Variability Models to OpenCompare.org
From Basic Variability Models to OpenCompare.org
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 

Más de University of Rennes, INSA Rennes, Inria/IRISA, CNRS (20)

A Demonstration of End-User Code Customization Using Generative AI
A Demonstration of End-User Code Customization Using Generative AIA Demonstration of End-User Code Customization Using Generative AI
A Demonstration of End-User Code Customization Using Generative AI
 
24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)
24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)
24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)
 
On Programming Variability with Large Language Model-based Assistant
On Programming Variability with Large Language Model-based AssistantOn Programming Variability with Large Language Model-based Assistant
On Programming Variability with Large Language Model-based Assistant
 
Generative AI for Reengineering Variants into Software Product Lines: An Expe...
Generative AI for Reengineering Variants into Software Product Lines: An Expe...Generative AI for Reengineering Variants into Software Product Lines: An Expe...
Generative AI for Reengineering Variants into Software Product Lines: An Expe...
 
Tackling Deep Software Variability Together
Tackling Deep Software Variability TogetherTackling Deep Software Variability Together
Tackling Deep Software Variability Together
 
On anti-cheating in chess, science, reproducibility, and variability
On anti-cheating in chess, science, reproducibility, and variabilityOn anti-cheating in chess, science, reproducibility, and variability
On anti-cheating in chess, science, reproducibility, and variability
 
Feature Subset Selection for Learning Huge Configuration Spaces: The case of ...
Feature Subset Selection for Learning Huge Configuration Spaces: The case of ...Feature Subset Selection for Learning Huge Configuration Spaces: The case of ...
Feature Subset Selection for Learning Huge Configuration Spaces: The case of ...
 
Machine Learning and Deep Software Variability
Machine Learning and Deep Software VariabilityMachine Learning and Deep Software Variability
Machine Learning and Deep Software Variability
 
Mastering Software Variability for Innovation and Science
Mastering Software Variability for Innovation and ScienceMastering Software Variability for Innovation and Science
Mastering Software Variability for Innovation and Science
 
Transfer Learning Across Variants and Versions: The Case of Linux Kernel Size
Transfer Learning Across Variants and Versions: The Case of Linux Kernel SizeTransfer Learning Across Variants and Versions: The Case of Linux Kernel Size
Transfer Learning Across Variants and Versions: The Case of Linux Kernel Size
 
Reproducible Science and Deep Software Variability
Reproducible Science and Deep Software VariabilityReproducible Science and Deep Software Variability
Reproducible Science and Deep Software Variability
 
Software Variability and Artificial Intelligence
Software Variability and Artificial IntelligenceSoftware Variability and Artificial Intelligence
Software Variability and Artificial Intelligence
 
Teaching Software Product Lines: A Snapshot of Current Practices and Challenges
Teaching Software Product Lines: A Snapshot of Current Practices and ChallengesTeaching Software Product Lines: A Snapshot of Current Practices and Challenges
Teaching Software Product Lines: A Snapshot of Current Practices and Challenges
 
Exploiting the Enumeration of All Feature Model Configurations: A New Perspec...
Exploiting the Enumeration of All Feature Model Configurations: A New Perspec...Exploiting the Enumeration of All Feature Model Configurations: A New Perspec...
Exploiting the Enumeration of All Feature Model Configurations: A New Perspec...
 
Synthesis of Attributed Feature Models From Product Descriptions
Synthesis of Attributed Feature Models From Product DescriptionsSynthesis of Attributed Feature Models From Product Descriptions
Synthesis of Attributed Feature Models From Product Descriptions
 
From Basic Variability Models to OpenCompare.org
From Basic Variability Models to OpenCompare.orgFrom Basic Variability Models to OpenCompare.org
From Basic Variability Models to OpenCompare.org
 
Pandoc: a universal document converter
Pandoc: a universal document converterPandoc: a universal document converter
Pandoc: a universal document converter
 
Metamorphic Domain-Specific Languages
Metamorphic Domain-Specific LanguagesMetamorphic Domain-Specific Languages
Metamorphic Domain-Specific Languages
 
3D Printing, Customization, and Product Lines
3D Printing, Customization, and Product Lines3D Printing, Customization, and Product Lines
3D Printing, Customization, and Product Lines
 
WebFML: Synthesizing Feature Models Everywhere (@ SPLC 2014)
WebFML: Synthesizing Feature Models Everywhere (@ SPLC 2014)WebFML: Synthesizing Feature Models Everywhere (@ SPLC 2014)
WebFML: Synthesizing Feature Models Everywhere (@ SPLC 2014)
 

Último

Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
levieagacer
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
NazaninKarimi6
 
Human genetics..........................pptx
Human genetics..........................pptxHuman genetics..........................pptx
Human genetics..........................pptx
Silpa
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
Areesha Ahmad
 
biology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGYbiology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGY
1301aanya
 
Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.
Silpa
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
Areesha Ahmad
 

Último (20)

module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learning
 
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryFAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
 
Grade 7 - Lesson 1 - Microscope and Its Functions
Grade 7 - Lesson 1 - Microscope and Its FunctionsGrade 7 - Lesson 1 - Microscope and Its Functions
Grade 7 - Lesson 1 - Microscope and Its Functions
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
 
Human genetics..........................pptx
Human genetics..........................pptxHuman genetics..........................pptx
Human genetics..........................pptx
 
CURRENT SCENARIO OF POULTRY PRODUCTION IN INDIA
CURRENT SCENARIO OF POULTRY PRODUCTION IN INDIACURRENT SCENARIO OF POULTRY PRODUCTION IN INDIA
CURRENT SCENARIO OF POULTRY PRODUCTION IN INDIA
 
An introduction on sequence tagged site mapping
An introduction on sequence tagged site mappingAn introduction on sequence tagged site mapping
An introduction on sequence tagged site mapping
 
Chemistry 5th semester paper 1st Notes.pdf
Chemistry 5th semester paper 1st Notes.pdfChemistry 5th semester paper 1st Notes.pdf
Chemistry 5th semester paper 1st Notes.pdf
 
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
 
COMPUTING ANTI-DERIVATIVES (Integration by SUBSTITUTION)
COMPUTING ANTI-DERIVATIVES(Integration by SUBSTITUTION)COMPUTING ANTI-DERIVATIVES(Integration by SUBSTITUTION)
COMPUTING ANTI-DERIVATIVES (Integration by SUBSTITUTION)
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 
Stages in the normal growth curve
Stages in the normal growth curveStages in the normal growth curve
Stages in the normal growth curve
 
GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)
 
Introduction of DNA analysis in Forensic's .pptx
Introduction of DNA analysis in Forensic's .pptxIntroduction of DNA analysis in Forensic's .pptx
Introduction of DNA analysis in Forensic's .pptx
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
 
biology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGYbiology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGY
 
Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.
 
Site Acceptance Test .
Site Acceptance Test                    .Site Acceptance Test                    .
Site Acceptance Test .
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
 

Assessing Product Line Derivation Operators Applied to Java Source Code: An Empirical Study

  • 1. Assessing Product Line Derivation Operators Applied to Java Source Code: An Empirical Study João Bosco Ferreira Filho, Simon Allier, 
 Olivier Barais, Mathieu Acher and Benoit Baudry 
 SPLC 2015, July 20 - 24, 2015, Nashville,TN, USA
  • 2. 2 Feature 0..1 1 0 1 1 1 Variation Points Variability is omnipresent in numerous kinds of artefacts
  • 3. Given a kind of artefact (expressed in a language) you want to make it vary You want variants of a… 3 Word document Java, HTML, CSS or C++ program Class diagram State machine model A B C t1 t3 t2 A B C t2 A C
  • 4. You need a solution for (de)activating/adding/ removing, substituting some elements; and thus deriving variants of a… 4 Ideally applicable to any kind of artefact expressed in a language Word document Java, HTML, CSS or C++ program Class diagram State machine model A B C t1 t3 t2 A B C t2 A C
  • 5. Common Variability Language (CVL): automatically deriving products (eg models) 5 0..1 0 1 1 0 1 1 t1 t3 t2 A B C Object Existence1 Link Existence1 Link Existence2 Link Existence3 Derivation Engine Derivation Operators t1 t3A B C t2 A C Derived Products Ideally applicable to any kind of artefact expressed in a language (conformant to a metamodel)
  • 6. 6 0..1 0 1 1 0 1 1 t1 t3 t2 A B C Object Existence1 Link Existence1 Link Existence2 Link Existence3 Derivation Engine t1 t2 A C Derivation Operators t1 t3A B C t2 A C Derived Products Previous work show #1 Using CVL “as is” is not working. It is highly beneficial to specialize derivation operators for a given language [Filho et al. SPLC’13]; mandatory in industrial context [Filho et al. STTT’14] #2 Hard for users to do not make mistake: verification techniques eg [Czarnecki et al. GPCE’06, Batory et al. GPCE’07, Classen et al. ICSE’10]; or support for preventing errors and guiding users when specifying variability in an IDE
  • 7. 7 0..1 0 1 1 0 1 1 Object Existence1 Link Existence1 Link Existence2 Link Existence3 Derivation Engine Derivation Operators Derived Products Previous work show #1 Using CVL “as is” is not working. It is highly beneficial to specialize derivation operators for a given language [Filho et al. SPLC’13]; mandatory in industrial context [Filho et al. STTT’14] #2 Hard for users to do not make mistake: verification techniques eg [Czarnecki et al. GPCE’06, Batory et al. GPCE’07, Classen et al. ICSE’10]; or support for preventing errors and guiding users when specifying variability in an IDE
  • 8. e.g., automatically FIND THESE PERCENTAGES! Which derivation operations are more likely to work? derive uncompilable code? Can we identify operations subject to specialization? 8 #1 Using CVL “as is” is not working. We need to specialize derivation operators for a given language [Filho et al. SPLC’13] [Filho et al. STTT’14] #2 Hard for users to do not make mistake: support for preventing errors and guiding users when specifying variability in an IDE Object Existence2 Object Existence3 Object Existence4 Object Existence5 VS1 VS6 VS4 VS5 VS2 0..2 VS3 Object Existence1 >80% <10% >40% t1 t3 t2 A B C For any programming/ modeling “language”
  • 9. e.g., automatically FIND THESE PERCENTAGES! Which derivation operations are more likely to work? derive uncompilable code? Can we identify operations subject to specialization? 9 #1 Using CVL “as is” is not working. We need to specialize derivation operators for a given language [Filho et al. SPLC’13] [Filho et al. STTT’14] #2 Hard for users to do not make mistake: support for preventing errors and guiding users when specifying variability in an IDE Object Existence2 Object Existence3 Object Existence4 Object Existence5 VS1 VS6 VS4 VS5 VS2 0..2 VS3 Object Existence1 >80% <10% >40%
  • 11. Kind of derivation operations by example 11 Object existence expresses whether a determined object will make part or not of the derived variant; its execution implies on deleting or adding any source code element (e.g., statements, assignments, blocks, literals, etc.) from the original program.
  • 12. Kind of derivation operations by example 12 Object Substitution expresses that a determined program element will be replaced by another of its same type
  • 13. Kind of derivation operations 13 Object existence expresses whether a determined object will make part or not of the derived variant; its execution implies on deleting or adding any source code element (e.g., statements, assignments, blocks, literals, etc.) from the original program. Link Existence expresses whether there is a relationship or not between two elements, in the case of Java programs, we consider as a link any relationship between classes: association, composition, inheritance, etc (e.g., to remove an extends Class A from a class' header). Object Substitution expresses that a determined program element will be replaced by another of its same type, e.g., a method substituted by another method. Link End Substitution expresses that a relationship between a class A and a class B will be replaced by another relationship of the same type between class A and a third class C (e.g., A extends C instead of A extends B).
  • 14. e.g., automatically FIND THESE PERCENTAGES! Which derivation operations are more likely to work? derive uncompilable code? Can we identify operations subject to specialization? 14 #1 Using CVL “as is” is not working. We need to specialize derivation operators for a given language [Filho et al. SPLC’13] [Filho et al. STTT’14] #2 Hard for users to do not make mistake: support for preventing errors and guiding users when specifying variability in an IDE Object Existence2 Object Existence3 Object Existence4 Object Existence5 VS1 VS6 VS4 VS5 VS2 0..2 VS3 Object Existence1 >80% <10% >40%
  • 16. Methodology 16 p p' Object Existence Link Existence Object Subst. LinkEnd Subst. CVLVPs Derivation
 Operation Compilation and Testing CounterexampleVariantSosie [Baudry ISSTA’14] Random operator applied to a random
 code element in the program
  • 17. Study (the big picture) 17 p' 86 CVL operations Derivation
 Compilation and Testing Object Existence Field Object Existence Interface Object Existence Foreach Object Existence Break … Object Substitution SuperAccess Object Substitution Annotation … Link Existence … LinkEnd Subst … 8 Java projects p'p'p' 370,000 programs %Counterexamples (does not compile) %Variants (only compiles) %Sosies (compiles and pass the test suites)
  • 18. Subject Programs 18 All have JUnit tests (statement coverage greater than 70%)
  • 19. Variables and measurements 19 Derivation
 Object Existence Field Object Existence Interface Object Existence Foreach Object Existence Break … Object Substitution SuperAccess Object Substitution Annotation … Link Existence … LinkEnd Subst … %Counterexamples (does not compile) %Variants (only compiles) %Sosies (compiles and pass
  • 21. Instrumentation (2) 21 370,000 programs one month of computation Compilation and Testing
  • 23. Results and Findings • 86% of the possible pairs (CVL operator + Type of Java Code Element) resulted in compilable programs at least once ▪Many possibilities to vary a Java program • We found 72 types of CVL-based derivation operations that could produce compilable Java programs – e.g., substituting one child or parent class by another, – suppressing an if statement, – introducing/suppressing a method invocation, – etc. 23
  • 24. Results and Findings • There are operations that will always lead to counterexamples or to variants 24 Success Rate ~100% ~0%
  • 25. Results and Findings • Operations with low success rate may not be directly discarded, but specialized ▪Looking into those operations • Qualitatively analysing them with the help of dedicated tooling 25 ~0%
  • 27. Results and Findings • Specialization to avoid recurrent errors ▪Simple specializations • e.g., removing a try in the case of removing a catch ▪Static-analysis-based specializations • e.g., identifying strongly connected classes to be removed together • Specialized and typed operators ▪Object Existence • Class existence, field existence, parameter existence 27
  • 28. Results and Findings • Varying entire blocks of code instead of single instructions is more likely to generate correct programs ▪ Do, For, ForEach, While, If, Throw • 70% to 98% of variants when coupled with Object Existence ▪Fine-grained variability works better (ie easier to put variability inside a method than to manipulate coarse elements like « interface ») ▪Anomaly: Classes or Methods à 0.1% – Invoked in other parts of the code 28
  • 29. Results and Findings • Object Existence is more likely to generate variants ▪ Object Existence à 21.97% of variants ▪ Link Existence à 11.81% of variants ▪ Object Substitution à 9.22% of variants ▪ Link Substitution à 4.51% of variants • Overall CVL is not safe to be directly applied to Java ▪ Many different ways to vary a program • But high probability to break it (90%) ▪ Generic language to vary any base model type but specialization is clearly required 29
  • 30. Conclusions • Large-scale assessment of derivation operations ▪More than 370,000 derived products • Many kinds of operations ▪86 ways of varying a Java program • Some of them were never considered before by variability studies • Quantitatively and qualitatively supported insights ▪Extensive panorama of success rates for each operation ▪Visualization tool for analyzing the transformations • Open new perspectives for supporting variability in languages, specially in Java 30
  • 31. Future Work • Using the results to ▪Devise specialized derivation operators for Java ▪Help current variability supporting IDEs to incorporate new possibilities of variation, knowing the risks to do so • Apply derivation operators in different areas, for different objectives (e.g., resilience), such as software diversification 31
  • 32. 32 Object Existence2 Object Existence3 Object Existence4 Object Existence5 VS1 VS6 VS4 VS5 VS2 0..2 VS3 Object Existence1 >80% <10% >40% Long term vision: variability-aware IDE, (anti-)patterns for any language through automated exploration
 
 Question?