SlideShare a Scribd company logo
1 of 27
MUTATION TESTING
Woot?
EXAMPLE 1
public void testMethod() {
Something something = new Something();
something.executeSomeMethod();
}
EXAMPLE 2
public void testConstructor() {
Something something = new Something();
}
LITTLE HISTORY
FIRST PROPOSED in 1971 by Richard Lipton
A. Jefferson Offutt and R. H. Untch “Mutation 2000: Uniting the Orthogonal”
FIRST DEFINED in 1978
R. A. De Millo, R. J. Lipton, F. G. Sayward “Hints on test data selection”
FIRST IMPLEMENTED in 1980 by Timothy Budd
T. A. Budd, “Mutation Analysis of Program Test Data”
PROBLEM
SOLUTION
EXPECTATIONS
TESTS - TDD?
TESTS - NO TDD?
TEST
MUTATION
TESTING MUTATED CODE...
EXPECTED RESULT
SOMETHING WRONG?
FLOW
1. Run tests
2. Mutate production code
3. Run tests again
4. Generate report
KILL THE MUTANT!
TESTS RESULTS?
PASSED (SURVIVED) FAILED (KILLED)
other results applicable (e. g. timeout, memory error)
EXAMPLE
ORIGINAL
if (i >= 0) {
return "foo";
} else {
return "bar";
}
MUTATED
if (i > 0) {
return "foo";
} else {
return "bar";
}
conditionals boundary mutation
COMMON MUTATORS #1
CONDITIONALS MUTATORS
< -> <=
<= -> <
> -> >=
>= -> >
== -> !=
!= -> ==
MATH MUTATORS
+ -> -
- -> +
>> -> <<
<< -> >>
* -> /
/ -> *
COMMON MUTATORS #2
RETURN VALUES MUTATOR
returns true if original returns false
returns false if original returns true
returns 0 if original returns int != 0
returns 1 if original returns 0
METHOD CALLS MUTATOR
removes void method call
removes non-void method call, returns default
value for the return type
replaces members with null in constructors
SURVIVORS STORIES
HOW TO GET STARTED?
PITEST for JAVA http://pitest.org
Parasoft INSURE++ for C/C++ https://www.parasoft.com/product/insure/
MutPy for Python https://pypi.python.org/pypi/MutPy/0.4.0
Maven: mvn org.pitest:pitest-maven:mutationCoverage
PERFORMANCE
100 classes
10 tests / class
1 ms / test
tTOTAL = 100 x 10 x 1ms = 1s
10 mutations / class
tALL = 10 x 100 x 1s ~ 17min
tSMART = 10 x 100 x (10 x 1ms) = 10s
1000 classes
10 tests / class
1 ms / test
tTOTAL = 1000 x 10 x 1ms = 10s
10 mutations / class
tALL = 10 x 1000 x 10s ~ 28h
tSMART = 10 x 1000 x (10 x 1ms) ~ 2min
real life example: 481 test cases fully mutated on 16GB i7 -> 03:24 min
ATTRIBUTIONS
Hands Up - Avel Chuklanov - https://unsplash.com/photos/9cx4-QowgLc (CC0 1.0)
Bridge - Franc - https://thenounproject.com/search/?q=bridge&i=122542 (CC BY 3.0 US)
Cargo Truck - No way - https://thenounproject.com/search/?q=truck&i=154864 (CC0 1.0)
Philosoraptor - OnlyOneKenobi - http://wallpaperswide.com/philosoraptor-wallpapers.html
Chainsaw - James Keuning - https://thenounproject.com/search/?q=chainsaw&i=11328 (CC0 1.0)
Refugees - Gerald Wildmoser - https://thenounproject.com/search/?q=drown&i=208787 (CC BY 3.0 US)
Resurrection - Isabel Martinez Isabel - https://thenounproject.com/search/?q=survived&i=202842 (CC BY 3.0 US)
Pac Man - iconoci - https://thenounproject.com/search/?q=pac+man&i=9215 (CC BY 3.0 US)
Stopwatch - Nick Holroyd - https://thenounproject.com/search/?q=stopwatch&i=12666 (CC BY 3.0 US)
Zombie analysis - clement127 - https://www.flickr.com/photos/clement127/16089737804/ (CC BY-NC-ND 2.0)
in order of appearance
THANK YOU!
Mateusz Bryła

