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
48
2019-chicago-jug-mutation-testing.pdf
Jeanne Boyarsky
November 03, 2019
Tweet
Share
More Decks by Jeanne Boyarsky
See All by Jeanne Boyarsky
Mastering Logging in Java
boyarsky
0
20
2025 FRC Changes and Awards - NYC FIRST
boyarsky
0
38
Managing Your Time for Work, Learning, and Fun
boyarsky
0
69
Preparing for the Java 21 Certification and Learning New Features
boyarsky
0
190
2024-java21.pdf
boyarsky
0
52
NYC FRC 2024 Kickoff Awards Presentation
boyarsky
0
99
Preparing to Apply and Speak at Conferences
boyarsky
0
68
Refactoring to Java 21
boyarsky
1
100
2023-static-analysis.pdf
boyarsky
0
90
Other Decks in Programming
See All in Programming
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
320
Djangoにおける複数ユーザー種別認証の設計アプローチ@DjangoCongress JP 2025
delhi09
PRO
4
510
Rubyと自由とAIと
yotii23
6
1.9k
良いコードレビューとは
danimal141
9
8.5k
ソフトウェアエンジニアの成長
masuda220
PRO
12
2.2k
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
190
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
260
Go 1.24でジェネリックになった型エイリアスの紹介
syumai
2
310
クリーンアーキテクチャから見る依存の向きの大切さ
shimabox
5
1.2k
CDKを使ったPagerDuty連携インフラのテンプレート化
shibuya_shogo
0
120
技術を改善し続ける
gumioji
0
180
DevNexus - Create AI Infused Java Apps with LangChain4j
kdubois
0
140
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
336
57k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
How GitHub (no longer) Works
holman
314
140k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Speed Design
sergeychernyshev
28
820
Art, The Web, and Tiny UX
lynnandtonic
298
20k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Bash Introduction
62gerente
611
210k
A better future with KSS
kneath
238
17k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
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