SlideShare a Scribd company logo
1 of 149
Download to read offline
Tuesday, 22 April 14
Be#er	
 Ā code	
 Ā through	
 Ā making	
 Ā bugs
Seb	
 Ā Rose
Claysnow	
 Ā Limited
@sebrose
Tuesday, 22 April 14
Massive	
 Ā thanks	
 Ā to:
3
Henry	
 Ā Coles
pitest
Filip	
 Ā van	
 Ā Laenen
mutant
Tuesday, 22 April 14
How do you assure the quality of your test suite?
Tuesday, 22 April 14
Only employ coding gods
How do you assure the quality of your test suite?
Tuesday, 22 April 14
Only employ coding gods
TDD will protect us
How do you assure the quality of your test suite?
Tuesday, 22 April 14
Only employ coding gods
TDD will protect us
Peer review
How do you assure the quality of your test suite?
Tuesday, 22 April 14
Only employ coding gods
TDD will protect us
Peer review
QA will catch anything that we miss
How do you assure the quality of your test suite?
Tuesday, 22 April 14
Only employ coding gods
TDD will protect us
Peer review
QA will catch anything that we miss
Good code coverage
How do you assure the quality of your test suite?
Tuesday, 22 April 14
How do you assure the quality of your test suite?
Tuesday, 22 April 14
Code coverage?
How do you assure the quality of your test suite?
Tuesday, 22 April 14
Code coverage?
Line coverage?
How do you assure the quality of your test suite?
Tuesday, 22 April 14
Code coverage?
Line coverage?
Branch coverage?
How do you assure the quality of your test suite?
Tuesday, 22 April 14
Code coverage?
Line coverage?
Branch coverage?
Statement coverage?
How do you assure the quality of your test suite?
Tuesday, 22 April 14
Does good coverage guarantee that:
Tuesday, 22 April 14
ā€¢ I can safely refactor my tests?
Does good coverage guarantee that:
Tuesday, 22 April 14
ā€¢ I can safely refactor my tests?
ā€¢ I can trust a test suite I inherited?
Does good coverage guarantee that:
Tuesday, 22 April 14
ā€¢ I can safely refactor my tests?
ā€¢ I can trust a test suite I inherited?
ā€¢ My team are writing effective tests?
Does good coverage guarantee that:
Tuesday, 22 April 14
ā€¢ I can safely refactor my tests?
ā€¢ I can trust a test suite I inherited?
ā€¢ My team are writing effective tests?
ā€¢ I've retroļ¬tted enough tests to protect my legacy code?
Does good coverage guarantee that:
Tuesday, 22 April 14
ā€¢ I can safely refactor my tests?
ā€¢ I can trust a test suite I inherited?
ā€¢ My team are writing effective tests?
ā€¢ I've retroļ¬tted enough tests to protect my legacy code?
Does good coverage guarantee that:
NO, IT
DOESNā€™T
Tuesday, 22 April 14
Coverage tells us nothing about the quality of our tests
Tuesday, 22 April 14
Coverage tells us nothing about the quality of our tests
It tells us which statements have been run by our tests
Tuesday, 22 April 14
Coverage tells us nothing about the quality of our tests
It tells us which statements have NOT been tested
Tuesday, 22 April 14
Coverage tells us nothing about the quality of our tests
... but it is very useful for something else
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
Tuesday, 22 April 14
@Test
public void shouldStartWithEmptyCount() {
assertEquals(0,testee.currentCount());
}
@Test
public void shouldCountIntegersAboveTen() {
testee.count(11);
assertEquals(1,testee.currentCount());
}
	
