SlideShare uma empresa Scribd logo
1 de 71
Baixar para ler offline
Automated Testing in
DevOps
Benoit Baudry
baudry@kth.se
DevOps
•High degrees of automation in software
development, deployment and operations
•Objectives
•Better quality
•Shorter release cycles
•Continuous feedback from Ops to Dev
Automatic Testing in DevOps - Lorentz Workshop 2
DevOps
3Automatic Testing in DevOps - Lorentz Workshop
DevOps – automatic development
unit
perf.
fuzzing
loggingdep. inj.
UI
CI
pertur-
bation
fault
recov.
IDEs
libraries
container
IDS
VMs
cluster
config.
4Automatic Testing in DevOps - Lorentz Workshop
Automatic testing enables DevOps
Continuous Delivery. Jez Humble and David Farley. 2010.
Automatic Testing in DevOps - Lorentz Workshop 5
Automatic Testing in DevOps - Lorentz Workshop 6
DevOps – continuous testing
unit
perf.
fuzzing
logging
UI
pertur-
bation
fault
recov.
IDS
cluster
config.
7
static
Automatic Testing in DevOps - Lorentz Workshop
Automatic testing and
Continuous Integration
Automatic Testing in DevOps - Lorentz Workshop 8
Continuous integration
•‘only’ Dev automation
Automatic Testing in DevOps - Lorentz Workshop 9
Continuous integration
•Many software
companies do not
operate their product
•IDE, test runners and CI
are available for research
Automatic Testing in DevOps - Lorentz Workshop 10
Continuous integration
Continuous Integration
- Unit, integration testing
- Coverage, mutation
- Test generation and repair
Automatic test improvement
- Test refactoring
- Test amplification
- Test fixing
IDE
- Linters
- Completion
Automatic Testing in DevOps - Lorentz Workshop 11
Continuous feedback
Continuous Delivery. Jez Humble and David Farley. 2010.
Automatic Testing in DevOps - Lorentz Workshop 12
The pull request loop
Collaboration
platform
pull req.
Automatic Testing in DevOps - Lorentz Workshop 13
The pull request loop
Collaboration
platform
pull req.
code
Automatic Testing in DevOps - Lorentz Workshop 14
The pull request loop
Collaboration
platform
pull req.
code
analyses
Automatic Testing in DevOps - Lorentz Workshop 15
The pull request loop
Collaboration
platform
pull req.
code
analyses
feedback
Automatic Testing in DevOps - Lorentz Workshop 16
The pull request loop
pull req.
code
analyses
feedback
Automatic Testing in DevOps - Lorentz Workshop 17
The pull request loop for research
Collaboration
platform
pull req.
code
analyses
feedback
Empirical analyses
Automatic Testing in DevOps - Lorentz Workshop 18
The pull request loop for research
Collaboration
platform
pull req.
code
analyses
feedback
Novel analysesAutomatic Testing in DevOps - Lorentz Workshop 19
The pull request loop for research
Collaboration
platform
pull req.
code
analyses
feedback
Novel analysesAutomatic Testing in DevOps - Lorentz Workshop 20
Revisit test prioritization in the CI
•Test priorization orders tests to detect
failures faster
•Non-CI approaches reorder tests cases
according to a change
•Proposal: in the CI, reorder commits to be
executed
Redefining Prioritization: Continuous Prioritization for Continuous Integration. J. Liang, S. Elbaum, G. Rothermel. ICSE 2018.
Automatic Testing in DevOps - Lorentz Workshop 21
Revisit test prioritization in the CI
Redefining Prioritization: Continuous Prioritization for Continuous Integration. J. Liang, S. Elbaum, G. Rothermel. ICSE 2018.
Automatic Testing in DevOps - Lorentz Workshop 22
Revisit test prioritization in the CI
Redefining Prioritization: Continuous Prioritization for Continuous Integration. J. Liang, S. Elbaum, G. Rothermel. ICSE 2018.
Automatic Testing in DevOps - Lorentz Workshop 23
Analysis of code coverage evolution
•“Statement coverage … reduces the quality
measure to a single ratio, making
developers potentially miss valuable
information about their test suite and its
limitations”
•7,816 revisions of 47 projects
•http://www.code-coverage.org
Automatic Testing in DevOps - Lorentz Workshop 24
A Large-Scale Study of Test Coverage Evolution. M. Hilton, J. Bell, D. Marinov. ASE 2018.
Analysis of code coverage evolution
A Large-Scale Study of Test Coverage Evolution. M. Hilton, J. Bell, D. Marinov. ASE 2018.
Automatic Testing in DevOps - Lorentz Workshop 25
Deflaker
•Flaky tests are tests which verdict changes
even if the code does not change
•Deflaker is a new bot to automate the
detection of flaky tests
•http://www.deflaker.org
DeFlaker: Automatically Detecting Flaky Tests. J. Bell, O. Legunsen, M. Hilton, L. Eloussi, T. Yung, and D. Marinov2. ICSE 2018.
Automatic Testing in DevOps - Lorentz Workshop 26
Deflaker
DeFlaker: Automatically Detecting Flaky Tests. J. Bell, O. Legunsen, M. Hilton, L. Eloussi, T. Yung, and D. Marinov2. ICSE 2018.
Automatic Testing in DevOps - Lorentz Workshop 27
DeFlaker: Automatically Detecting Flaky Tests. J. Bell, O. Legunsen, M. Hilton, L. Eloussi, T. Yung, and D. Marinov2. ICSE 2018.
Automatic Testing in DevOps - Lorentz Workshop 28
Repairnator
•Automatic repair bot to target build failures
•Runs since February 2017
•ICSE SEIP paper reports on
•11 523 test failures over 1 609 open-source
software projects hosted on GitHub
•generated patches for 15 different bugs
How to Design a Program Repair Bot? Insights from the Repairnator Project. S. Urli, Z. Yu, L. Seinturier, M. Monperrus. ICSE SEIP 2018.
Automatic Testing in DevOps - Lorentz Workshop 29
Repairnator
How to Design a Program Repair Bot? Insights from the Repairnator Project. S. Urli,
Z. Yu, L. Seinturier, M. Monperrus. ICSE SEIP 2018.
30
Repairnator
How to Design a Program Repair Bot? Insights from the Repairnator Project. S. Urli, Z. Yu, L. Seinturier, M. Monperrus. ICSE SEIP 2018.
Automatic Testing in DevOps - Lorentz Workshop 31
DSpot
•Amplify existing unit test cases
•Start from developers’ test cases
•Automatically generate variants
•Submit pull requests
Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects. B. Danglot, O. Luis Vera-Pérez, B. Baudry, M. Monperrus. Submitted to EMSE.
Automatic Testing in DevOps - Lorentz Workshop 32
DSpot
Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects. B. Danglot, O. Luis Vera-Pérez, B. Baudry, M. Monperrus. Submitted to EMSE.
@Test
public void html() {
Attribute attr = new Attribute("key", "value &");
assertEquals("key="value &"", attr.html());
assertEquals(attr.html(), attr.toString());}
Automatic Testing in DevOps - Lorentz Workshop 33
DSpot
Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects. B. Danglot, O. Luis Vera-Pérez, B. Baudry, M. Monperrus. Submitted to EMSE.
@Test
public void html() {
Attribute attr = new Attribute("key", "value &");
assertEquals("key="value &"", attr.html());
assertEquals(attr.html(), attr.toString());}
@Test
public void html_add33() throws Exception {
Attribute attr = new Attribute("key", "value &");
Assert.assertEquals("key="value &"", attr.html());
Assert.assertEquals("key="value &"", attr.toString());
Assert.assertEquals("key", attr.getKey());
Assert.assertEquals("value &", attr.getValue()); }
Automatic Testing in DevOps - Lorentz Workshop 34
DSpot
Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects. B. Danglot, O. Luis Vera-Pérez, B. Baudry, M. Monperrus. Submitted to EMSE.
Automatic Testing in DevOps - Lorentz Workshop 35
DSpot
Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects. B. Danglot, O. Luis Vera-Pérez, B. Baudry, M. Monperrus. Submitted to EMSE.
Automatic Testing in DevOps - Lorentz Workshop 36
Mutation at Google
•Mutation testing assesses the validity of test
cases
•Inject bugs in code
•Check that test cases detect the bugs
•Traditional mutation does not scale
•Google has developed a mutation approach
for their PR-loop
State of Mutation Testing at Google. G. Petrovic, M. Ivankovic. ICSE SEIP 2018.
Automatic Testing in DevOps - Lorentz Workshop 37
Mutation at Google
State of Mutation Testing at Google. G. Petrovic, M. Ivankovic. ICSE SEIP 2018.
Automatic Testing in DevOps - Lorentz Workshop 38
Mutation at Google
State of Mutation Testing at Google. G. Petrovic, M. Ivankovic. ICSE SEIP 2018.
Automatic Testing in DevOps - Lorentz Workshop 39
Mutation at Google
State of Mutation Testing at Google. G. Petrovic, M. Ivankovic. ICSE SEIP 2018.
40
Sapienz
•Automatic test generation and repair
•Black-box, system level
•Deployed in the Facebook PR-loop
•All tests, bugs and patches are reviewed by
developers
Automatic Testing in DevOps - Lorentz Workshop 41Deploying Search Based Software Engineering with Sapienz at Facebook. N. Alshahwan, X. Gao, M. Harman, Y. Jia, K. Mao, A. Mols, T. Tei, and I. Zorin. SSBSE 2018.
https://code.fb.com/developer-tools/finding-and-fixing-software-bugs-automatically-with-sapfix-and-sapienz/
Sapienz
Automatic Testing in DevOps - Lorentz Workshop 42Deploying Search Based Software Engineering with Sapienz at Facebook. N. Alshahwan, X. Gao, M. Harman, Y. Jia, K. Mao, A. Mols, T. Tei, and I. Zorin. SSBSE 2018.
https://code.fb.com/developer-tools/finding-and-fixing-software-bugs-automatically-with-sapfix-and-sapienz/
Sapienz
•In production since September 2017
•75% of bugs reported have been fixed
•Sapfix deployed in August 2018
•Some automatic patches accepted
Automatic Testing in DevOps - Lorentz Workshop 43Deploying Search Based Software Engineering with Sapienz at Facebook. N. Alshahwan, X. Gao, M. Harman, Y. Jia, K. Mao, A. Mols, T. Tei, and I. Zorin. SSBSE 2018.
https://code.fb.com/developer-tools/finding-and-fixing-software-bugs-automatically-with-sapfix-and-sapienz/
Automatic testing in Ops
Automatic Testing in DevOps - Lorentz Workshop 44
Crash analysis
- Reproduction
- Localization
Online experiments
- Chaos
- A/B testing
Testing in Ops
•Test in production
•Requires production
•Industry-driven
•Test in the feedback
•Little research
Automatic Testing in DevOps - Lorentz Workshop 45
Online experiments
•Software testing is all about experiments
•Express expected behavior (oracle)
•Run system to check actual vs. Expected (test case)
•On the Ops side, one can perform
experiments with the real system
•Express hypothesis
•Run experiments to check validity
Automatic Testing in DevOps - Lorentz Workshop 46
A/B testing
Automatic Testing in DevOps - Lorentz Workshop 47
A/B testing
https://medium.com/netflix-techblog/a-b-testing-and-beyond-improving-the-netflix-streaming-experience-with-experimentation-and-data-5b0ae9295bdf
Automatic Testing in DevOps - Lorentz Workshop 48
A/B testing
•Modular features, feature toggles
•Graphical elements
•Game levels
•Sample and track a population
of users
•Precise metrics about the value of a
feature
Automatic Testing in DevOps - Lorentz Workshop 49
Chaos engineering
•Breaking things on purpose in order to build
more resilient systems!
https://principlesofchaos.org/
Automatic Testing in DevOps - Lorentz Workshop 50
Principles of chaos engineering
•Build a Hypothesis around Steady State
Behavior
•Vary Real-world Events
•Run Experiments in Production
•Automate Experiments to Run Continuously
•Minimize Blast Radius
https://principlesofchaos.org/
Automatic Testing in DevOps - Lorentz Workshop 51
Netflix’s simian army
•Induce failure regularly
• ‘break’ production code to check the
system’s ability to react
• Chaos monkey: randomly terminates an
instance in production
• Chaos kong: take an entire region offline
• Latency monkey: artificial delay in
RESTful clients
52Automatic Testing in DevOps - Lorentz Workshop
Chaos engineering
•Growing adoption: SDN, CDN, JVM
•Resilience of large distributed systems
•Online perturbation
•Monitor and report
•Loosely coupled architectures
•Macro-level health metric
Automatic Testing in DevOps - Lorentz Workshop 53
Crash reproduction
54
java.util.NoSuchElementException
at org.xwiki.rendering.listener.chaining.EmptyBlockChainingListener.stopContainerBlock(EmptyBlockChainingListener.java:458)
at org.xwiki.rendering.listener.chaining.EmptyBlockChainingListener.endFormat(EmptyBlockChainingListener.java:263)
at org.xwiki.rendering.listener.chaining.AbstractChainingListener.endFormat(AbstractChainingListener.java:290)
at org.xwiki.rendering.listener.chaining.BlockStateChainingListener.endFormat(BlockStateChainingListener.java:439)
at org.xwiki.rendering.listener.chaining.AbstractChainingListener.endFormat(AbstractChainingListener.java:290)
at org.xwiki.rendering.listener.CompositeListener.endFormat(CompositeListener.java:253)
at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.flushFormat(DefaultXWikiGeneratorListener.java:325)
at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.flushFormat(DefaultXWikiGeneratorListener.java:273)
at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.flushFormat(DefaultXWikiGeneratorListener.java:267)
at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.onWord(DefaultXWikiGeneratorListener.java:906)
at org.xwiki.rendering.wikimodel.impl.InternalWikiScannerContext.onWord(InternalWikiScannerContext.java:1147)
at org.xwiki.rendering.wikimodel.impl.WikiScannerContext.onWord(WikiScannerContext.java:597)
at org.xwiki.rendering.wikimodel.xhtml.impl.TagStack.flushStack(TagStack.java:204)
at org.xwiki.rendering.wikimodel.xhtml.impl.TagStack.onCharacters(TagStack.java:227)
at org.xwiki.rendering.wikimodel.xhtml.impl.XhtmlHandler.characters(XhtmlHandler.java:180)
at org.xml.sax.helpers.XMLFilterImpl.characters(XMLFilterImpl.java:588)
at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.sendCharacters(XHTMLWhitespaceXMLFilter.java:487)
at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.sendCharacters(XHTMLWhitespaceXMLFilter.java:480)
at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.flushContent(XHTMLWhitespaceXMLFilter.java:357)
at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.flushContent(XHTMLWhitespaceXMLFilter.java:335)
at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.endElement(XHTMLWhitespaceXMLFilter.java:200)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
at org.xwiki.rendering.wikimodel.xhtml.filter.AccumulationXMLFilter.endElement(AccumulationXMLFilter.java:86)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
at org.xwiki.rendering.wikimodel.xhtml.filter.DTDXMLFilter.endElement(DTDXMLFilter.java:86)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11NonValidatingConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11NonValidatingConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter.parse(DefaultXMLFilter.java:58)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter.parse(DefaultXMLFilter.java:58)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter.parse(DefaultXMLFilter.java:58)
at org.xwiki.rendering.wikimodel.xhtml.XhtmlParser.parse(XhtmlParser.java:132)
Automatic Testing in DevOps - Lorentz Workshop
Crash-reproducing Test Case
55
public void test0() throws Throwable {
…
SolrEntityReferenceResolver solrEntityReferenceResolver0 = new …();
EntityReferenceResolver entityReferenceResolver0 = … mock(…);
solrDocument0.put("wiki", (Object) entityType0);
Injector.inject(solrEntityReferenceResolver0, …);
Injector.validateBean(solrEntityReferenceResolver0, …);
…
// Undeclared exception!
solrEntityReferenceResolver0.resolve(solrDocument0, entityType0, objectArray0);
}
java.lang.ClassCastException: […]
at org…..SolrEntityReferenceResolver.getWikiReference(....java:93)
at org…..SolrEntityReferenceResolver.getEntityReference(….java:70)
at org…..SolrEntityReferenceResolver.resolve(….java:63)
Automatic Testing in DevOps - Lorentz Workshop
Crash-Guided
Genetic Algorithm
• EvoCrash
• Implemented on top of EvoSuite
• Requires
• Stack trace
• Binaries
• .jar files
• Time budget
• Set by the user
56
Initialize population
Evaluate fitness
Next generation
Selection
Crossover
Mutation
Reinsertion
[fitness == 0 or
budget exhausted]
Automatic Testing in DevOps - Lorentz Workshop
Challenges
Automatic Testing in DevOps - Lorentz Workshop 57
@Test
testDecodeQueryString() {
Map<String, String> p = newHashMap();
String uri = "something?test=value";
RestUtils.decodeQueryString
(uri, uri.indexOf(’?’) + 1,p);
assertThat(p.size(), equalTo(1));
assertThat(p.get("test"), equalTo("value"));
}
Flaky tests
Does Refactoring of Test Smells Induce Fixing Flaky Tests? Fabio
Palomba and Andy Zaidman. ICSME 2017.
Automatic Testing in DevOps - Lorentz Workshop 58
Complex builds
How to Design a Program Repair Bot? Insights from the Repairnator Project. S. Urli, Z. Yu, L. Seinturier, M. Monperrus. ICSE SEIP 2018.
Automatic Testing in DevOps - Lorentz Workshop 59
Multi module projects
•Many projects are composed of multiple
modules
38 38
10
2
0
5
10
15
20
25
30
35
40
[1000, 50000) [50000,250000) [250000,1000000) >= 1000000 60
Multi module projects
29
24
10
4 4
3 3
2 2
1 1 1 1 1 1 1
0
5
10
15
20
25
30
35
[0,10)
[10,20)
[20,30)
[30,40)
[40,50)
[50,60)
[60,70)
[70,80)
[80,90)
[90,100)
[100,110)
[110,120)
[120,130)
[130,140)
[140,150)
[150,160)
[160,170)
[170,180)
[180,190)
[190,200)
[200,210)
[210,220)
[220,230)
[230,240)
[240,250)
[250,260)
[260,270)
[270,280)
[280,290)
[290,300)
[300,310)
[310,320)
[320,330)
[330,340)
[340,350)
[350,360)
[360,370)
[370,380)
[380,390)
[390,400)
[400,410)
[410,420)
[420,430)
Min 2
Mean 35
Median 16
Max 423
61
Multi module projects
867
669
1126
328
41 25 19 3 1
0
200
400
600
800
1000
1200
0 1 [2,10) [10,20) [20,30) [30,40) [40,50) [50,60) [60,70)
Min 0
Mean 4
Median 2
Max 67
62
Multi module projects
https://github.com/hcoles/pitest 63
Multi module projects
https://github.com/spring-cloud/spring-cloud-stream 64
Ecosystems of
dependencies
•Only 1% of Maven
Central
•31877 artefacts
•57227
dependencies
Collected and visualized by Amine Benelallam and Cesar Soto
Automatic Testing in DevOps - Lorentz Workshop 65
Get Ops conditions
•Record production traffic
•Replay traffic
•Shadow traffic
Automatic Testing in DevOps - Lorentz Workshop 66
Automatic Testing in DevOps - Lorentz Workshop 67
Conclusion
Automatic Testing in DevOps - Lorentz Workshop 68
Crash analysis
- Reproduction
- Localization
Online experiments
- Chaos
- A/B testing
Automatic Testing in DevOps - Lorentz Workshop 69
Continuous Integration
- Unit, integration testing
- Coverage, mutation
- Test generation and repair
Test improvement
- Test refactoring
- Test amplification
- Test fixing
IDE
- Linters
- Completion
Automatic testing in DevOps
•Vibrant research and development topic
•The PR loop is an pportunity for research
•Incremental analyses and testing
•Developer in the loop
•Challenges
•Going in the Ops
•Build complexity
Automatic Testing in DevOps - Lorentz Workshop 70
Acknowledgements
•Oscar Vera-Pérez, Benjamin Danglot, César
Soto, Amine Benelalam, Nicolas Harrand,
Martin Monperrus
•https://stamp.ow2.org
Automatic Testing in DevOps - Lorentz Workshop 71

