Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Intro to Mutation Testing
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
Modern Java Features
boyarsky
0
5
Time Management for Work, Learning, Fun (2026 edition)
boyarsky
0
41
Preparing for the Java 25 Certification or Learning New Features
boyarsky
0
36
JavaOne Java 25
boyarsky
0
130
JUnit 6 + exploring the testing ecosystem
boyarsky
0
130
Timeline of a (NYC) FRC Session/Regional
boyarsky
0
93
2025 Toastmasters Path Reference
boyarsky
0
300
2025 Toastmasters Path Changes Update Overview and Reference
boyarsky
0
160
Mentor_Conference_Presentation.pdf
boyarsky
0
70
Other Decks in Technology
See All in Technology
Claude Code on Bedrock で統制をかける小ネタ集/claude-code-bedrock-governance-tips
emiki
1
13k
これだけは抑えておきたい!後悔しない re:Invent の過ごし方 / AWS re:Invent 2026 prestudy
kinunori
2
380
シンプルな設定ファイルで実現する AWS IAM Identity Center の ユーザー管理Terraformフレームワークを公開しました / Simplifying AWS IAM Identity Center User Management: An Open-Source Terraform Framework
yamaguchitk333
0
320
撮るだけでは終わらない。ソニーが挑むB2Bカメラソリューション開発
sony
0
110
演劇と私とスクラム
chinmo
0
160
クラウドエージェントの先駆け Devin。今も最先端を走る、他との違い
kinopeee
0
400
reInvent2026stby LT00 "Change your life!"
shinichirokawano
1
300
AIコーディングを実践してきた1年を振り返る / Looking Back on a Year of Practicing AI Coding
takedatakashi
1
140
僕のハーネスを紹介します
watany
6
1.6k
freeeにおける AI を用いた ブラウザ動作確認の自動化の取り組み
freee
PRO
0
220
1週間、Opus封印でお願いします
kintotechdev
0
170
国際カードブランドルール変更に伴うクレジットカード決済取引仕様変更について
k1style
0
240
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
143
7.8k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
How to train your dragon (web standard)
notwaldorf
96
6.9k
A better future with KSS
kneath
240
18k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Building the Perfect Custom Keyboard
takai
2
920
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Deep Space Network (abreviated)
tonyrice
0
380
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
630
Code Reviewing Like a Champion
maltzj
529
40k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
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