More Related Content

Viewers also liked

M sc advanced food marketing finding info
M sc advanced food marketing   finding infoM sc advanced food marketing   finding info
M sc advanced food marketing finding infonmjb
 
NI Local Conference One Pager_NISF_29 April 2017(3)
NI Local Conference One Pager_NISF_29 April 2017(3)NI Local Conference One Pager_NISF_29 April 2017(3)
NI Local Conference One Pager_NISF_29 April 2017(3)Claire Kaufman
 
Guide aides financieres renovation habitat - juillet -2016
Guide aides financieres renovation habitat - juillet -2016Guide aides financieres renovation habitat - juillet -2016
Guide aides financieres renovation habitat - juillet -2016Isocell France
 
Relatório de desenho
Relatório de desenhoRelatório de desenho
Relatório de desenhoRaquel Sofia
 
фольклорні балади про робін гуда
фольклорні балади про робін гудафольклорні балади про робін гуда
фольклорні балади про робін гудаSnezhana Pshenichnaya
 
Connecting in the Facebook Age: Development and Validation of a New Measure o...
Connecting in the Facebook Age: Development and Validation of a New Measure o...Connecting in the Facebook Age: Development and Validation of a New Measure o...
Connecting in the Facebook Age: Development and Validation of a New Measure o...Jessica Vitak
 
Resolución pliegos nutrición adulto mayor
Resolución pliegos nutrición adulto mayorResolución pliegos nutrición adulto mayor
Resolución pliegos nutrición adulto mayorAlcaldiacocorna
 
Creating my contents page
Creating my contents pageCreating my contents page
Creating my contents pagetomgoodyear
 
Apn super bônus
Apn super bônusApn super bônus
Apn super bônusjvaldir
 
Brian Ramirez-Letter of Recommendation
Brian Ramirez-Letter of RecommendationBrian Ramirez-Letter of Recommendation
Brian Ramirez-Letter of RecommendationBrian Ramirez
 

Viewers also liked (13)

M sc advanced food marketing finding info
M sc advanced food marketing   finding infoM sc advanced food marketing   finding info
M sc advanced food marketing finding info
 
Lição 8 Não Matarás
Lição 8   Não MatarásLição 8   Não Matarás
Lição 8 Não Matarás
 
NI Local Conference One Pager_NISF_29 April 2017(3)
NI Local Conference One Pager_NISF_29 April 2017(3)NI Local Conference One Pager_NISF_29 April 2017(3)
NI Local Conference One Pager_NISF_29 April 2017(3)
 
Guide aides financieres renovation habitat - juillet -2016
Guide aides financieres renovation habitat - juillet -2016Guide aides financieres renovation habitat - juillet -2016
Guide aides financieres renovation habitat - juillet -2016
 
demola_presentation
demola_presentationdemola_presentation
demola_presentation
 
Relatório de desenho
Relatório de desenhoRelatório de desenho
Relatório de desenho
 
фольклорні балади про робін гуда
фольклорні балади про робін гудафольклорні балади про робін гуда
фольклорні балади про робін гуда
 
Connecting in the Facebook Age: Development and Validation of a New Measure o...
Connecting in the Facebook Age: Development and Validation of a New Measure o...Connecting in the Facebook Age: Development and Validation of a New Measure o...
Connecting in the Facebook Age: Development and Validation of a New Measure o...
 
Resolución pliegos nutrición adulto mayor
Resolución pliegos nutrición adulto mayorResolución pliegos nutrición adulto mayor
Resolución pliegos nutrición adulto mayor
 
