SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
Behavioral Model Seeding for
Search-based Crash Reproduction
Pouria Derakhshanfar, Xavier Devroey, 

Gilles Perrouin, Andy Zaidman and Arie van Deursen
!2
!3
java.lang.ClassCastException: […]
at org…..SolrEntityReferenceResolver.getWikiReference(....java:93)
at org…..SolrEntityReferenceResolver.getEntityReference(….java:70)
at org…..SolrEntityReferenceResolver.resolve(….java:63)
at org…..SolrDocumentReferenceResolver.resolve(….java:48)
at …
Crash!?!
Java Stack Trace (Issue XWIKI-13031)
!4
java.lang.ClassCastException: […]
at org…..SolrEntityReferenceResolver.getWikiReference(....java:93)
at org…..SolrEntityReferenceResolver.getEntityReference(….java:70)
at org…..SolrEntityReferenceResolver.resolve(….java:63)
at org…..SolrDocumentReferenceResolver.resolve(….java:48)
at …
Exception
Frames
{Target→
!5
Issue XWIKI-13031
!6
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
Random initial
test suite
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
a()
c() e()d()
e()
c() b() e()
a()
c() e()d()
e()
c() b() e()
Evolutionary
search
a() e()d()
Exception:
at x(…)
at y(…)
at e(…)
Exception:
at x(…)
at y(…)
at e(…)
Crash
reproducing
test case
Stack trace
Soltani, M., Panichella, A. and van Deursen, A. 2018. Search-Based Crash Reproduction and Its Impact on
Debugging. Software Engineering, IEEE Transactions on. (2018).
!7
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
Random initial
test suite
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
a()
c() e()d()
e()
c() b() e()
a()
c() e()d()
e()
c() b() e()
Evolutionary
search
a() e()d()
Exception:
at x(…)
at y(…)
at e(…)
Exception:
at x(…)
at y(…)
at e(…)
Crash
reproducing
test case
Stack trace
Isn’t an initial test suite close to actual usage of the classes
more likely to lead to a crash reproduction?
Test Seeding
• Use existing tests to generate
the initial test suite
• J. M. Rojas, et al. , “Seeding
strategies in search- based unit
test generation,” STVR, 2016.
• Applied to crash replication
!8
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
a() c()
c() e()c()
e()
c() a()
Exception:
at x(…)
at y(…)
at e(…)
Stack trace
a() c()
c() c()
b() a() e()
Existing
tests
e()
Random initial
test suite
Existing tests
subset
Behavioral Model Seeding
• Use a model of method usage
to generate objects used in the
initial test suite
• Relies on Model-based Testing
• Select abstract test cases
• Concretized into objects
!9
Random initial
test suite
Exception:
at x(…)
at y(…)
at e(…)
Stack trace
a()b()
c() e()
d()
Model
Model-driven
initial test
suite
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
a() b()
c() e()d()
e()
c() e()
b() a()
c() e()d()
e()
c() e()
a()
size()
add(Object)iterator()
S0
get(int)
remove(int)
S1
S2S3
remove(int)
S4
S5
SX
size()
add(Object)
size()
add(Object)
!10
Abstract test case selection
<add(Object), add(Object)>Abstract test case
int[] t = new int[7];
t[3] = (-2147483647);
EuclideanIntegerPoint ep = new […](t);
LinkedList<[...]> lst = new LinkedList<>();
lst.add(ep);
lst.add(ep);
Concrete object
Test MATH-79b, Frame 2
!11
java.lang.NullPointerException
at ...KMeansPlusPlusClusterer.assignPointsToClusters()
at ...KMeansPlusPlusClusterer.cluster()
…
Input stack trace
public void testCluster() throws Exception{

int[] t = new int[7];

t[3] = (-2147483647);

EuclideanIntegerPoint ep = new EuclideanIntegerPoint(t);

LinkedList<[...]> lst = new LinkedList<>(); 

lst.add(ep);

lst.add(ep);

KMeansPlusPlusClusterer<[...]> kmean = new KMeansPlusPlusClusterer<>(12);

lst.offerFirst(ep); 

kmean.cluster(lst, 1, (-1357));

}
Crash reproducing test
Behavioral Model Inference
• Inference from sequences of
method calls
• Coming from
• Source code
• Static analysis
• Test cases
• Dynamic analysis
• Operations logs (future work)
• Online analysis
!12
a()b()
c() e()
d()
N-gram inference
[b(), a(), e()]
[c(), d(), a(), e()]
[b(), a(), d(), a(), d(), a(), e()]
…
Behavioral Model Inference
• Inference from sequences of
method calls
• Coming from
• Source code
• Static analysis
• Test cases
• Dynamic analysis
• Operations logs (future work)
• Online analysis
!12
a()b()
c() e()
d()
N-gram inference
[b(), a(), e()]
[c(), d(), a(), e()]
[b(), a(), d(), a(), d(), a(), e()]
…
Behavioral Model Inference
• Inference from sequences of
method calls
• Coming from
• Source code
• Static analysis
• Test cases
• Dynamic analysis
• Operations logs (future work)
• Online analysis
!12
a()b()
c() e()
d()
N-gram inference
[b(), a(), e()]
[c(), d(), a(), e()]
[b(), a(), d(), a(), d(), a(), e()]
…
Evaluation on 45 crashes
!13
0
25
50
75
not started failed line reached ex. thrown reproduced
Numberofframes
Configurations
no s.
test s. 0.2
test s. 0.5
test s. 0.8
test s. 1.0
model s. 0.2
model s. 0.5
model s. 0.8
model s. 1.0
Evaluation on 45 crashes
!13
0
25
50
75
not started failed line reached ex. thrown reproduced
Numberofframes
Configurations
no s.
test s. 0.2
test s. 0.5
test s. 0.8
test s. 1.0
model s. 0.2
model s. 0.5
model s. 0.8
model s. 1.0
Evaluation on 45 crashes
!13
0
25
50
75
not started failed line reached ex. thrown reproduced
Numberofframes
Configurations
no s.
test s. 0.2
test s. 0.5
test s. 0.8
test s. 1.0
model s. 0.2
model s. 0.5
model s. 0.8
model s. 1.0
Execution Time
!14
●
●
653 653
641
638
629 699 690 697 704
1e+01
1e+03
1e+05
nos.
tests.0.2
tests.0.5
tests.0.8
tests.1.0
models.0.2
models.0.5
models.0.8
models.1.0
Numberoffitnessevaluations
Execution Time
!14
●
●
653 653
641
638
629 699 690 697 704
1e+01
1e+03
1e+05
nos.
tests.0.2
tests.0.5
tests.0.8
tests.1.0
models.0.2
models.0.5
models.0.8
models.1.0
Numberoffitnessevaluations
Influencing Factors
• Seeding abstract test cases
• <add(Object), add(Object)>
• Having dissimilar abstract test cases
• Multiple information sources
• Static analysis
• Dynamic analysis
• Prioritising abstract test cases selection
• Select abstract test cases for classes in the stack trace
!15
https://www.stamp-project.eu
https://github.com/STAMP-project

Mais conteúdo relacionado

Mais procurados

Mais procurados (8)

Design Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on ExamplesDesign Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on Examples
 
Java Class Design
Java Class DesignJava Class Design
Java Class Design
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassle
 
Executable documentation
Executable documentationExecutable documentation
Executable documentation
 
JVM Mechanics: Understanding the JIT's Tricks
JVM Mechanics: Understanding the JIT's TricksJVM Mechanics: Understanding the JIT's Tricks
JVM Mechanics: Understanding the JIT's Tricks
 
Down the rabbit hole, profiling in Django
Down the rabbit hole, profiling in DjangoDown the rabbit hole, profiling in Django
Down the rabbit hole, profiling in Django
 
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading SkillsReverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
 
Qualidade levada a sério em Python - Emilio Simoni
Qualidade levada a sério em Python - Emilio SimoniQualidade levada a sério em Python - Emilio Simoni
Qualidade levada a sério em Python - Emilio Simoni
 

Semelhante a Lorentz workshop - 2018

Mutant Tests Too: The SQL
Mutant Tests Too: The SQLMutant Tests Too: The SQL
Mutant Tests Too: The SQL
DataWorks Summit
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011
Devnology
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheck
BeScala
 

Semelhante a Lorentz workshop - 2018 (20)

20181106 arie van_deursen_testday2018
20181106 arie van_deursen_testday201820181106 arie van_deursen_testday2018
20181106 arie van_deursen_testday2018
 
Machine X Language
Machine X LanguageMachine X Language
Machine X Language
 
Introduction to Julia
Introduction to JuliaIntroduction to Julia
Introduction to Julia
 
Java Language fundamental
Java Language fundamentalJava Language fundamental
Java Language fundamental
 
Clojure made simple - Lightning talk
Clojure made simple - Lightning talkClojure made simple - Lightning talk
Clojure made simple - Lightning talk
 
Learning from 6,000 projects mining specifications in the large
Learning from 6,000 projects   mining specifications in the largeLearning from 6,000 projects   mining specifications in the large
Learning from 6,000 projects mining specifications in the large
 
Stress test your backend with Gatling
Stress test your backend with GatlingStress test your backend with Gatling
Stress test your backend with Gatling
 
bluespec talk
bluespec talkbluespec talk
bluespec talk
 
Леонид Шевцов «Clojure в деле»
Леонид Шевцов «Clojure в деле»Леонид Шевцов «Clojure в деле»
Леонид Шевцов «Clojure в деле»
 
Performance tests with Gatling (extended)
Performance tests with Gatling (extended)Performance tests with Gatling (extended)
Performance tests with Gatling (extended)
 
The Power of Probabilistic Thinking (keynote talk at ASE 2016)
The Power of Probabilistic Thinking (keynote talk at ASE 2016)The Power of Probabilistic Thinking (keynote talk at ASE 2016)
The Power of Probabilistic Thinking (keynote talk at ASE 2016)
 
Mutant Tests Too: The SQL
Mutant Tests Too: The SQLMutant Tests Too: The SQL
Mutant Tests Too: The SQL
 
Introduction to Machine Learning @ Mooncascade ML Camp
Introduction to Machine Learning @ Mooncascade ML CampIntroduction to Machine Learning @ Mooncascade ML Camp
Introduction to Machine Learning @ Mooncascade ML Camp
 
Why GC is eating all my CPU?
Why GC is eating all my CPU?Why GC is eating all my CPU?
Why GC is eating all my CPU?
 
DynaMine: Finding Common Error Patterns by Mining Software Revision Histories
DynaMine: Finding Common Error Patterns by Mining Software Revision HistoriesDynaMine: Finding Common Error Patterns by Mining Software Revision Histories
DynaMine: Finding Common Error Patterns by Mining Software Revision Histories
 
Static analysis: Around Java in 60 minutes
Static analysis: Around Java in 60 minutesStatic analysis: Around Java in 60 minutes
Static analysis: Around Java in 60 minutes
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheck
 
First-Class Patterns
First-Class PatternsFirst-Class Patterns
First-Class Patterns
 
JDD 2017: Performance tests with Gatling (Andrzej Ludwikowski)
JDD 2017: Performance tests with Gatling (Andrzej Ludwikowski)JDD 2017: Performance tests with Gatling (Andrzej Ludwikowski)
JDD 2017: Performance tests with Gatling (Andrzej Ludwikowski)
 

Mais de XavierDevroey

Mais de XavierDevroey (10)

Software Variability Management
Software Variability ManagementSoftware Variability Management
Software Variability Management
 
Effective and Efficient API Misuse Detection via Exception Propagation and Se...
Effective and Efficient API Misuse Detection via Exception Propagation and Se...Effective and Efficient API Misuse Detection via Exception Propagation and Se...
Effective and Efficient API Misuse Detection via Exception Propagation and Se...
 
Software variability management - 2019
Software variability management - 2019Software variability management - 2019
Software variability management - 2019
 
Testing Variability-Intensive Systems, tutorial SPLC 2017, part Ii
Testing Variability-Intensive Systems, tutorial SPLC 2017, part IiTesting Variability-Intensive Systems, tutorial SPLC 2017, part Ii
Testing Variability-Intensive Systems, tutorial SPLC 2017, part Ii
 
Testing Variability-Intensive Systems, tutorial SPLC 2017, part I
Testing Variability-Intensive Systems, tutorial SPLC 2017, part ITesting Variability-Intensive Systems, tutorial SPLC 2017, part I
Testing Variability-Intensive Systems, tutorial SPLC 2017, part I
 
Combinatorial Interaction Testing, an Introduction - 2018
Combinatorial Interaction Testing, an Introduction - 2018Combinatorial Interaction Testing, an Introduction - 2018
Combinatorial Interaction Testing, an Introduction - 2018
 
Software variability management - 2017
Software variability management - 2017Software variability management - 2017
Software variability management - 2017
 
Software testing: an introduction - 2017
Software testing: an introduction - 2017Software testing: an introduction - 2017
Software testing: an introduction - 2017
 
Software testing: an introduction - 2016
Software testing: an introduction - 2016Software testing: an introduction - 2016
Software testing: an introduction - 2016
 
Software testing: an introduction - 2015
Software testing: an introduction - 2015Software testing: an introduction - 2015
Software testing: an introduction - 2015
 

Último

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Último (20)

WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 

Lorentz workshop - 2018

  • 1. Behavioral Model Seeding for Search-based Crash Reproduction Pouria Derakhshanfar, Xavier Devroey, 
 Gilles Perrouin, Andy Zaidman and Arie van Deursen
  • 2. !2
  • 3. !3 java.lang.ClassCastException: […] at org…..SolrEntityReferenceResolver.getWikiReference(....java:93) at org…..SolrEntityReferenceResolver.getEntityReference(….java:70) at org…..SolrEntityReferenceResolver.resolve(….java:63) at org…..SolrDocumentReferenceResolver.resolve(….java:48) at … Crash!?!
  • 4. Java Stack Trace (Issue XWIKI-13031) !4 java.lang.ClassCastException: […] at org…..SolrEntityReferenceResolver.getWikiReference(....java:93) at org…..SolrEntityReferenceResolver.getEntityReference(….java:70) at org…..SolrEntityReferenceResolver.resolve(….java:63) at org…..SolrDocumentReferenceResolver.resolve(….java:48) at … Exception Frames {Target→
  • 6. !6 a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() Random initial test suite a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() a() c() e()d() e() c() b() e() a() c() e()d() e() c() b() e() Evolutionary search a() e()d() Exception: at x(…) at y(…) at e(…) Exception: at x(…) at y(…) at e(…) Crash reproducing test case Stack trace Soltani, M., Panichella, A. and van Deursen, A. 2018. Search-Based Crash Reproduction and Its Impact on Debugging. Software Engineering, IEEE Transactions on. (2018).
  • 7. !7 a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() Random initial test suite a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() a() c() e()d() e() c() b() e() a() c() e()d() e() c() b() e() Evolutionary search a() e()d() Exception: at x(…) at y(…) at e(…) Exception: at x(…) at y(…) at e(…) Crash reproducing test case Stack trace Isn’t an initial test suite close to actual usage of the classes more likely to lead to a crash reproduction?
  • 8. Test Seeding • Use existing tests to generate the initial test suite • J. M. Rojas, et al. , “Seeding strategies in search- based unit test generation,” STVR, 2016. • Applied to crash replication !8 a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() a() c() c() e()c() e() c() a() Exception: at x(…) at y(…) at e(…) Stack trace a() c() c() c() b() a() e() Existing tests e() Random initial test suite Existing tests subset
  • 9. Behavioral Model Seeding • Use a model of method usage to generate objects used in the initial test suite • Relies on Model-based Testing • Select abstract test cases • Concretized into objects !9 Random initial test suite Exception: at x(…) at y(…) at e(…) Stack trace a()b() c() e() d() Model Model-driven initial test suite a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() a() b() c() e()d() e() c() e() b() a() c() e()d() e() c() e() a()
  • 10. size() add(Object)iterator() S0 get(int) remove(int) S1 S2S3 remove(int) S4 S5 SX size() add(Object) size() add(Object) !10 Abstract test case selection <add(Object), add(Object)>Abstract test case int[] t = new int[7]; t[3] = (-2147483647); EuclideanIntegerPoint ep = new […](t); LinkedList<[...]> lst = new LinkedList<>(); lst.add(ep); lst.add(ep); Concrete object
  • 11. Test MATH-79b, Frame 2 !11 java.lang.NullPointerException at ...KMeansPlusPlusClusterer.assignPointsToClusters() at ...KMeansPlusPlusClusterer.cluster() … Input stack trace public void testCluster() throws Exception{
 int[] t = new int[7];
 t[3] = (-2147483647);
 EuclideanIntegerPoint ep = new EuclideanIntegerPoint(t);
 LinkedList<[...]> lst = new LinkedList<>(); 
 lst.add(ep);
 lst.add(ep);
 KMeansPlusPlusClusterer<[...]> kmean = new KMeansPlusPlusClusterer<>(12);
 lst.offerFirst(ep); 
 kmean.cluster(lst, 1, (-1357));
 } Crash reproducing test
  • 12. Behavioral Model Inference • Inference from sequences of method calls • Coming from • Source code • Static analysis • Test cases • Dynamic analysis • Operations logs (future work) • Online analysis !12 a()b() c() e() d() N-gram inference [b(), a(), e()] [c(), d(), a(), e()] [b(), a(), d(), a(), d(), a(), e()] …
  • 13. Behavioral Model Inference • Inference from sequences of method calls • Coming from • Source code • Static analysis • Test cases • Dynamic analysis • Operations logs (future work) • Online analysis !12 a()b() c() e() d() N-gram inference [b(), a(), e()] [c(), d(), a(), e()] [b(), a(), d(), a(), d(), a(), e()] …
  • 14. Behavioral Model Inference • Inference from sequences of method calls • Coming from • Source code • Static analysis • Test cases • Dynamic analysis • Operations logs (future work) • Online analysis !12 a()b() c() e() d() N-gram inference [b(), a(), e()] [c(), d(), a(), e()] [b(), a(), d(), a(), d(), a(), e()] …
  • 15. Evaluation on 45 crashes !13 0 25 50 75 not started failed line reached ex. thrown reproduced Numberofframes Configurations no s. test s. 0.2 test s. 0.5 test s. 0.8 test s. 1.0 model s. 0.2 model s. 0.5 model s. 0.8 model s. 1.0
  • 16. Evaluation on 45 crashes !13 0 25 50 75 not started failed line reached ex. thrown reproduced Numberofframes Configurations no s. test s. 0.2 test s. 0.5 test s. 0.8 test s. 1.0 model s. 0.2 model s. 0.5 model s. 0.8 model s. 1.0
  • 17. Evaluation on 45 crashes !13 0 25 50 75 not started failed line reached ex. thrown reproduced Numberofframes Configurations no s. test s. 0.2 test s. 0.5 test s. 0.8 test s. 1.0 model s. 0.2 model s. 0.5 model s. 0.8 model s. 1.0
  • 18. Execution Time !14 ● ● 653 653 641 638 629 699 690 697 704 1e+01 1e+03 1e+05 nos. tests.0.2 tests.0.5 tests.0.8 tests.1.0 models.0.2 models.0.5 models.0.8 models.1.0 Numberoffitnessevaluations
  • 19. Execution Time !14 ● ● 653 653 641 638 629 699 690 697 704 1e+01 1e+03 1e+05 nos. tests.0.2 tests.0.5 tests.0.8 tests.1.0 models.0.2 models.0.5 models.0.8 models.1.0 Numberoffitnessevaluations
  • 20. Influencing Factors • Seeding abstract test cases • <add(Object), add(Object)> • Having dissimilar abstract test cases • Multiple information sources • Static analysis • Dynamic analysis • Prioritising abstract test cases selection • Select abstract test cases for classes in the stack trace !15