Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
2019-chicago-jug-mutation-testing.pdf
Jeanne Boyarsky
November 03, 2019
Programming
0
34
2019-chicago-jug-mutation-testing.pdf
Jeanne Boyarsky
November 03, 2019
Tweet
Share
More Decks by Jeanne Boyarsky
See All by Jeanne Boyarsky
12 Tips for Writing Readable Code
boyarsky
0
75
2022-java17-refactoring.pdf
boyarsky
1
87
Hybrid Scrum: Location May Vary
boyarsky
0
76
2022-DevNexus-Java9-11.pdf
boyarsky
0
130
2022-DevNexus-Java12-17.pdf
boyarsky
0
150
Presenting in Person - Communicating for Chairman's and Pit Interviews
boyarsky
0
63
2021 KCDC JUnit 5
boyarsky
2
89
Become one of the first Java 17 developers in the world
boyarsky
1
480
Java: Did you Know that?
boyarsky
4
350
Other Decks in Programming
See All in Programming
2023年にクル(かもしれない)通信ミドルウェア技術(仮)
s_hosoai
0
230
Cloudflare WorkersでGoを動かすライブラリを作っている話
syumai
1
340
CDKでValidationする本当の方法 / cdk-validation
gotok365
1
280
23年のJavaトレンドは?Quarkusで理解するコンテナネイティブJava
tatsuya1bm
1
140
なぜRubyコミュニティにコミットするのか?
luccafort
0
340
Remix + Cloudflare Pages + D1 で ポケモン SV のレンタルチームを検索できるアプリを作ってみた
kuroppe1819
4
1.4k
はじめての「R」
masaha03
0
140
Azure Functionsをサクッと開発、サクッとデプロイ/vscodeconf2023-baba
nina01
1
360
Amebaブログの会員画面システム刷新の道程
ryotasugawara
1
260
The State of Kotlin | FOSDEM 2023
prof18
1
110
TSX First な Zero-Runtime SSG potato4d/dodai とその仕組み / owned static site generator #kyotojs
potato4d
1
490
ITエンジニア特化型Q&Aサイトteratailを 言語、DB、クラウドなど フルリプレイスした話
leveragestech
0
470
Featured
See All Featured
Robots, Beer and Maslow
schacon
154
7.3k
From Idea to $5000 a Month in 5 Months
shpigford
374
44k
Pencils Down: Stop Designing & Start Developing
hursman
114
10k
Atom: Resistance is Futile
akmur
256
24k
Product Roadmaps are Hard
iamctodd
38
7.7k
Become a Pro
speakerdeck
PRO
6
3.2k
The Art of Programming - Codeland 2020
erikaheidi
36
11k
The Illustrated Children's Guide to Kubernetes
chrisshort
22
43k
Fashionably flexible responsive web design (full day workshop)
malarkey
396
63k
Six Lessons from altMBA
skipperchong
15
2.3k
4 Signs Your Business is Dying
shpigford
171
20k
The Pragmatic Product Professional
lauravandoore
21
3.5k
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