Creating my contents page
Creating my contents pageCreating my contents page
Creating my contents page
 
Apn super bônus
Apn super bônusApn super bônus
Apn super bônus
 
Brian Ramirez-Letter of Recommendation
Brian Ramirez-Letter of RecommendationBrian Ramirez-Letter of Recommendation
Brian Ramirez-Letter of Recommendation
 
AIXÍ ÉS LA MEVA ESCOLA!
AIXÍ ÉS LA MEVA ESCOLA!AIXÍ ÉS LA MEVA ESCOLA!
AIXÍ ÉS LA MEVA ESCOLA!
 

Similar to Mateusz Bryła - Mutation testing

Mutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The BugsMutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The BugsAri Waller
 
Mutation testing
Mutation testingMutation testing
Mutation testing기영 이
 
Fuzzing for CPS Mutation Testing
Fuzzing for CPS Mutation TestingFuzzing for CPS Mutation Testing
Fuzzing for CPS Mutation TestingLionel Briand
 
Mutation and Contract Testing
Mutation and Contract TestingMutation and Contract Testing
Mutation and Contract TestingMateusz Bryła
 
STAMP Descartes Presentation
STAMP Descartes PresentationSTAMP Descartes Presentation
STAMP Descartes PresentationSTAMP Project
 
20150603 establishing theoretical minimal sets of mutants (Lab seminar)
20150603 establishing theoretical minimal sets of mutants (Lab seminar)20150603 establishing theoretical minimal sets of mutants (Lab seminar)
20150603 establishing theoretical minimal sets of mutants (Lab seminar)Donghwan Shin
 
Kill the mutants - A better way to test your tests
Kill the mutants - A better way to test your testsKill the mutants - A better way to test your tests
Kill the mutants - A better way to test your testsRoy van Rijn
 
Kill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnKill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnNLJUG
 
Tdd with python unittest for embedded c
Tdd with python unittest for embedded cTdd with python unittest for embedded c
Tdd with python unittest for embedded cBenux Wei
 
DSR Testing (Part 1)
DSR Testing (Part 1)DSR Testing (Part 1)
DSR Testing (Part 1)Steve Upton
 
Test-driven Development for TYPO3
Test-driven Development for TYPO3Test-driven Development for TYPO3
Test-driven Development for TYPO3Oliver Klee
 
Print Testing
Print TestingPrint Testing
Print Testingdonwelch
 
Convergence
ConvergenceConvergence
Convergencedonwelch
 
MUTANTS KILLER - PIT: state of the art of mutation testing system
MUTANTS KILLER - PIT: state of the art of mutation testing system MUTANTS KILLER - PIT: state of the art of mutation testing system
MUTANTS KILLER - PIT: state of the art of mutation testing system Tarin Gamberini
 
Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)Oliver Klee
 

Similar to Mateusz Bryła - Mutation testing (20)

Mutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The BugsMutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The Bugs
 
Mutation testing
Mutation testingMutation testing
Mutation testing
 
Fuzzing for CPS Mutation Testing
Fuzzing for CPS Mutation TestingFuzzing for CPS Mutation Testing
Fuzzing for CPS Mutation Testing
 
Mutation and Contract Testing
Mutation and Contract TestingMutation and Contract Testing
Mutation and Contract Testing
 
Stamp breizhcamp 2019
Stamp breizhcamp 2019Stamp breizhcamp 2019
Stamp breizhcamp 2019
 
Basic TDD moves
Basic TDD movesBasic TDD moves
Basic TDD moves
 
STAMP Descartes Presentation
STAMP Descartes PresentationSTAMP Descartes Presentation
STAMP Descartes Presentation
 
Mutation testing
Mutation testingMutation testing
Mutation testing
 
20150603 establishing theoretical minimal sets of mutants (Lab seminar)
20150603 establishing theoretical minimal sets of mutants (Lab seminar)20150603 establishing theoretical minimal sets of mutants (Lab seminar)
20150603 establishing theoretical minimal sets of mutants (Lab seminar)
 
