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
Intro to Mutation Testing
Search
Jeanne Boyarsky
March 05, 2018
Technology
150
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Intro to Mutation Testing
Presented at Oracle Code NYC 2018. This is a repeat of the session I gave at JavaOne in 2017.
Jeanne Boyarsky
March 05, 2018
More Decks by Jeanne Boyarsky
See All by Jeanne Boyarsky
JavaOne Java 25
boyarsky
0
100
JUnit 6 + exploring the testing ecosystem
boyarsky
0
100
Timeline of a (NYC) FRC Session/Regional
boyarsky
0
77
2025 Toastmasters Path Reference
boyarsky
0
240
2025 Toastmasters Path Changes Update Overview and Reference
boyarsky
0
130
Mentor_Conference_Presentation.pdf
boyarsky
0
63
2025-java-does-what-now.pdf
boyarsky
0
130
Beyond JUnit 5
boyarsky
0
100
Java 21 Certification (or learning new features)
boyarsky
0
170
Other Decks in Technology
See All in Technology
安全性・開発速度・ユーザー体験の あいだで考える 事業会社のプロダクトセキュリティ
mixi_engineers
PRO
0
110
コミュニティから始まった農業IoTとの7年間 ——人との関わりが教えてくれたこと
peacemaker07
0
110
2027年のMetricKit
kantacky
0
170
内製AIチャットボット開発で学んだ Datadog Agent Observability活用術
mkdev10
0
130
Rust×eBPFでEDRっぽいものをつくる
sunlife3
2
940
:syncing_time:
sksat
2
720
「面白い!」を信じ抜け。激動の時代を貫く、オンリーワン・エンジニアの条件
kizawa2020
0
120
MCPを待つな、パスキーを拡げよう(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
140
NANDでも描画したい!
nichica906
3
690
1000⼈規模のClaude Enterprise運⽤を「Oktaのグループ」と「Slack」に集約する
sansantech
PRO
0
200
平文パスワードはログに“残り” ── 肝心の侵入は“痕跡すら残らない”
kuroneko13
0
130
AIにブラウザを触らせて、E2EテストをPlaywrightで書く
koji_kawamura
0
410
Featured
See All Featured
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Everyday Curiosity
cassininazir
0
290
How STYLIGHT went responsive
nonsquared
100
6.2k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Darren the Foodie - Storyboard
khoart
PRO
3
3.7k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Designing Experiences People Love
moore
143
24k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Building an army of robots
kneath
306
46k
Designing for Performance
lara
611
70k
Transcript
Intro to Mutation Testing speakerdeck.com/boyarsky Twitter @jeanneboyarsky Blog: http://www.selikoff.net Jeanne
Boyarsky Oracle Code NYC – March 8, 2018
@jeanneboyarsky About Me 15 years as • Java Developer •
JUnit user
The Plan 1. About mutation testing 2. Live demo 3.
A look at types of mutants 4. Profit??? @jeanneboyarsky
Why write tests? @jeanneboyarsky It used to work!
How know if tests are good? @jeanneboyarsky
If test coverage low @jeanneboyarsky Write more tests! Not ready
for mutation testing of class
If test coverage high @jeanneboyarsky All done! Perfect code!
Or is it? Why is it saying nobody is registered?
@jeanneboyarsky
Code Review! @jeanneboyarsky
That’s a mutant! @jeanneboyarsky
Too many mutants! They’re everywhere! @jeanneboyarsky
PitClipse to the rescue! @jeanneboyarsky
@jeanneboyarsky PIT Integration Almost
JUnit 5 • Unofficial Fork: https://github.com/tobiasstadler/pitest-junit5-plugin • It’s coming: https://github.com/hcoles/pitest/issues/284
https://github.com/hcoles/pitest/issues/398 @jeanneboyarsky
Easy to run @jeanneboyarsky
The console flies by @jeanneboyarsky
Wait, we just had 100% coverage @jeanneboyarsky
We caught 5 mutants @jeanneboyarsky
More detail @jeanneboyarsky
Level up @jeanneboyarsky
Now 23 survived @jeanneboyarsky
Let’s try it! @jeanneboyarsky
Observations • JUnit tests must pass • Fixing one may
take care of more • Found a bug • Better tests @jeanneboyarsky
Now with all mutators @jeanneboyarsky
Observations • Better tests • Unused production code @jeanneboyarsky
Examples of Conditional Mutants @jeanneboyarsky Conditionals Boundary <= vs <
Negative Conditionals <= vs > Void Method Call Removes method calls
Examples of Math Mutants @jeanneboyarsky Math * vs / Increments
++ vs -- Invert Negatives x vs -x
Examples of Other Mutants @jeanneboyarsky Return Values x vs x+1
Disabled by default (false positives, duplicates or crashes) Constructor Calls Inline Constants Non Void Method Calls Remove Conditionals Experimental Member Variables Switch
Tips for bigger projects • Watch console to see if
still running • Reports on whole project – drill down/split up • Exclude long running tests • Experimental feature: incremental analysis @jeanneboyarsky
Review Code Coverage Mutation Testing Requirements
More info • http://pitest.org/ • https://github.com/philglover/pitclipse • https://dzone.com/articles/introduction-mutation @jeanneboyarsky
@jeanneboyarsky