Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
2019-chicago-jug-mutation-testing.pdf
Search
Jeanne Boyarsky
November 03, 2019
Programming
0
44
2019-chicago-jug-mutation-testing.pdf
Jeanne Boyarsky
November 03, 2019
Tweet
Share
More Decks by Jeanne Boyarsky
See All by Jeanne Boyarsky
Preparing for the Java 21 Certification and Learning New Features
boyarsky
0
64
2024-java21.pdf
boyarsky
0
16
NYC FRC 2024 Kickoff Awards Presentation
boyarsky
0
53
Preparing to Apply and Speak at Conferences
boyarsky
0
37
Refactoring to Java 21
boyarsky
1
28
2023-static-analysis.pdf
boyarsky
0
32
Readable Regular Expressions in Java
boyarsky
0
85
Readable Regular Expressions
boyarsky
0
170
Java Idioms for becoming a more powerful developer
boyarsky
0
130
Other Decks in Programming
See All in Programming
Random\Randomizer クラスで日常のあれこれを解決しよう! / Random\Randomizer class solves familiar trouble
cocoeyes02
0
210
Code Reviews
bkuhlmann
4
890
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
480
エンターテイメント業界で利用されるAWS
demuyan
0
210
0→1と1→10の狭間で Javaという技術選定を振り返る/Reflecting on the Decision to Choose Java Between Scaling from 0 to 1 and 1 to 10
jaguar_imo
2
380
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
260
Git Rebase
bkuhlmann
11
1.6k
VS Code をプロダクトにどう取り込むか
onomax
1
360
Ruby GitHub Packages
bkuhlmann
0
630
코틀린으로 멀티플랫폼 만들기
pangmoo
0
150
2 週間で Twitter Bot を作ってみた
contour_gara
0
250
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
21
1.6k
The Cult of Friendly URLs
andyhume
74
5.7k
Building a Scalable Design System with Sketch
lauravandoore
456
32k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
Clear Off the Table
cherdarchuk
84
310k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
In The Pink: A Labor of Love
frogandcode
138
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
355
18k
Building Applications with DynamoDB
mza
88
5.6k
The Mythical Team-Month
searls
216
42k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Transcript
@jeanneboyarsky 1 Intro to Mutation Testing Jeanne Boyarsky Monday, November
4, 2019 Chicago Java User Group speakerdeck.com/boyarsky
@jeanneboyarsky Shout out to the selection process! 2
@jeanneboyarsky Pause for a Commercial 3
@jeanneboyarsky Why write tests? 4 It used to work!
@jeanneboyarsky How know if tests are good? 5
@jeanneboyarsky If test coverage low 6 Write more tests! Not
ready for mutation testing of class
@jeanneboyarsky If test coverage high 7 All done! Perfect code!
@jeanneboyarsky Or is it? 8 Why is it saying nobody
is registered?
@jeanneboyarsky Code Review! 9
@jeanneboyarsky That’s a mutant! 10
@jeanneboyarsky Too many mutants! 11 They’re everywhere!
@jeanneboyarsky PIT to the rescue! 12
@jeanneboyarsky What is PIT? • Originally Parallel Isolated Test •
Now just PIT 13
@jeanneboyarsky Easy to run 14
@jeanneboyarsky Easy to run 15
@jeanneboyarsky The console flies by 16
@jeanneboyarsky We caught 5 mutants 17
@jeanneboyarsky More detail 18
@jeanneboyarsky The mutants live…. 19
@jeanneboyarsky Level up 20
@jeanneboyarsky Now 32 survived 21
@jeanneboyarsky PIT 22 Mutant Generation Bytecode (ASM) Test Selection Coverage
Mutant Insertion Instrumentation Mutant Detection Early Exit (fine)
@jeanneboyarsky Mutant Generation Options 1. Bytecode • Faster • May
not map to line of code • Java 8 stream support was immediate 2. Source Code • Slower • Clearer 23 Thank you to pitest.org for this material
@jeanneboyarsky Test Selection Options 1. Coverage • Fast - picks
right test 2. Naive • Slow - brute force 3. Convention • Medium - uses naming conventions 24 Thank you to pitest.org for this material
@jeanneboyarsky Mutant Insertion Options 1. Instrumentation • Fast - picks
right test 2. Classloader • Uses a lot of memory 3. Debugger Hotswap • Can be slower because debugger on 25 Thank you to pitest.org for this material
@jeanneboyarsky Mutant Detection Options 1. Early Exit (fine) • Stops
when test finds a mutant 2. Early Exit (coarse) • Stops when class finds a mutant 3. Naive • Slow - brute force 26 Thank you to pitest.org for this material
@jeanneboyarsky JUnit 5 Support • PitClipse assigned to next version
on Oct 5 27
@jeanneboyarsky JUnit 5 Support • No date for IntelliJ 28
@jeanneboyarsky JUnit 5 Support • Supported by • Maven •
Gradle • However…. I find IDE integration to be critical 29
@jeanneboyarsky Tips • JUnit tests must pass • Watch console
to see if still running • Reports on whole project • Fixing one may take care of more 30
@jeanneboyarsky For More • Code Kata: https://github.com/vmzakharov/mutate- test-kata 31
@jeanneboyarsky Demo 32