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
Eeek, my tests are mutating
Search
Lander Vanderstraeten
November 07, 2017
Programming
120
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Eeek, my tests are mutating
Presentation given for
https://www.meetup.com/phpgent/events/242279704
Lander Vanderstraeten
November 07, 2017
Other Decks in Programming
See All in Programming
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
7
2.2k
typoなんかねぇよ
raspython3
0
610
信頼性の目標を誰も求めてない
shubox
0
240
Press start. Python's next generation.
willingc
PRO
3
250
Cloudflare is Agents
chimame
0
180
高専キャリア LT 発表内容
crysta1221
4
4.3k
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
36
22k
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
230
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
120
[PyCon KR 2026] More Variants, More Diversity for AI Accelerators
achimnol
0
120
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
350
VibeCodingからAgenticWorkflowへ
starfish719
0
940
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Facilitating Awesome Meetings
lara
57
7.1k
Deep Space Network (abreviated)
tonyrice
0
270
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
450
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Skip the Path - Find Your Career Trail
mkilby
1
200
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
690
Building Applications with DynamoDB
mza
96
7.2k
The agentic SEO stack - context over prompts
schlessera
0
880
Done Done
chrislema
186
16k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Transcript
HI, I'M LANDER VANDERSTRAETEN 1
3 QUIZ QUESTIONS 2
WHO THINKS UNIT TESTS ARE WASTE OF TIME? 3
4
WHO ALWAYS WRITES UNIT TESTS? 5
6
WHO ALREADY USES MUTATION TESTING? 7
8
CODE HAS BUGS TESTS ARE CODE TESTS HAVE BUGS! 9
10
TESTS ARE A GOOD TOOL TO VERIFY YOUR CODE BUT
HOW DO YOU VERIFY YOUR TESTS? 11
CODE COVERAGE IS A START, BUT IT CAN GIVE A
“GOOD” SCORE WITH USELESS TESTS 12
ALL TESTS PASSED! 13
HOW WE DETECT? 14
MUTATION TESTING 15
Mutation testing is a technique to evaluate the quality of
your tests by programmatically mutating and making a series of small modifications to your code so that the tests no longer pass. 16
17
IF BUGS ARE CRIMES AND YOUR TESTS ARE THE POLICE
MUTATIONS ARE FAKE CRIMES THAT LET YOU SEE THE POLICE IS DOING THEIR JOB 18
TO ASSESS THE QUALITY OF A GIVEN TEST, MUTANTS ARE
EXECUTED AGAINST THE INPUT TEST TO SEE IF THE SEEDED FAULTS CAN BE DETECTED. 19
MUTATION, MUTANTS, MUTAFUCK WHAT? 20
Each mutated version: Mutant Mutated program + failing tests: killed
mutant Mutated program + passed tests: escaped mutant 21
MEASURE ALL THE THINGS! 22
Test suites are measured by the percentage of mutants that
they kill. New tests can be designed to kill additional mutants. 23
HOW DOES IT MODIFY? 24
MUTATORS 25
EXAMPLE public function foobar(int $number): int { return $number +
1; // original } public function foobar(int $number): int { return $number - 1; // mutated version } 26
ANOTHER EXAMPLE public function foobar(?Bar $foo): string { if (null
=== $foo) { // original return 'foo'; } // ... } public function foobar(?Bar $foo): string { if (null !== $foo) { // mutated version return 'foo'; } // ... } 27
DEMO TIME WITH INFECTION 28
WHAT DID WE LEARN TODAY? 29
1. Always write unit tests 2. Code coverage gives a
false positive feeling 3. Mutation testing also gives a false positive feeling 30
QUESTIONS? 31