Kill the mutants - A better way to test your tests
Kill the mutants - A better way to test your testsKill the mutants - A better way to test your tests
Kill the mutants - A better way to test your tests
 
Kill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnKill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van Rijn
 
Tdd with python unittest for embedded c
Tdd with python unittest for embedded cTdd with python unittest for embedded c
Tdd with python unittest for embedded c
 
Mutation @ Spotify
Mutation @ Spotify Mutation @ Spotify
Mutation @ Spotify
 
DSR Testing (Part 1)
DSR Testing (Part 1)DSR Testing (Part 1)
DSR Testing (Part 1)
 
Mutation-Testing mit PIT
Mutation-Testing mit PITMutation-Testing mit PIT
Mutation-Testing mit PIT
 
Test-driven Development for TYPO3
Test-driven Development for TYPO3Test-driven Development for TYPO3
Test-driven Development for TYPO3
 
Print Testing
Print TestingPrint Testing
Print Testing
 
Convergence
ConvergenceConvergence
Convergence
 
MUTANTS KILLER - PIT: state of the art of mutation testing system
MUTANTS KILLER - PIT: state of the art of mutation testing system MUTANTS KILLER - PIT: state of the art of mutation testing system
MUTANTS KILLER - PIT: state of the art of mutation testing system
 
Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)
 

More from kraqa

RestAssured w sluzbie testow API
RestAssured w sluzbie testow APIRestAssured w sluzbie testow API
RestAssured w sluzbie testow APIkraqa
 
Postman - podstawy testowania REST API
Postman - podstawy testowania REST APIPostman - podstawy testowania REST API
Postman - podstawy testowania REST APIkraqa
 
Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20kraqa
 
Machine learning powered regression - KraQA 42 - Pawel Dyrek
Machine learning powered regression - KraQA 42 - Pawel Dyrek Machine learning powered regression - KraQA 42 - Pawel Dyrek
Machine learning powered regression - KraQA 42 - Pawel Dyrek kraqa
 
Kontrakt testy - KraQA 42 - Slawomir Radzyminski
Kontrakt testy - KraQA 42 - Slawomir RadzyminskiKontrakt testy - KraQA 42 - Slawomir Radzyminski
Kontrakt testy - KraQA 42 - Slawomir Radzyminskikraqa
 
KraQA#41 - PageFactory
KraQA#41 - PageFactoryKraQA#41 - PageFactory
KraQA#41 - PageFactorykraqa
 
KraQA#39 - Jak testowac tool do testow
KraQA#39 - Jak testowac tool do testowKraQA#39 - Jak testowac tool do testow
KraQA#39 - Jak testowac tool do testowkraqa
 
Hyperion - wystarczy jeden shake
Hyperion - wystarczy jeden shakeHyperion - wystarczy jeden shake
Hyperion - wystarczy jeden shakekraqa
 
Wybor urzadzen mobilnych do testow
Wybor urzadzen mobilnych do testowWybor urzadzen mobilnych do testow
Wybor urzadzen mobilnych do testowkraqa
 
Continuous security
Continuous securityContinuous security
Continuous securitykraqa
 
Let s meet inside
Let s meet insideLet s meet inside
Let s meet insidekraqa
 
O wezu przy kawie
O wezu przy kawieO wezu przy kawie
O wezu przy kawiekraqa
 
Strategia do automatów
Strategia do automatówStrategia do automatów
Strategia do automatówkraqa
 
Z czym do api
Z czym do apiZ czym do api
Z czym do apikraqa
 
Jenkins pipelines
Jenkins pipelinesJenkins pipelines
Jenkins pipelineskraqa
 
Testy UI
Testy UITesty UI
Testy UIkraqa
 
Tester w pułapce myślenia
Tester w pułapce myśleniaTester w pułapce myślenia
Tester w pułapce myśleniakraqa
 
Kiedy tester zostaje managerem
Kiedy tester zostaje manageremKiedy tester zostaje managerem
Kiedy tester zostaje manageremkraqa
 