Mais conteúdo relacionado

Mais procurados

2016 quali continuous testing quest for quality conference
2016 quali continuous testing quest for quality conference2016 quali continuous testing quest for quality conference
2016 quali continuous testing quest for quality conference
QualiQuali
 
How to get the most out of your CI/CD workflow using automated testing - Sauc...
How to get the most out of your CI/CD workflow using automated testing - Sauc...How to get the most out of your CI/CD workflow using automated testing - Sauc...
How to get the most out of your CI/CD workflow using automated testing - Sauc...
twaintaylorb2b
 
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Raffi Khatchadourian
 
Proactive Empirical Assessment of New Language Feature Adoption via Automated...
Proactive Empirical Assessment of New Language Feature Adoption via Automated...Proactive Empirical Assessment of New Language Feature Adoption via Automated...
Proactive Empirical Assessment of New Language Feature Adoption via Automated...
Raffi Khatchadourian
 

Mais procurados (20)

DevOps Unicorns
DevOps UnicornsDevOps Unicorns
DevOps Unicorns
 
AgileDC15 I'm Using Chef So I'm DevOps Right?
AgileDC15 I'm Using Chef So I'm DevOps Right?AgileDC15 I'm Using Chef So I'm DevOps Right?
AgileDC15 I'm Using Chef So I'm DevOps Right?
 