@Test
public void shouldNotCountIntegersBelowTen() {
testee.count(9);
assertEquals(0,testee.currentCount());
}
Tuesday, 22 April 14
Lipton,ā€œFault diagnosis in computer programsā€,1971
ā€œIf we want to know if a test suite has
properly checked some code
deliberately introduce a bugā€
Tuesday, 22 April 14
The deliberate introduction of a bug by
changing the code under test
Mutation:
Tuesday, 22 April 14
A version of the code under test that has
had a single mutation
Mutant:
Tuesday, 22 April 14
Tuesday, 22 April 14
Mutation test:
Tuesday, 22 April 14
Run your test suite
Mutation test:
Tuesday, 22 April 14
Run your test suite
If any test fails, the mutant has been killed
Mutation test:
Tuesday, 22 April 14
Run your test suite
If any test fails, the mutant has been killed
If no test fails, the mutant has survived
Mutation test:
Tuesday, 22 April 14
Mutation testing:
Tuesday, 22 April 14
Generate lots of mutants
Mutation testing:
Tuesday, 22 April 14
Generate lots of mutants
Run each one through your test suite
Mutation testing:
Tuesday, 22 April 14
Generate lots of mutants
Run each one through your test suite
Record and interpret the results
Mutation testing:
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
if ( i > 10 ) {
Tuesday, 22 April 14
http://pitest.org
Demo time
Tuesday, 22 April 14
Mutation operators:
ā€¢ Conditionals Boundary Mutator
ā€¢ Negate Conditionals Mutator
ā€¢ Remove Conditionals Mutator
ā€¢ Math Mutator
ā€¢ Increments Mutator
ā€¢ Invert Negatives Mutator
ā€¢ Inline Constant Mutator
ā€¢ ReturnValues Mutator
ā€¢ Void Method Calls Mutator
ā€¢ NonVoid Method Calls Mutator
ā€¢ Constructor Calls Mutator
Tuesday, 22 April 14
ā€œGenerated mutants are similar to
real faultsā€
Andrews, Briand, Labiche, ICSE 2005
Tuesday, 22 April 14
ā€œIn practice, if the software contains a fault,
there will usually be a set of mutants that can
only be killed by a test case that also detects
that fault.ā€
Geist et. al.,ā€œEstimation and Enhancement of Real-time Software
Reliability through Mutation Analysis,ā€ 1992
Tuesday, 22 April 14
ā€œComplex faults are coupled to simple faults
in such a way that a test data set that detects
all simple faults in a program will detect most
complex faults.ā€
K.Wah,ā€œFault Coupling in Finite Bijective Functions,ā€ 1995
Tuesday, 22 April 14
Poor performance
Equivalent mutations
Why isnā€™t mutation testing widely used?
Tuesday, 22 April 14
How bad is performance?
Tuesday, 22 April 14
How bad is performance?
Joda Time, consider, let us
Tuesday, 22 April 14
Joda Time is a ...
Tuesday, 22 April 14
small library for dealing with dates and times
Joda Time is a ...
Tuesday, 22 April 14
small library for dealing with dates and times
68k lines of code
Joda Time is a ...
Tuesday, 22 April 14
small library for dealing with dates and times
68k lines of code
70k lines of test code
Joda Time is a ...
Tuesday, 22 April 14
small library for dealing with dates and times
68k lines of code
70k lines of test code
Takes about 10 seconds to compile
Joda Time is a ...
Tuesday, 22 April 14
small library for dealing with dates and times
68k lines of code
70k lines of test code
Takes about 10 seconds to compile
Takes about 16 seconds to run the unit tests
Joda Time is a ...
Tuesday, 22 April 14
Tuesday, 22 April 14
Letā€™s use 10 mutation operators
Tuesday, 22 April 14
Letā€™s use 10 mutation operators
assume about 10k mutations
Tuesday, 22 April 14
Letā€™s use 10 mutation operators
assume about 10k mutations
If it takes 1 second to compile each one
Tuesday, 22 April 14
Letā€™s use 10 mutation operators
assume about 10k mutations
If it takes 1 second to compile each one
2.5 hours to generate the mutants
Tuesday, 22 April 14
Letā€™s use 10 mutation operators
assume about 10k mutations
If it takes 1 second to compile each one
2.5 hours to generate the mutants
Run the test suite for each mutant
Tuesday, 22 April 14
Letā€™s use 10 mutation operators
assume about 10k mutations
If it takes 1 second to compile each one
2.5 hours to generate the mutants
Run the test suite for each mutant
10k x 16 seconds = 44.5 hours
Tuesday, 22 April 14
pitest manipulates the byte code directly
10k mutants generated < 1 second
Donā€™t compile!
Tuesday, 22 April 14
Run fewer tests!
Tuesday, 22 April 14
Stop when a test fails
Run fewer tests!
Tuesday, 22 April 14
Stop when a test fails
can easily halve the run time
Run fewer tests!
Tuesday, 22 April 14
Stop when a test fails
can easily halve the run time
Choose your tests carefully
Run fewer tests!
Tuesday, 22 April 14
Stop when a test fails
can easily halve the run time
Choose your tests carefully
not every test can kill every mutant
Run fewer tests!
Tuesday, 22 April 14
Stop when a test fails
can easily halve the run time
Choose your tests carefully
not every test can kill every mutant
Parallelise the test runner
Run fewer tests!
Tuesday, 22 April 14
Stop when a test fails
can easily halve the run time
Choose your tests carefully
not every test can kill every mutant
Parallelise the test runner
your tests are unit tests, right?
Run fewer tests!
Tuesday, 22 April 14
Choosing your tests well is critical
Tuesday, 22 April 14
Each mutant can only ever be killed
Choosing your tests well is critical
Tuesday, 22 April 14
Each mutant can only ever be killed
by a subset of the tests
Choosing your tests well is critical
Tuesday, 22 April 14
Each mutant can only ever be killed
by a subset of the tests
Every other test run is waste
Choosing your tests well is critical
Tuesday, 22 April 14
How can we know which tests
might kill
any given mutant?
Tuesday, 22 April 14
How can we know which tests
might kill
any given mutant?
Naming conventions?
Tuesday, 22 April 14
How can we know which tests
might kill
any given mutant?
Naming conventions?
Static analysis?
Tuesday, 22 April 14
How can we know which tests
might kill
any given mutant?
Naming conventions?
Static analysis?
COVERAGE DATA!
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
shouldCountIntegersAboveTen
shouldNotCountIntegersBelowTen
shouldCountIntegersOfExactlyTen
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
shouldCountIntegersAboveTen
shouldNotCountIntegersBelowTen
shouldCountIntegersOfExactlyTen
shouldCountIntegersAboveTen
shouldCountIntegersOfExactlyTen
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
shouldCountIntegersAboveTen
shouldNotCountIntegersBelowTen
shouldCountIntegersOfExactlyTen
shouldCountIntegersAboveTen
shouldCountIntegersOfExactlyTen
not covered by any test
Tuesday, 22 April 14
public class CountingClass {
private int count;
public void count(int i) {
if ( i >= 10 ) {
count++;
}
}
public void reset() {
count = 0;
}
}
shouldCountIntegersAboveTen
shouldNotCountIntegersBelowTen
shouldCountIntegersOfExactlyTen
shouldCountIntegersAboveTen
shouldCountIntegersOfExactlyTen
not covered by any test
shouldStartWithEmptyCount does
not cover any of the lines shown
Tuesday, 22 April 14
Joda Time on my machine, with 2 threads:
- Timings
> scan classpath : < 1 second
> coverage and dependency analysis : 59 seconds
> build mutation tests : 1 seconds
> run mutation analysis : 8 minutes and 21 seconds
> Total : 9 minutes and 22 seconds
- Statistics
>> Generated 9922 mutations Killed 7833 (79%)
>> Ran 117579 tests (11.85 tests per mutation)
Tuesday, 22 April 14
Why only 79% killed?
Tuesday, 22 April 14
Missing test cases
Why only 79% killed?
Tuesday, 22 April 14
Missing test cases
Time outs
Why only 79% killed?
Tuesday, 22 April 14
Missing test cases
Time outs
Equivalent mutations
Why only 79% killed?
Tuesday, 22 April 14
public void someLogic(int i) {
if (i <= 100) {
throw new IllegalArgumentException();
}
if (i >= 100) {
doSomething();
}
}
Equivalent mutant:
Tuesday, 22 April 14
public void someLogic(int i) {
if (i <= 100) {
throw new IllegalArgumentException();
}
if (i >= 100) {
doSomething();
}
}
if (i > 100) {
Equivalent mutant:
Tuesday, 22 April 14
public void someLogic(int i) {
if (i <= 100) {
throw new IllegalArgumentException();
}
if (i >= 100) {
doSomething();
}
}
if (i > 100) {
i can never be 100 here
Equivalent mutant:
Tuesday, 22 April 14
http://pitest.org
Demo time
Tuesday, 22 April 14
Maybe we should have written:
public void someLogic(int i) {
if (i <= 100) {
throw new IllegalArgumentException();
}
doSomething();
}
Tuesday, 22 April 14
Some causes of equivalence are:
Tuesday, 22 April 14
Dead/useless code
Some causes of equivalence are:
Tuesday, 22 April 14
Dead/useless code
Non-functional modiļ¬cations
Some causes of equivalence are:
Tuesday, 22 April 14
Dead/useless code
Non-functional modiļ¬cations
Unsatisļ¬able guards
Some causes of equivalence are:
Tuesday, 22 April 14
Dead/useless code
Non-functional modiļ¬cations
Unsatisļ¬able guards
Internal state
Some causes of equivalence are:
Tuesday, 22 April 14
Dead/useless code
Non-functional modiļ¬cations
Unsatisļ¬able guards
Internal state
Some causes of equivalence are:
This can help us improve our code
Tuesday, 22 April 14
Mutants that survive need to be
checked manually
to determine if they are equivalent
Tuesday, 22 April 14
Is this a show-stopper?
Tuesday, 22 April 14
Is this a show-stopper?
Not all that common in practice
Tuesday, 22 April 14
Is this a show-stopper?
Not all that common in practice
TDD helps prevent equivalents
Tuesday, 22 April 14
Is this a show-stopper?
Not all that common in practice
TDD helps prevent equivalents
Tolerate a few survivors
Tuesday, 22 April 14
What about really large code bases?
Tuesday, 22 April 14
What about really large code bases?
Mutation testing can take a long time:
Tuesday, 22 April 14
What about really large code bases?
Mutation testing can take a long time:
Use fewer mutants
Tuesday, 22 April 14
What about really large code bases?
Mutation testing can take a long time:
Use fewer mutants
Filter the candidates
Tuesday, 22 April 14
What about really large code bases?
Mutation testing can take a long time:
Use fewer mutants
Filter the candidates
Run infrequently
Tuesday, 22 April 14
Get the developers to mutation test
Tuesday, 22 April 14
Get the developers to mutation test
Only on code they are working on
Tuesday, 22 April 14
Get the developers to mutation test
Only on code they are working on
Faster feedback
Tuesday, 22 April 14
Get the developers to mutation test
Only on code they are working on
Faster feedback
Improves design of the code
Tuesday, 22 April 14
Get your CI server to run the mutation test
Tuesday, 22 April 14
Get your CI server to run the mutation test
Over whole codebase if quick enough
Tuesday, 22 April 14
Get your CI server to run the mutation test
Over whole codebase if quick enough
Use SCM integration to identify subset
Tuesday, 22 April 14
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Use mutation testing from day 1
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Use mutation testing from day 1
Start on a small code base
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Use mutation testing from day 1
Start on a small code base
Keep number of unit tests per class low
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Use mutation testing from day 1
Start on a small code base
Keep number of unit tests per class low
Have small classes
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Use mutation testing from day 1
Start on a small code base
Keep number of unit tests per class low
Have small classes
Select a good tool:
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Use mutation testing from day 1
Start on a small code base
Keep number of unit tests per class low
Have small classes
Select a good tool:
Conļ¬gurable
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Use mutation testing from day 1
Start on a small code base
Keep number of unit tests per class low
Have small classes
Select a good tool:
Conļ¬gurable
Flexible
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Use mutation testing from day 1
Start on a small code base
Keep number of unit tests per class low
Have small classes
Select a good tool:
Conļ¬gurable
Flexible
Identiļ¬es surviving the mutant
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Believe the tool
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Believe the tool
Fix the problem
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Believe the tool
Fix the problem
Don't turn mutation testing off
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Believe the tool
Fix the problem
Don't turn mutation testing off
Less code
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Believe the tool
Fix the problem
Don't turn mutation testing off
Less code
More unit tests
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Believe the tool
Fix the problem
Don't turn mutation testing off
Less code
More unit tests
More intelligent unit tests
Experiences and recommendations
Filip van Laenen
Tuesday, 22 April 14
Available tools
http://en.wikipedia.org/wiki/
Mutation_testing#External_links
Tuesday, 22 April 14
Ruby: Heckle, Mutant
Available tools
http://en.wikipedia.org/wiki/
Mutation_testing#External_links
Tuesday, 22 April 14
Ruby: Heckle, Mutant
Java: pitest, Jumble, Jester
Available tools
http://en.wikipedia.org/wiki/
Mutation_testing#External_links
Tuesday, 22 April 14
Ruby: Heckle, Mutant
Java: pitest, Jumble, Jester
C#: Nester, NinjaTurtle, Cream
Available tools
http://en.wikipedia.org/wiki/
Mutation_testing#External_links
Tuesday, 22 April 14
Ruby: Heckle, Mutant
Java: pitest, Jumble, Jester
C#: Nester, NinjaTurtle, Cream
Python: Pester
Available tools
http://en.wikipedia.org/wiki/
Mutation_testing#External_links
Tuesday, 22 April 14
Open source
Works with Java 5, 6, 7
Works with all mocking frameworks including PowerMock
Integrates with Maven,Ant, Gradle & SBT
Plugins for Eclipse & IntelliJ
Plugins for Jenkins & SonarQube
Releases every 3 months or so since 2011
Tuesday, 22 April 14
ā€¢ The Ladders - NewYork
ā€¢ Sky - Livingston
ā€¢ Insurance companies
ā€¢ Investment banks
ā€¢ Biotech companies
ā€¢ Norway's e-voting system
Tuesday, 22 April 14
ā€¢ The Ladders - NewYork
ā€¢ Sky - Livingston
ā€¢ Insurance companies
ā€¢ Investment banks
ā€¢ Biotech companies
ā€¢ Norway's e-voting system
Tuesday, 22 April 14
ā€¢ The Ladders - NewYork
ā€¢ Sky - Livingston
ā€¢ Insurance companies
ā€¢ Investment banks
ā€¢ Biotech companies
ā€¢ Norway's e-voting system
Tuesday, 22 April 14
-JVM
Seb Rose,
Tuesday, 22 April 14
-JVM
Seb Rose,
Available 2014
(hopefully)
Tuesday, 22 April 14
Seb	
 Ā Rose
Twi#er:	
 Ā 	
 Ā  @sebrose
Blog:	
 Ā 	
 Ā  	
 Ā  www.claysnow.co.uk
E-Ā­ā€mail:	
 Ā  	
 Ā  seb@claysnow.co.uk
Tuesday, 22 April 14

More Related Content

Similar to Better code through making bugs

How will I Survive a DevOps Transformation?
How will I Survive a DevOps Transformation?How will I Survive a DevOps Transformation?
How will I Survive a DevOps Transformation?Corecom Consulting
Ā 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven DevelopmentPablo Villar
Ā 
When Tdd Goes Awry (IAD 2013)
When Tdd Goes Awry (IAD 2013)When Tdd Goes Awry (IAD 2013)
When Tdd Goes Awry (IAD 2013)Uberto Barbini
Ā 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development Amir Assad
Ā 
Things Could Get Worse: Ideas About Regression Testing
Things Could Get Worse: Ideas About Regression TestingThings Could Get Worse: Ideas About Regression Testing
Things Could Get Worse: Ideas About Regression TestingTechWell
Ā 
Unit Testing
Unit TestingUnit Testing
Unit TestingDavid Rogers
Ā 
Quality comes free with open source testing tools
Quality comes free with open source testing toolsQuality comes free with open source testing tools
Quality comes free with open source testing toolsSteven Mak
Ā 
Great! another bug
Great! another bugGreat! another bug
Great! another bugAgileCoach.net
Ā 
Agile latvia evening_unit_testing_in_practice
Agile latvia evening_unit_testing_in_practiceAgile latvia evening_unit_testing_in_practice
Agile latvia evening_unit_testing_in_practicedenis Udod
Ā 
Building tools to free up exploratory testers - appium conference talk
Building tools to free up exploratory testers - appium conference talkBuilding tools to free up exploratory testers - appium conference talk
Building tools to free up exploratory testers - appium conference talkPradeep Soundararajan
Ā 
Testing for everyone agile yorkshire
Testing for everyone agile yorkshireTesting for everyone agile yorkshire
Testing for everyone agile yorkshireAdy Stokes
Ā 
TDD and Getting Paid
TDD and Getting PaidTDD and Getting Paid
TDD and Getting PaidRowan Merewood
Ā 
Unit Testing Your Application
Unit Testing Your ApplicationUnit Testing Your Application
Unit Testing Your ApplicationPaladin Web Services
Ā 
lessons from testing
lessons from testinglessons from testing
lessons from testingJon Jagger
Ā 
Principles Before Practices: Transform Your Testing by Understanding Key Conc...
Principles Before Practices: Transform Your Testing by Understanding Key Conc...Principles Before Practices: Transform Your Testing by Understanding Key Conc...
Principles Before Practices: Transform Your Testing by Understanding Key Conc...TechWell
Ā 
Pride and Prejudice and Software Testing
Pride and Prejudice and Software TestingPride and Prejudice and Software Testing
Pride and Prejudice and Software TestingConor O'Donnell
Ā 
Bug debug keynote - Present problems and future solutions
Bug debug keynote - Present problems and future solutionsBug debug keynote - Present problems and future solutions
Bug debug keynote - Present problems and future solutionsRIA RUI Society
Ā 
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonGetting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonCefalo
Ā 

Similar to Better code through making bugs (20)

How will I Survive a DevOps Transformation?
How will I Survive a DevOps Transformation?How will I Survive a DevOps Transformation?
How will I Survive a DevOps Transformation?
Ā 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven Development
Ā 
Test Infected
Test InfectedTest Infected
Test Infected
Ā 
When Tdd Goes Awry (IAD 2013)
When Tdd Goes Awry (IAD 2013)When Tdd Goes Awry (IAD 2013)
When Tdd Goes Awry (IAD 2013)
Ā 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development
Ā 
Things Could Get Worse: Ideas About Regression Testing
Things Could Get Worse: Ideas About Regression TestingThings Could Get Worse: Ideas About Regression Testing
Things Could Get Worse: Ideas About Regression Testing
Ā 
Mutation testing
Mutation testingMutation testing
Mutation testing
Ā 
Unit Testing
Unit TestingUnit Testing
Unit Testing
Ā 
Quality comes free with open source testing tools
Quality comes free with open source testing toolsQuality comes free with open source testing tools
Quality comes free with open source testing tools
Ā 
Great! another bug
Great! another bugGreat! another bug
Great! another bug
Ā 
Agile latvia evening_unit_testing_in_practice
Agile latvia evening_unit_testing_in_practiceAgile latvia evening_unit_testing_in_practice
Agile latvia evening_unit_testing_in_practice
Ā 
Building tools to free up exploratory testers - appium conference talk
Building tools to free up exploratory testers - appium conference talkBuilding tools to free up exploratory testers - appium conference talk
Building tools to free up exploratory testers - appium conference talk
Ā 
Testing for everyone agile yorkshire
Testing for everyone agile yorkshireTesting for everyone agile yorkshire
Testing for everyone agile yorkshire
Ā 
TDD and Getting Paid
TDD and Getting PaidTDD and Getting Paid
TDD and Getting Paid
Ā 
Unit Testing Your Application
Unit Testing Your ApplicationUnit Testing Your Application
Unit Testing Your Application
Ā 
lessons from testing
lessons from testinglessons from testing
lessons from testing
Ā 
Principles Before Practices: Transform Your Testing by Understanding Key Conc...
Principles Before Practices: Transform Your Testing by Understanding Key Conc...Principles Before Practices: Transform Your Testing by Understanding Key Conc...
Principles Before Practices: Transform Your Testing by Understanding Key Conc...
Ā 
Pride and Prejudice and Software Testing
Pride and Prejudice and Software TestingPride and Prejudice and Software Testing
Pride and Prejudice and Software Testing
Ā 
Bug debug keynote - Present problems and future solutions
Bug debug keynote - Present problems and future solutionsBug debug keynote - Present problems and future solutions
Bug debug keynote - Present problems and future solutions
Ā 
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonGetting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Ā 

More from Seb Rose

Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSeb Rose
Ā 
Micro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsMicro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsSeb Rose
Ā 
DevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfDevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfSeb Rose
Ā 
Contract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfContract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfSeb Rose
Ā 
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfExample mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfSeb Rose
Ā 
Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Seb Rose
Ā 
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021Seb Rose
Ā 
A brief history of requirements - Unicom 2022
A brief history of requirements  - Unicom 2022A brief history of requirements  - Unicom 2022
A brief history of requirements - Unicom 2022Seb Rose
Ā 
Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022Seb Rose
Ā 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Seb Rose
Ā 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021Seb Rose
Ā 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021Seb Rose
Ā 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021Seb Rose
Ā 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021Seb Rose
Ā 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Seb Rose
Ā 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021Seb Rose
Ā 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020Seb Rose
Ā 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019Seb Rose
Ā 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019Seb Rose
Ā 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Seb Rose
Ā 

More from Seb Rose (20)

Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdf
Ā 
Micro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsMicro-service delivery - without the pitfalls
Micro-service delivery - without the pitfalls
Ā 
DevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfDevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdf
Ā 
Contract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfContract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdf
Ā 
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfExample mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
Ā 
Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)
Ā 
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
Ā 
A brief history of requirements - Unicom 2022
A brief history of requirements  - Unicom 2022A brief history of requirements  - Unicom 2022
A brief history of requirements - Unicom 2022
Ā 
Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022
Ā 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022
Ā 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
Ā 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
Ā 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021
Ā 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021
Ā 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020
Ā 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021
Ā 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020
Ā 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019
Ā 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
Ā 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Ā 

Recently uploaded

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
Ā 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
Ā 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜RTylerCroy
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024The Digital Insurer
Ā 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
Ā 
Scaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationScaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationRadu Cotescu
Ā 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
Ā 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
Ā 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĆŗjo
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Ā 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
Ā 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
Ā 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Ā 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Ā 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024
Ā 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Ā 
Scaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationScaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organization
Ā 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Ā 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Ā 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Ā 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Ā 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Ā 

Better code through making bugs

  • 2. Be#er Ā code Ā through Ā making Ā bugs Seb Ā Rose Claysnow Ā Limited @sebrose Tuesday, 22 April 14
  • 3. Massive Ā thanks Ā to: 3 Henry Ā Coles pitest Filip Ā van Ā Laenen mutant Tuesday, 22 April 14
  • 4. How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 5. Only employ coding gods How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 6. Only employ coding gods TDD will protect us How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 7. Only employ coding gods TDD will protect us Peer review How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 8. Only employ coding gods TDD will protect us Peer review QA will catch anything that we miss How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 9. Only employ coding gods TDD will protect us Peer review QA will catch anything that we miss Good code coverage How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 10. How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 11. Code coverage? How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 12. Code coverage? Line coverage? How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 13. Code coverage? Line coverage? Branch coverage? How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 14. Code coverage? Line coverage? Branch coverage? Statement coverage? How do you assure the quality of your test suite? Tuesday, 22 April 14
  • 15. Does good coverage guarantee that: Tuesday, 22 April 14
  • 16. ā€¢ I can safely refactor my tests? Does good coverage guarantee that: Tuesday, 22 April 14
  • 17. ā€¢ I can safely refactor my tests? ā€¢ I can trust a test suite I inherited? Does good coverage guarantee that: Tuesday, 22 April 14
  • 18. ā€¢ I can safely refactor my tests? ā€¢ I can trust a test suite I inherited? ā€¢ My team are writing effective tests? Does good coverage guarantee that: Tuesday, 22 April 14
  • 19. ā€¢ I can safely refactor my tests? ā€¢ I can trust a test suite I inherited? ā€¢ My team are writing effective tests? ā€¢ I've retroļ¬tted enough tests to protect my legacy code? Does good coverage guarantee that: Tuesday, 22 April 14
  • 20. ā€¢ I can safely refactor my tests? ā€¢ I can trust a test suite I inherited? ā€¢ My team are writing effective tests? ā€¢ I've retroļ¬tted enough tests to protect my legacy code? Does good coverage guarantee that: NO, IT DOESNā€™T Tuesday, 22 April 14
  • 21. Coverage tells us nothing about the quality of our tests Tuesday, 22 April 14
  • 22. Coverage tells us nothing about the quality of our tests It tells us which statements have been run by our tests Tuesday, 22 April 14
  • 23. Coverage tells us nothing about the quality of our tests It tells us which statements have NOT been tested Tuesday, 22 April 14
  • 24. Coverage tells us nothing about the quality of our tests ... but it is very useful for something else Tuesday, 22 April 14
  • 25. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } Tuesday, 22 April 14
  • 26. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } Tuesday, 22 April 14
  • 27. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } Tuesday, 22 April 14
  • 28. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } Tuesday, 22 April 14
  • 29. @Test public void shouldStartWithEmptyCount() { assertEquals(0,testee.currentCount()); } @Test public void shouldCountIntegersAboveTen() { testee.count(11); assertEquals(1,testee.currentCount()); } @Test public void shouldNotCountIntegersBelowTen() { testee.count(9); assertEquals(0,testee.currentCount()); } Tuesday, 22 April 14
  • 30. Lipton,ā€œFault diagnosis in computer programsā€,1971 ā€œIf we want to know if a test suite has properly checked some code deliberately introduce a bugā€ Tuesday, 22 April 14
  • 31. The deliberate introduction of a bug by changing the code under test Mutation: Tuesday, 22 April 14
  • 32. A version of the code under test that has had a single mutation Mutant: Tuesday, 22 April 14
  • 35. Run your test suite Mutation test: Tuesday, 22 April 14
  • 36. Run your test suite If any test fails, the mutant has been killed Mutation test: Tuesday, 22 April 14
  • 37. Run your test suite If any test fails, the mutant has been killed If no test fails, the mutant has survived Mutation test: Tuesday, 22 April 14
  • 39. Generate lots of mutants Mutation testing: Tuesday, 22 April 14
  • 40. Generate lots of mutants Run each one through your test suite Mutation testing: Tuesday, 22 April 14
  • 41. Generate lots of mutants Run each one through your test suite Record and interpret the results Mutation testing: Tuesday, 22 April 14
  • 42. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } Tuesday, 22 April 14
  • 43. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } if ( i > 10 ) { Tuesday, 22 April 14
  • 45. Mutation operators: ā€¢ Conditionals Boundary Mutator ā€¢ Negate Conditionals Mutator ā€¢ Remove Conditionals Mutator ā€¢ Math Mutator ā€¢ Increments Mutator ā€¢ Invert Negatives Mutator ā€¢ Inline Constant Mutator ā€¢ ReturnValues Mutator ā€¢ Void Method Calls Mutator ā€¢ NonVoid Method Calls Mutator ā€¢ Constructor Calls Mutator Tuesday, 22 April 14
  • 46. ā€œGenerated mutants are similar to real faultsā€ Andrews, Briand, Labiche, ICSE 2005 Tuesday, 22 April 14
  • 47. ā€œIn practice, if the software contains a fault, there will usually be a set of mutants that can only be killed by a test case that also detects that fault.ā€ Geist et. al.,ā€œEstimation and Enhancement of Real-time Software Reliability through Mutation Analysis,ā€ 1992 Tuesday, 22 April 14
  • 48. ā€œComplex faults are coupled to simple faults in such a way that a test data set that detects all simple faults in a program will detect most complex faults.ā€ K.Wah,ā€œFault Coupling in Finite Bijective Functions,ā€ 1995 Tuesday, 22 April 14
  • 49. Poor performance Equivalent mutations Why isnā€™t mutation testing widely used? Tuesday, 22 April 14
  • 50. How bad is performance? Tuesday, 22 April 14
  • 51. How bad is performance? Joda Time, consider, let us Tuesday, 22 April 14
  • 52. Joda Time is a ... Tuesday, 22 April 14
  • 53. small library for dealing with dates and times Joda Time is a ... Tuesday, 22 April 14
  • 54. small library for dealing with dates and times 68k lines of code Joda Time is a ... Tuesday, 22 April 14
  • 55. small library for dealing with dates and times 68k lines of code 70k lines of test code Joda Time is a ... Tuesday, 22 April 14
  • 56. small library for dealing with dates and times 68k lines of code 70k lines of test code Takes about 10 seconds to compile Joda Time is a ... Tuesday, 22 April 14
  • 57. small library for dealing with dates and times 68k lines of code 70k lines of test code Takes about 10 seconds to compile Takes about 16 seconds to run the unit tests Joda Time is a ... Tuesday, 22 April 14
  • 59. Letā€™s use 10 mutation operators Tuesday, 22 April 14
  • 60. Letā€™s use 10 mutation operators assume about 10k mutations Tuesday, 22 April 14
  • 61. Letā€™s use 10 mutation operators assume about 10k mutations If it takes 1 second to compile each one Tuesday, 22 April 14
  • 62. Letā€™s use 10 mutation operators assume about 10k mutations If it takes 1 second to compile each one 2.5 hours to generate the mutants Tuesday, 22 April 14
  • 63. Letā€™s use 10 mutation operators assume about 10k mutations If it takes 1 second to compile each one 2.5 hours to generate the mutants Run the test suite for each mutant Tuesday, 22 April 14
  • 64. Letā€™s use 10 mutation operators assume about 10k mutations If it takes 1 second to compile each one 2.5 hours to generate the mutants Run the test suite for each mutant 10k x 16 seconds = 44.5 hours Tuesday, 22 April 14
  • 65. pitest manipulates the byte code directly 10k mutants generated < 1 second Donā€™t compile! Tuesday, 22 April 14
  • 67. Stop when a test fails Run fewer tests! Tuesday, 22 April 14
  • 68. Stop when a test fails can easily halve the run time Run fewer tests! Tuesday, 22 April 14
  • 69. Stop when a test fails can easily halve the run time Choose your tests carefully Run fewer tests! Tuesday, 22 April 14
  • 70. Stop when a test fails can easily halve the run time Choose your tests carefully not every test can kill every mutant Run fewer tests! Tuesday, 22 April 14
  • 71. Stop when a test fails can easily halve the run time Choose your tests carefully not every test can kill every mutant Parallelise the test runner Run fewer tests! Tuesday, 22 April 14
  • 72. Stop when a test fails can easily halve the run time Choose your tests carefully not every test can kill every mutant Parallelise the test runner your tests are unit tests, right? Run fewer tests! Tuesday, 22 April 14
  • 73. Choosing your tests well is critical Tuesday, 22 April 14
  • 74. Each mutant can only ever be killed Choosing your tests well is critical Tuesday, 22 April 14
  • 75. Each mutant can only ever be killed by a subset of the tests Choosing your tests well is critical Tuesday, 22 April 14
  • 76. Each mutant can only ever be killed by a subset of the tests Every other test run is waste Choosing your tests well is critical Tuesday, 22 April 14
  • 77. How can we know which tests might kill any given mutant? Tuesday, 22 April 14
  • 78. How can we know which tests might kill any given mutant? Naming conventions? Tuesday, 22 April 14
  • 79. How can we know which tests might kill any given mutant? Naming conventions? Static analysis? Tuesday, 22 April 14
  • 80. How can we know which tests might kill any given mutant? Naming conventions? Static analysis? COVERAGE DATA! Tuesday, 22 April 14
  • 81. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } Tuesday, 22 April 14
  • 82. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } Tuesday, 22 April 14
  • 83. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } Tuesday, 22 April 14
  • 84. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } Tuesday, 22 April 14
  • 85. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } shouldCountIntegersAboveTen shouldNotCountIntegersBelowTen shouldCountIntegersOfExactlyTen Tuesday, 22 April 14
  • 86. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } shouldCountIntegersAboveTen shouldNotCountIntegersBelowTen shouldCountIntegersOfExactlyTen shouldCountIntegersAboveTen shouldCountIntegersOfExactlyTen Tuesday, 22 April 14
  • 87. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } shouldCountIntegersAboveTen shouldNotCountIntegersBelowTen shouldCountIntegersOfExactlyTen shouldCountIntegersAboveTen shouldCountIntegersOfExactlyTen not covered by any test Tuesday, 22 April 14
  • 88. public class CountingClass { private int count; public void count(int i) { if ( i >= 10 ) { count++; } } public void reset() { count = 0; } } shouldCountIntegersAboveTen shouldNotCountIntegersBelowTen shouldCountIntegersOfExactlyTen shouldCountIntegersAboveTen shouldCountIntegersOfExactlyTen not covered by any test shouldStartWithEmptyCount does not cover any of the lines shown Tuesday, 22 April 14
  • 89. Joda Time on my machine, with 2 threads: - Timings > scan classpath : < 1 second > coverage and dependency analysis : 59 seconds > build mutation tests : 1 seconds > run mutation analysis : 8 minutes and 21 seconds > Total : 9 minutes and 22 seconds - Statistics >> Generated 9922 mutations Killed 7833 (79%) >> Ran 117579 tests (11.85 tests per mutation) Tuesday, 22 April 14
  • 90. Why only 79% killed? Tuesday, 22 April 14
  • 91. Missing test cases Why only 79% killed? Tuesday, 22 April 14
  • 92. Missing test cases Time outs Why only 79% killed? Tuesday, 22 April 14
  • 93. Missing test cases Time outs Equivalent mutations Why only 79% killed? Tuesday, 22 April 14
  • 94. public void someLogic(int i) { if (i <= 100) { throw new IllegalArgumentException(); } if (i >= 100) { doSomething(); } } Equivalent mutant: Tuesday, 22 April 14
  • 95. public void someLogic(int i) { if (i <= 100) { throw new IllegalArgumentException(); } if (i >= 100) { doSomething(); } } if (i > 100) { Equivalent mutant: Tuesday, 22 April 14
  • 96. public void someLogic(int i) { if (i <= 100) { throw new IllegalArgumentException(); } if (i >= 100) { doSomething(); } } if (i > 100) { i can never be 100 here Equivalent mutant: Tuesday, 22 April 14
  • 98. Maybe we should have written: public void someLogic(int i) { if (i <= 100) { throw new IllegalArgumentException(); } doSomething(); } Tuesday, 22 April 14
  • 99. Some causes of equivalence are: Tuesday, 22 April 14
  • 100. Dead/useless code Some causes of equivalence are: Tuesday, 22 April 14
  • 101. Dead/useless code Non-functional modiļ¬cations Some causes of equivalence are: Tuesday, 22 April 14
  • 102. Dead/useless code Non-functional modiļ¬cations Unsatisļ¬able guards Some causes of equivalence are: Tuesday, 22 April 14
  • 103. Dead/useless code Non-functional modiļ¬cations Unsatisļ¬able guards Internal state Some causes of equivalence are: Tuesday, 22 April 14
  • 104. Dead/useless code Non-functional modiļ¬cations Unsatisļ¬able guards Internal state Some causes of equivalence are: This can help us improve our code Tuesday, 22 April 14
  • 105. Mutants that survive need to be checked manually to determine if they are equivalent Tuesday, 22 April 14
  • 106. Is this a show-stopper? Tuesday, 22 April 14
  • 107. Is this a show-stopper? Not all that common in practice Tuesday, 22 April 14
  • 108. Is this a show-stopper? Not all that common in practice TDD helps prevent equivalents Tuesday, 22 April 14
  • 109. Is this a show-stopper? Not all that common in practice TDD helps prevent equivalents Tolerate a few survivors Tuesday, 22 April 14
  • 110. What about really large code bases? Tuesday, 22 April 14
  • 111. What about really large code bases? Mutation testing can take a long time: Tuesday, 22 April 14
  • 112. What about really large code bases? Mutation testing can take a long time: Use fewer mutants Tuesday, 22 April 14
  • 113. What about really large code bases? Mutation testing can take a long time: Use fewer mutants Filter the candidates Tuesday, 22 April 14
  • 114. What about really large code bases? Mutation testing can take a long time: Use fewer mutants Filter the candidates Run infrequently Tuesday, 22 April 14
  • 115. Get the developers to mutation test Tuesday, 22 April 14
  • 116. Get the developers to mutation test Only on code they are working on Tuesday, 22 April 14
  • 117. Get the developers to mutation test Only on code they are working on Faster feedback Tuesday, 22 April 14
  • 118. Get the developers to mutation test Only on code they are working on Faster feedback Improves design of the code Tuesday, 22 April 14
  • 119. Get your CI server to run the mutation test Tuesday, 22 April 14
  • 120. Get your CI server to run the mutation test Over whole codebase if quick enough Tuesday, 22 April 14
  • 121. Get your CI server to run the mutation test Over whole codebase if quick enough Use SCM integration to identify subset Tuesday, 22 April 14
  • 122. Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 123. Use mutation testing from day 1 Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 124. Use mutation testing from day 1 Start on a small code base Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 125. Use mutation testing from day 1 Start on a small code base Keep number of unit tests per class low Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 126. Use mutation testing from day 1 Start on a small code base Keep number of unit tests per class low Have small classes Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 127. Use mutation testing from day 1 Start on a small code base Keep number of unit tests per class low Have small classes Select a good tool: Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 128. Use mutation testing from day 1 Start on a small code base Keep number of unit tests per class low Have small classes Select a good tool: Conļ¬gurable Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 129. Use mutation testing from day 1 Start on a small code base Keep number of unit tests per class low Have small classes Select a good tool: Conļ¬gurable Flexible Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 130. Use mutation testing from day 1 Start on a small code base Keep number of unit tests per class low Have small classes Select a good tool: Conļ¬gurable Flexible Identiļ¬es surviving the mutant Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 131. Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 132. Believe the tool Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 133. Believe the tool Fix the problem Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 134. Believe the tool Fix the problem Don't turn mutation testing off Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 135. Believe the tool Fix the problem Don't turn mutation testing off Less code Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 136. Believe the tool Fix the problem Don't turn mutation testing off Less code More unit tests Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 137. Believe the tool Fix the problem Don't turn mutation testing off Less code More unit tests More intelligent unit tests Experiences and recommendations Filip van Laenen Tuesday, 22 April 14
  • 139. Ruby: Heckle, Mutant Available tools http://en.wikipedia.org/wiki/ Mutation_testing#External_links Tuesday, 22 April 14
  • 140. Ruby: Heckle, Mutant Java: pitest, Jumble, Jester Available tools http://en.wikipedia.org/wiki/ Mutation_testing#External_links Tuesday, 22 April 14
  • 141. Ruby: Heckle, Mutant Java: pitest, Jumble, Jester C#: Nester, NinjaTurtle, Cream Available tools http://en.wikipedia.org/wiki/ Mutation_testing#External_links Tuesday, 22 April 14
  • 142. Ruby: Heckle, Mutant Java: pitest, Jumble, Jester C#: Nester, NinjaTurtle, Cream Python: Pester Available tools http://en.wikipedia.org/wiki/ Mutation_testing#External_links Tuesday, 22 April 14
  • 143. Open source Works with Java 5, 6, 7 Works with all mocking frameworks including PowerMock Integrates with Maven,Ant, Gradle & SBT Plugins for Eclipse & IntelliJ Plugins for Jenkins & SonarQube Releases every 3 months or so since 2011 Tuesday, 22 April 14
  • 144. ā€¢ The Ladders - NewYork ā€¢ Sky - Livingston ā€¢ Insurance companies ā€¢ Investment banks ā€¢ Biotech companies ā€¢ Norway's e-voting system Tuesday, 22 April 14
  • 145. ā€¢ The Ladders - NewYork ā€¢ Sky - Livingston ā€¢ Insurance companies ā€¢ Investment banks ā€¢ Biotech companies ā€¢ Norway's e-voting system Tuesday, 22 April 14
  • 146. ā€¢ The Ladders - NewYork ā€¢ Sky - Livingston ā€¢ Insurance companies ā€¢ Investment banks ā€¢ Biotech companies ā€¢ Norway's e-voting system Tuesday, 22 April 14
  • 149. Seb Ā Rose Twi#er: Ā  Ā  @sebrose Blog: Ā  Ā  Ā  www.claysnow.co.uk E-Ā­ā€mail: Ā  Ā  seb@claysnow.co.uk Tuesday, 22 April 14