KraQA#32 - RODO
KraQA#32 - RODOKraQA#32 - RODO
KraQA#32 - RODOkraqa
 
SkładQA 2018 - Daniel Dec
SkładQA 2018 - Daniel DecSkładQA 2018 - Daniel Dec
SkładQA 2018 - Daniel Deckraqa
 

More from kraqa (20)

RestAssured w sluzbie testow API
RestAssured w sluzbie testow APIRestAssured w sluzbie testow API
RestAssured w sluzbie testow API
 
Postman - podstawy testowania REST API
Postman - podstawy testowania REST APIPostman - podstawy testowania REST API
Postman - podstawy testowania REST API
 
Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20
 
Machine learning powered regression - KraQA 42 - Pawel Dyrek
Machine learning powered regression - KraQA 42 - Pawel Dyrek Machine learning powered regression - KraQA 42 - Pawel Dyrek
Machine learning powered regression - KraQA 42 - Pawel Dyrek
 
Kontrakt testy - KraQA 42 - Slawomir Radzyminski
Kontrakt testy - KraQA 42 - Slawomir RadzyminskiKontrakt testy - KraQA 42 - Slawomir Radzyminski
Kontrakt testy - KraQA 42 - Slawomir Radzyminski
 
KraQA#41 - PageFactory
KraQA#41 - PageFactoryKraQA#41 - PageFactory
KraQA#41 - PageFactory
 
KraQA#39 - Jak testowac tool do testow
KraQA#39 - Jak testowac tool do testowKraQA#39 - Jak testowac tool do testow
KraQA#39 - Jak testowac tool do testow
 
Hyperion - wystarczy jeden shake
Hyperion - wystarczy jeden shakeHyperion - wystarczy jeden shake
Hyperion - wystarczy jeden shake
 
Wybor urzadzen mobilnych do testow
Wybor urzadzen mobilnych do testowWybor urzadzen mobilnych do testow
Wybor urzadzen mobilnych do testow
 
Continuous security
Continuous securityContinuous security
Continuous security
 
Let s meet inside
Let s meet insideLet s meet inside
Let s meet inside
 
O wezu przy kawie
O wezu przy kawieO wezu przy kawie
O wezu przy kawie
 
Strategia do automatów
Strategia do automatówStrategia do automatów
Strategia do automatów
 
Z czym do api
Z czym do apiZ czym do api
Z czym do api
 
Jenkins pipelines
Jenkins pipelinesJenkins pipelines
Jenkins pipelines
 
Testy UI
Testy UITesty UI
Testy UI
 
Tester w pułapce myślenia
Tester w pułapce myśleniaTester w pułapce myślenia
Tester w pułapce myślenia
 
Kiedy tester zostaje managerem
Kiedy tester zostaje manageremKiedy tester zostaje managerem
Kiedy tester zostaje managerem
 
KraQA#32 - RODO
KraQA#32 - RODOKraQA#32 - RODO
KraQA#32 - RODO
 
SkładQA 2018 - Daniel Dec
SkładQA 2018 - Daniel DecSkładQA 2018 - Daniel Dec
SkładQA 2018 - Daniel Dec
 

Recently uploaded

BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 

Recently uploaded (20)

BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 