Do Bugs Reside in Complex Code?
Do Bugs Reside in Complex Code?Do Bugs Reside in Complex Code?
Do Bugs Reside in Complex Code?
 
QUICKAR-ASE2016-Singapore
QUICKAR-ASE2016-SingaporeQUICKAR-ASE2016-Singapore
QUICKAR-ASE2016-Singapore
 
Agile analysis development
Agile analysis developmentAgile analysis development
Agile analysis development
 
Continuous testing webinar 041017 slideshare
Continuous testing webinar 041017 slideshareContinuous testing webinar 041017 slideshare
Continuous testing webinar 041017 slideshare
 
Software testing: an introduction - 2017
Software testing: an introduction - 2017Software testing: an introduction - 2017
Software testing: an introduction - 2017
 
2016 quali continuous testing quest for quality conference
2016 quali continuous testing quest for quality conference2016 quali continuous testing quest for quality conference
2016 quali continuous testing quest for quality conference
 
How to get the most out of your CI/CD workflow using automated testing - Sauc...
How to get the most out of your CI/CD workflow using automated testing - Sauc...How to get the most out of your CI/CD workflow using automated testing - Sauc...
How to get the most out of your CI/CD workflow using automated testing - Sauc...
 
Agile Testing 2020
Agile Testing 2020Agile Testing 2020
Agile Testing 2020
 
