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
Managing Your Time for Work, Learning, and Fun
boyarsky
0
49
Preparing for the Java 21 Certification and Learning New Features
boyarsky
0
170
2024-java21.pdf
boyarsky
0
40
NYC FRC 2024 Kickoff Awards Presentation
boyarsky
0
91
Preparing to Apply and Speak at Conferences
boyarsky
0
58
Refactoring to Java 21
boyarsky
1
84
2023-static-analysis.pdf
boyarsky
0
63
Readable Regular Expressions in Java
boyarsky
0
170
Readable Regular Expressions
boyarsky
0
230
Other Decks in Programming
See All in Programming
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
CSC305 Lecture 26
javiergs
PRO
0
140
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
130
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
460
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
330
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
Haze - Real time background blurring
chrisbanes
1
510
命名をリントする
chiroruxx
1
390
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
2
460
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
1
370
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
137
6.7k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
A designer walks into a library…
pauljervisheath
204
24k
Building Adaptive Systems
keathley
38
2.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Into the Great Unknown - MozCon
thekraken
33
1.5k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Visualization
eitanlees
146
15k
Designing for humans not robots
tammielis
250
25k
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