Mateusz Bryła - Mutation testing

  • 2.
  • 3. Woot? EXAMPLE 1 public void testMethod() { Something something = new Something(); something.executeSomeMethod(); } EXAMPLE 2 public void testConstructor() { Something something = new Something(); }
  • 4. LITTLE HISTORY FIRST PROPOSED in 1971 by Richard Lipton A. Jefferson Offutt and R. H. Untch “Mutation 2000: Uniting the Orthogonal” FIRST DEFINED in 1978 R. A. De Millo, R. J. Lipton, F. G. Sayward “Hints on test data selection” FIRST IMPLEMENTED in 1980 by Timothy Budd T. A. Budd, “Mutation Analysis of Program Test Data”
  • 9. TESTS - NO TDD?
  • 10. TEST
  • 15.
  • 16. FLOW 1. Run tests 2. Mutate production code 3. Run tests again 4. Generate report
  • 18. TESTS RESULTS? PASSED (SURVIVED) FAILED (KILLED) other results applicable (e. g. timeout, memory error)
  • 19. EXAMPLE ORIGINAL if (i >= 0) { return "foo"; } else { return "bar"; } MUTATED if (i > 0) { return "foo"; } else { return "bar"; } conditionals boundary mutation
  • 20. COMMON MUTATORS #1 CONDITIONALS MUTATORS < -> <= <= -> < > -> >= >= -> > == -> != != -> == MATH MUTATORS + -> - - -> + >> -> << << -> >> * -> / / -> *
  • 21. COMMON MUTATORS #2 RETURN VALUES MUTATOR returns true if original returns false returns false if original returns true returns 0 if original returns int != 0 returns 1 if original returns 0 METHOD CALLS MUTATOR removes void method call removes non-void method call, returns default value for the return type replaces members with null in constructors
  • 23. HOW TO GET STARTED? PITEST for JAVA http://pitest.org Parasoft INSURE++ for C/C++ https://www.parasoft.com/product/insure/ MutPy for Python https://pypi.python.org/pypi/MutPy/0.4.0 Maven: mvn org.pitest:pitest-maven:mutationCoverage
  • 24. PERFORMANCE 100 classes 10 tests / class 1 ms / test tTOTAL = 100 x 10 x 1ms = 1s 10 mutations / class tALL = 10 x 100 x 1s ~ 17min tSMART = 10 x 100 x (10 x 1ms) = 10s 1000 classes 10 tests / class 1 ms / test tTOTAL = 1000 x 10 x 1ms = 10s 10 mutations / class tALL = 10 x 1000 x 10s ~ 28h tSMART = 10 x 1000 x (10 x 1ms) ~ 2min real life example: 481 test cases fully mutated on 16GB i7 -> 03:24 min
  • 25.
  • 26. ATTRIBUTIONS Hands Up - Avel Chuklanov - https://unsplash.com/photos/9cx4-QowgLc (CC0 1.0) Bridge - Franc - https://thenounproject.com/search/?q=bridge&i=122542 (CC BY 3.0 US) Cargo Truck - No way - https://thenounproject.com/search/?q=truck&i=154864 (CC0 1.0) Philosoraptor - OnlyOneKenobi - http://wallpaperswide.com/philosoraptor-wallpapers.html Chainsaw - James Keuning - https://thenounproject.com/search/?q=chainsaw&i=11328 (CC0 1.0) Refugees - Gerald Wildmoser - https://thenounproject.com/search/?q=drown&i=208787 (CC BY 3.0 US) Resurrection - Isabel Martinez Isabel - https://thenounproject.com/search/?q=survived&i=202842 (CC BY 3.0 US) Pac Man - iconoci - https://thenounproject.com/search/?q=pac+man&i=9215 (CC BY 3.0 US) Stopwatch - Nick Holroyd - https://thenounproject.com/search/?q=stopwatch&i=12666 (CC BY 3.0 US) Zombie analysis - clement127 - https://www.flickr.com/photos/clement127/16089737804/ (CC BY-NC-ND 2.0) in order of appearance

Editor's Notes

  1. Welcome everyone!
  2. Show of hands! Who writes unit tests? Who believes they are worthy? Who measures coverage? Who has coverage at >= 85%? Who thinks coverage is the perfect metric? Nice tool. But it isn’t perfect.
  3. 1971 - proposed by a student RICHARD LIPTON as a term work. 1978 - formal definition 1980 - first implementation But TOO SLOW!
  4. PASSED - negative scenario FAILED - positive scenario
  5. Story 1 - forgot to clear map - show example Story 2 - rare fault handling - one boolean method returning failure handling result - all unit tests expected false as return method - in mocking nightmare