An Introduction to Developer Testing
An Introduction to Developer TestingAn Introduction to Developer Testing
An Introduction to Developer Testing
 
DevOps - Boldly Go for Distro
DevOps - Boldly Go for DistroDevOps - Boldly Go for Distro
DevOps - Boldly Go for Distro
 
An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...
 
Loopt unit test experiences
Loopt unit test experiencesLoopt unit test experiences
Loopt unit test experiences
 
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
 
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
 
Efficient Dependency Detection for Safe Java Test Acceleration
Efficient Dependency Detection for Safe Java Test AccelerationEfficient Dependency Detection for Safe Java Test Acceleration
Efficient Dependency Detection for Safe Java Test Acceleration
 
Infrastructure
InfrastructureInfrastructure
Infrastructure
 
Dependency Injection in iOS
Dependency Injection in iOSDependency Injection in iOS
Dependency Injection in iOS
 
Proactive Empirical Assessment of New Language Feature Adoption via Automated...
Proactive Empirical Assessment of New Language Feature Adoption via Automated...Proactive Empirical Assessment of New Language Feature Adoption via Automated...
Proactive Empirical Assessment of New Language Feature Adoption via Automated...
 

Semelhante a Automatic testing in DevOps

Automated testing DrupalCamp in Asheville
Automated testing DrupalCamp in AshevilleAutomated testing DrupalCamp in Asheville
Automated testing DrupalCamp in Asheville
Promet Source
 
