Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
1
120
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
Tweet
Share
More Decks by Jeanne Boyarsky
See All by Jeanne Boyarsky
2025 Toastmasters Path Reference
boyarsky
0
48
2025 Toastmasters Path Changes Update Overview and Reference
boyarsky
0
35
Mentor_Conference_Presentation.pdf
boyarsky
0
15
2025-java-does-what-now.pdf
boyarsky
0
84
Beyond JUnit 5
boyarsky
0
43
Java 21 Certification (or learning new features)
boyarsky
0
82
Preparing for the Java 21 cert + Learning New Features
boyarsky
0
210
Mastering Logging in Java
boyarsky
0
140
2025 FRC Changes and Awards - NYC FIRST
boyarsky
0
94
Other Decks in Technology
See All in Technology
Ruby で作る大規模イベントネットワーク構築・運用支援システム TTDB
taketo1113
1
260
re:Invent 2025 ふりかえり 生成AI版
takaakikakei
1
190
学習データって増やせばいいんですか?
ftakahashi
2
300
re:Invent2025 コンテナ系アップデート振り返り(+CloudWatchログのアップデート紹介)
masukawa
0
340
AI 駆動開発勉強会 フロントエンド支部 #1 w/あずもば
1ftseabass
PRO
0
320
RAG/Agent開発のアップデートまとめ
taka0709
0
160
生成AIでテスト設計はどこまでできる? 「テスト粒度」を操るテーラリング術
shota_kusaba
0
670
Lessons from Migrating to OpenSearch: Shard Design, Log Ingestion, and UI Decisions
sansantech
PRO
1
120
グレートファイアウォールを自宅に建てよう
ctes091x
0
140
寫了幾年 Code,然後呢?軟體工程師必須重新認識的 DevOps
cheng_wei_chen
1
1.3k
ML PM Talk #1 - ML PMの分類に関する考察
lycorptech_jp
PRO
1
790
エンジニアリングをやめたくないので問い続ける
estie
2
1.1k
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Speed Design
sergeychernyshev
33
1.4k
Automating Front-end Workflow
addyosmani
1371
200k
KATA
mclloyd
PRO
32
15k
Balancing Empowerment & Direction
lara
5
790
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
Agile that works and the tools we love
rasmusluckow
331
21k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
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