Introduction to test automation in java and php
Introduction to test automation in java and phpIntroduction to test automation in java and php
Introduction to test automation in java and php
Tho Q Luong Luong
 

Semelhante a Automatic testing in DevOps (20)

Test Driven Development and Quality Improvement
Test Driven Development and Quality ImprovementTest Driven Development and Quality Improvement
Test Driven Development and Quality Improvement
 
The Future is Now: Writing Automated Tests To Grow Your Code
The Future is Now: Writing Automated Tests To Grow Your CodeThe Future is Now: Writing Automated Tests To Grow Your Code
The Future is Now: Writing Automated Tests To Grow Your Code
 
How To Use Jenkins for Continuous Load and Mobile Testing with SOASTA & Cloud...
How To Use Jenkins for Continuous Load and Mobile Testing with SOASTA & Cloud...How To Use Jenkins for Continuous Load and Mobile Testing with SOASTA & Cloud...
How To Use Jenkins for Continuous Load and Mobile Testing with SOASTA & Cloud...
 
How To Use Jenkins for Continuous Load and Mobile Testing with SOASTA & Cloud...
How To Use Jenkins for Continuous Load and Mobile Testing with SOASTA & Cloud...How To Use Jenkins for Continuous Load and Mobile Testing with SOASTA & Cloud...
How To Use Jenkins for Continuous Load and Mobile Testing with SOASTA & Cloud...
 
An exploratory study of the state of practice of performance testing in Java-...
An exploratory study of the state of practice of performance testing in Java-...An exploratory study of the state of practice of performance testing in Java-...
An exploratory study of the state of practice of performance testing in Java-...
 
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
 
OOSE Unit 5 PPT.ppt
OOSE Unit 5 PPT.pptOOSE Unit 5 PPT.ppt
OOSE Unit 5 PPT.ppt
 
Oose unit 5 ppt
Oose unit 5 pptOose unit 5 ppt
Oose unit 5 ppt
 
Automated testing DrupalCamp in Asheville
Automated testing DrupalCamp in AshevilleAutomated testing DrupalCamp in Asheville
Automated testing DrupalCamp in Asheville
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
Developing PHP Applications Faster
Developing PHP Applications FasterDeveloping PHP Applications Faster
Developing PHP Applications Faster
 
How to Clean Up Your Continuous Testing Suites for Web & Mobile
How to Clean Up Your Continuous Testing Suites for Web & MobileHow to Clean Up Your Continuous Testing Suites for Web & Mobile
How to Clean Up Your Continuous Testing Suites for Web & Mobile
 
How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.
 
Introduction to test automation in java and php
Introduction to test automation in java and phpIntroduction to test automation in java and php
Introduction to test automation in java and php
 
Lecture 10: ML Testing & Explainability (Full Stack Deep Learning - Spring 2021)
Lecture 10: ML Testing & Explainability (Full Stack Deep Learning - Spring 2021)Lecture 10: ML Testing & Explainability (Full Stack Deep Learning - Spring 2021)
Lecture 10: ML Testing & Explainability (Full Stack Deep Learning - Spring 2021)
 
SOASTA Webinar: Process Compression For Mobile App Dev 120612
SOASTA Webinar: Process Compression For Mobile App Dev 120612SOASTA Webinar: Process Compression For Mobile App Dev 120612
SOASTA Webinar: Process Compression For Mobile App Dev 120612
 
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
 
When you get lost in api testing #ForumPHP
When you get lost in api testing #ForumPHPWhen you get lost in api testing #ForumPHP
When you get lost in api testing #ForumPHP
 
Software Analytics - Achievements and Challenges
Software Analytics - Achievements and ChallengesSoftware Analytics - Achievements and Challenges
Software Analytics - Achievements and Challenges
 
Python testing like a pro by Keith Yang
Python testing like a pro by Keith YangPython testing like a pro by Keith Yang
Python testing like a pro by Keith Yang
 

Último

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Último (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Automatic testing in DevOps

  • 1. Automated Testing in DevOps Benoit Baudry baudry@kth.se
  • 2. DevOps •High degrees of automation in software development, deployment and operations •Objectives •Better quality •Shorter release cycles •Continuous feedback from Ops to Dev Automatic Testing in DevOps - Lorentz Workshop 2
  • 3. DevOps 3Automatic Testing in DevOps - Lorentz Workshop
  • 4. DevOps – automatic development unit perf. fuzzing loggingdep. inj. UI CI pertur- bation fault recov. IDEs libraries container IDS VMs cluster config. 4Automatic Testing in DevOps - Lorentz Workshop
  • 5. Automatic testing enables DevOps Continuous Delivery. Jez Humble and David Farley. 2010. Automatic Testing in DevOps - Lorentz Workshop 5
  • 6. Automatic Testing in DevOps - Lorentz Workshop 6
  • 7. DevOps – continuous testing unit perf. fuzzing logging UI pertur- bation fault recov. IDS cluster config. 7 static Automatic Testing in DevOps - Lorentz Workshop
  • 8. Automatic testing and Continuous Integration Automatic Testing in DevOps - Lorentz Workshop 8
  • 9. Continuous integration •‘only’ Dev automation Automatic Testing in DevOps - Lorentz Workshop 9
  • 10. Continuous integration •Many software companies do not operate their product •IDE, test runners and CI are available for research Automatic Testing in DevOps - Lorentz Workshop 10
  • 11. Continuous integration Continuous Integration - Unit, integration testing - Coverage, mutation - Test generation and repair Automatic test improvement - Test refactoring - Test amplification - Test fixing IDE - Linters - Completion Automatic Testing in DevOps - Lorentz Workshop 11
  • 12. Continuous feedback Continuous Delivery. Jez Humble and David Farley. 2010. Automatic Testing in DevOps - Lorentz Workshop 12
  • 13. The pull request loop Collaboration platform pull req. Automatic Testing in DevOps - Lorentz Workshop 13
  • 14. The pull request loop Collaboration platform pull req. code Automatic Testing in DevOps - Lorentz Workshop 14
  • 15. The pull request loop Collaboration platform pull req. code analyses Automatic Testing in DevOps - Lorentz Workshop 15
  • 16. The pull request loop Collaboration platform pull req. code analyses feedback Automatic Testing in DevOps - Lorentz Workshop 16
  • 17. The pull request loop pull req. code analyses feedback Automatic Testing in DevOps - Lorentz Workshop 17
  • 18. The pull request loop for research Collaboration platform pull req. code analyses feedback Empirical analyses Automatic Testing in DevOps - Lorentz Workshop 18
  • 19. The pull request loop for research Collaboration platform pull req. code analyses feedback Novel analysesAutomatic Testing in DevOps - Lorentz Workshop 19
  • 20. The pull request loop for research Collaboration platform pull req. code analyses feedback Novel analysesAutomatic Testing in DevOps - Lorentz Workshop 20
  • 21. Revisit test prioritization in the CI •Test priorization orders tests to detect failures faster •Non-CI approaches reorder tests cases according to a change •Proposal: in the CI, reorder commits to be executed Redefining Prioritization: Continuous Prioritization for Continuous Integration. J. Liang, S. Elbaum, G. Rothermel. ICSE 2018. Automatic Testing in DevOps - Lorentz Workshop 21
  • 22. Revisit test prioritization in the CI Redefining Prioritization: Continuous Prioritization for Continuous Integration. J. Liang, S. Elbaum, G. Rothermel. ICSE 2018. Automatic Testing in DevOps - Lorentz Workshop 22
  • 23. Revisit test prioritization in the CI Redefining Prioritization: Continuous Prioritization for Continuous Integration. J. Liang, S. Elbaum, G. Rothermel. ICSE 2018. Automatic Testing in DevOps - Lorentz Workshop 23
  • 24. Analysis of code coverage evolution •“Statement coverage … reduces the quality measure to a single ratio, making developers potentially miss valuable information about their test suite and its limitations” •7,816 revisions of 47 projects •http://www.code-coverage.org Automatic Testing in DevOps - Lorentz Workshop 24 A Large-Scale Study of Test Coverage Evolution. M. Hilton, J. Bell, D. Marinov. ASE 2018.
  • 25. Analysis of code coverage evolution A Large-Scale Study of Test Coverage Evolution. M. Hilton, J. Bell, D. Marinov. ASE 2018. Automatic Testing in DevOps - Lorentz Workshop 25
  • 26. Deflaker •Flaky tests are tests which verdict changes even if the code does not change •Deflaker is a new bot to automate the detection of flaky tests •http://www.deflaker.org DeFlaker: Automatically Detecting Flaky Tests. J. Bell, O. Legunsen, M. Hilton, L. Eloussi, T. Yung, and D. Marinov2. ICSE 2018. Automatic Testing in DevOps - Lorentz Workshop 26
  • 27. Deflaker DeFlaker: Automatically Detecting Flaky Tests. J. Bell, O. Legunsen, M. Hilton, L. Eloussi, T. Yung, and D. Marinov2. ICSE 2018. Automatic Testing in DevOps - Lorentz Workshop 27
  • 28. DeFlaker: Automatically Detecting Flaky Tests. J. Bell, O. Legunsen, M. Hilton, L. Eloussi, T. Yung, and D. Marinov2. ICSE 2018. Automatic Testing in DevOps - Lorentz Workshop 28
  • 29. Repairnator •Automatic repair bot to target build failures •Runs since February 2017 •ICSE SEIP paper reports on •11 523 test failures over 1 609 open-source software projects hosted on GitHub •generated patches for 15 different bugs How to Design a Program Repair Bot? Insights from the Repairnator Project. S. Urli, Z. Yu, L. Seinturier, M. Monperrus. ICSE SEIP 2018. Automatic Testing in DevOps - Lorentz Workshop 29
  • 30. Repairnator How to Design a Program Repair Bot? Insights from the Repairnator Project. S. Urli, Z. Yu, L. Seinturier, M. Monperrus. ICSE SEIP 2018. 30
  • 31. Repairnator How to Design a Program Repair Bot? Insights from the Repairnator Project. S. Urli, Z. Yu, L. Seinturier, M. Monperrus. ICSE SEIP 2018. Automatic Testing in DevOps - Lorentz Workshop 31
  • 32. DSpot •Amplify existing unit test cases •Start from developers’ test cases •Automatically generate variants •Submit pull requests Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects. B. Danglot, O. Luis Vera-Pérez, B. Baudry, M. Monperrus. Submitted to EMSE. Automatic Testing in DevOps - Lorentz Workshop 32
  • 33. DSpot Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects. B. Danglot, O. Luis Vera-Pérez, B. Baudry, M. Monperrus. Submitted to EMSE. @Test public void html() { Attribute attr = new Attribute("key", "value &"); assertEquals("key="value &"", attr.html()); assertEquals(attr.html(), attr.toString());} Automatic Testing in DevOps - Lorentz Workshop 33
  • 34. DSpot Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects. B. Danglot, O. Luis Vera-Pérez, B. Baudry, M. Monperrus. Submitted to EMSE. @Test public void html() { Attribute attr = new Attribute("key", "value &"); assertEquals("key="value &"", attr.html()); assertEquals(attr.html(), attr.toString());} @Test public void html_add33() throws Exception { Attribute attr = new Attribute("key", "value &"); Assert.assertEquals("key="value &"", attr.html()); Assert.assertEquals("key="value &"", attr.toString()); Assert.assertEquals("key", attr.getKey()); Assert.assertEquals("value &", attr.getValue()); } Automatic Testing in DevOps - Lorentz Workshop 34
  • 35. DSpot Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects. B. Danglot, O. Luis Vera-Pérez, B. Baudry, M. Monperrus. Submitted to EMSE. Automatic Testing in DevOps - Lorentz Workshop 35
  • 36. DSpot Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects. B. Danglot, O. Luis Vera-Pérez, B. Baudry, M. Monperrus. Submitted to EMSE. Automatic Testing in DevOps - Lorentz Workshop 36
  • 37. Mutation at Google •Mutation testing assesses the validity of test cases •Inject bugs in code •Check that test cases detect the bugs •Traditional mutation does not scale •Google has developed a mutation approach for their PR-loop State of Mutation Testing at Google. G. Petrovic, M. Ivankovic. ICSE SEIP 2018. Automatic Testing in DevOps - Lorentz Workshop 37
  • 38. Mutation at Google State of Mutation Testing at Google. G. Petrovic, M. Ivankovic. ICSE SEIP 2018. Automatic Testing in DevOps - Lorentz Workshop 38
  • 39. Mutation at Google State of Mutation Testing at Google. G. Petrovic, M. Ivankovic. ICSE SEIP 2018. Automatic Testing in DevOps - Lorentz Workshop 39
  • 40. Mutation at Google State of Mutation Testing at Google. G. Petrovic, M. Ivankovic. ICSE SEIP 2018. 40
  • 41. Sapienz •Automatic test generation and repair •Black-box, system level •Deployed in the Facebook PR-loop •All tests, bugs and patches are reviewed by developers Automatic Testing in DevOps - Lorentz Workshop 41Deploying Search Based Software Engineering with Sapienz at Facebook. N. Alshahwan, X. Gao, M. Harman, Y. Jia, K. Mao, A. Mols, T. Tei, and I. Zorin. SSBSE 2018. https://code.fb.com/developer-tools/finding-and-fixing-software-bugs-automatically-with-sapfix-and-sapienz/
  • 42. Sapienz Automatic Testing in DevOps - Lorentz Workshop 42Deploying Search Based Software Engineering with Sapienz at Facebook. N. Alshahwan, X. Gao, M. Harman, Y. Jia, K. Mao, A. Mols, T. Tei, and I. Zorin. SSBSE 2018. https://code.fb.com/developer-tools/finding-and-fixing-software-bugs-automatically-with-sapfix-and-sapienz/
  • 43. Sapienz •In production since September 2017 •75% of bugs reported have been fixed •Sapfix deployed in August 2018 •Some automatic patches accepted Automatic Testing in DevOps - Lorentz Workshop 43Deploying Search Based Software Engineering with Sapienz at Facebook. N. Alshahwan, X. Gao, M. Harman, Y. Jia, K. Mao, A. Mols, T. Tei, and I. Zorin. SSBSE 2018. https://code.fb.com/developer-tools/finding-and-fixing-software-bugs-automatically-with-sapfix-and-sapienz/
  • 44. Automatic testing in Ops Automatic Testing in DevOps - Lorentz Workshop 44
  • 45. Crash analysis - Reproduction - Localization Online experiments - Chaos - A/B testing Testing in Ops •Test in production •Requires production •Industry-driven •Test in the feedback •Little research Automatic Testing in DevOps - Lorentz Workshop 45
  • 46. Online experiments •Software testing is all about experiments •Express expected behavior (oracle) •Run system to check actual vs. Expected (test case) •On the Ops side, one can perform experiments with the real system •Express hypothesis •Run experiments to check validity Automatic Testing in DevOps - Lorentz Workshop 46
  • 47. A/B testing Automatic Testing in DevOps - Lorentz Workshop 47
  • 49. A/B testing •Modular features, feature toggles •Graphical elements •Game levels •Sample and track a population of users •Precise metrics about the value of a feature Automatic Testing in DevOps - Lorentz Workshop 49
  • 50. Chaos engineering •Breaking things on purpose in order to build more resilient systems! https://principlesofchaos.org/ Automatic Testing in DevOps - Lorentz Workshop 50
  • 51. Principles of chaos engineering •Build a Hypothesis around Steady State Behavior •Vary Real-world Events •Run Experiments in Production •Automate Experiments to Run Continuously •Minimize Blast Radius https://principlesofchaos.org/ Automatic Testing in DevOps - Lorentz Workshop 51
  • 52. Netflix’s simian army •Induce failure regularly • ‘break’ production code to check the system’s ability to react • Chaos monkey: randomly terminates an instance in production • Chaos kong: take an entire region offline • Latency monkey: artificial delay in RESTful clients 52Automatic Testing in DevOps - Lorentz Workshop
  • 53. Chaos engineering •Growing adoption: SDN, CDN, JVM •Resilience of large distributed systems •Online perturbation •Monitor and report •Loosely coupled architectures •Macro-level health metric Automatic Testing in DevOps - Lorentz Workshop 53
  • 54. Crash reproduction 54 java.util.NoSuchElementException at org.xwiki.rendering.listener.chaining.EmptyBlockChainingListener.stopContainerBlock(EmptyBlockChainingListener.java:458) at org.xwiki.rendering.listener.chaining.EmptyBlockChainingListener.endFormat(EmptyBlockChainingListener.java:263) at org.xwiki.rendering.listener.chaining.AbstractChainingListener.endFormat(AbstractChainingListener.java:290) at org.xwiki.rendering.listener.chaining.BlockStateChainingListener.endFormat(BlockStateChainingListener.java:439) at org.xwiki.rendering.listener.chaining.AbstractChainingListener.endFormat(AbstractChainingListener.java:290) at org.xwiki.rendering.listener.CompositeListener.endFormat(CompositeListener.java:253) at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.flushFormat(DefaultXWikiGeneratorListener.java:325) at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.flushFormat(DefaultXWikiGeneratorListener.java:273) at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.flushFormat(DefaultXWikiGeneratorListener.java:267) at org.xwiki.rendering.internal.parser.wikimodel.DefaultXWikiGeneratorListener.onWord(DefaultXWikiGeneratorListener.java:906) at org.xwiki.rendering.wikimodel.impl.InternalWikiScannerContext.onWord(InternalWikiScannerContext.java:1147) at org.xwiki.rendering.wikimodel.impl.WikiScannerContext.onWord(WikiScannerContext.java:597) at org.xwiki.rendering.wikimodel.xhtml.impl.TagStack.flushStack(TagStack.java:204) at org.xwiki.rendering.wikimodel.xhtml.impl.TagStack.onCharacters(TagStack.java:227) at org.xwiki.rendering.wikimodel.xhtml.impl.XhtmlHandler.characters(XhtmlHandler.java:180) at org.xml.sax.helpers.XMLFilterImpl.characters(XMLFilterImpl.java:588) at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.sendCharacters(XHTMLWhitespaceXMLFilter.java:487) at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.sendCharacters(XHTMLWhitespaceXMLFilter.java:480) at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.flushContent(XHTMLWhitespaceXMLFilter.java:357) at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.flushContent(XHTMLWhitespaceXMLFilter.java:335) at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.endElement(XHTMLWhitespaceXMLFilter.java:200) at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570) at org.xwiki.rendering.wikimodel.xhtml.filter.AccumulationXMLFilter.endElement(AccumulationXMLFilter.java:86) at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570) at org.xwiki.rendering.wikimodel.xhtml.filter.DTDXMLFilter.endElement(DTDXMLFilter.java:86) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11NonValidatingConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XML11NonValidatingConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357) at org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter.parse(DefaultXMLFilter.java:58) at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357) at org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter.parse(DefaultXMLFilter.java:58) at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357) at org.xwiki.rendering.wikimodel.xhtml.filter.DefaultXMLFilter.parse(DefaultXMLFilter.java:58) at org.xwiki.rendering.wikimodel.xhtml.XhtmlParser.parse(XhtmlParser.java:132) Automatic Testing in DevOps - Lorentz Workshop
  • 55. Crash-reproducing Test Case 55 public void test0() throws Throwable { … SolrEntityReferenceResolver solrEntityReferenceResolver0 = new …(); EntityReferenceResolver entityReferenceResolver0 = … mock(…); solrDocument0.put("wiki", (Object) entityType0); Injector.inject(solrEntityReferenceResolver0, …); Injector.validateBean(solrEntityReferenceResolver0, …); … // Undeclared exception! solrEntityReferenceResolver0.resolve(solrDocument0, entityType0, objectArray0); } java.lang.ClassCastException: […] at org…..SolrEntityReferenceResolver.getWikiReference(....java:93) at org…..SolrEntityReferenceResolver.getEntityReference(….java:70) at org…..SolrEntityReferenceResolver.resolve(….java:63) Automatic Testing in DevOps - Lorentz Workshop
  • 56. Crash-Guided Genetic Algorithm • EvoCrash • Implemented on top of EvoSuite • Requires • Stack trace • Binaries • .jar files • Time budget • Set by the user 56 Initialize population Evaluate fitness Next generation Selection Crossover Mutation Reinsertion [fitness == 0 or budget exhausted] Automatic Testing in DevOps - Lorentz Workshop
  • 57. Challenges Automatic Testing in DevOps - Lorentz Workshop 57
  • 58. @Test testDecodeQueryString() { Map<String, String> p = newHashMap(); String uri = "something?test=value"; RestUtils.decodeQueryString (uri, uri.indexOf(’?’) + 1,p); assertThat(p.size(), equalTo(1)); assertThat(p.get("test"), equalTo("value")); } Flaky tests Does Refactoring of Test Smells Induce Fixing Flaky Tests? Fabio Palomba and Andy Zaidman. ICSME 2017. Automatic Testing in DevOps - Lorentz Workshop 58
  • 59. Complex builds How to Design a Program Repair Bot? Insights from the Repairnator Project. S. Urli, Z. Yu, L. Seinturier, M. Monperrus. ICSE SEIP 2018. Automatic Testing in DevOps - Lorentz Workshop 59
  • 60. Multi module projects •Many projects are composed of multiple modules 38 38 10 2 0 5 10 15 20 25 30 35 40 [1000, 50000) [50000,250000) [250000,1000000) >= 1000000 60
  • 61. Multi module projects 29 24 10 4 4 3 3 2 2 1 1 1 1 1 1 1 0 5 10 15 20 25 30 35 [0,10) [10,20) [20,30) [30,40) [40,50) [50,60) [60,70) [70,80) [80,90) [90,100) [100,110) [110,120) [120,130) [130,140) [140,150) [150,160) [160,170) [170,180) [180,190) [190,200) [200,210) [210,220) [220,230) [230,240) [240,250) [250,260) [260,270) [270,280) [280,290) [290,300) [300,310) [310,320) [320,330) [330,340) [340,350) [350,360) [360,370) [370,380) [380,390) [390,400) [400,410) [410,420) [420,430) Min 2 Mean 35 Median 16 Max 423 61
  • 62. Multi module projects 867 669 1126 328 41 25 19 3 1 0 200 400 600 800 1000 1200 0 1 [2,10) [10,20) [20,30) [30,40) [40,50) [50,60) [60,70) Min 0 Mean 4 Median 2 Max 67 62
  • 65. Ecosystems of dependencies •Only 1% of Maven Central •31877 artefacts •57227 dependencies Collected and visualized by Amine Benelallam and Cesar Soto Automatic Testing in DevOps - Lorentz Workshop 65
  • 66. Get Ops conditions •Record production traffic •Replay traffic •Shadow traffic Automatic Testing in DevOps - Lorentz Workshop 66
  • 67. Automatic Testing in DevOps - Lorentz Workshop 67
  • 68. Conclusion Automatic Testing in DevOps - Lorentz Workshop 68
  • 69. Crash analysis - Reproduction - Localization Online experiments - Chaos - A/B testing Automatic Testing in DevOps - Lorentz Workshop 69 Continuous Integration - Unit, integration testing - Coverage, mutation - Test generation and repair Test improvement - Test refactoring - Test amplification - Test fixing IDE - Linters - Completion
  • 70. Automatic testing in DevOps •Vibrant research and development topic •The PR loop is an pportunity for research •Incremental analyses and testing •Developer in the loop •Challenges •Going in the Ops •Build complexity Automatic Testing in DevOps - Lorentz Workshop 70
  • 71. Acknowledgements •Oscar Vera-Pérez, Benjamin Danglot, César Soto, Amine Benelalam, Nicolas Harrand, Martin Monperrus •https://stamp.ow2.org Automatic Testing in DevOps - Lorentz Workshop 71