Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Who watches the watchmen: testing our tests
Search
Maria Clara Santana
July 05, 2018
Programming
1
210
Who watches the watchmen: testing our tests
The talk was given at JS Experience 2018.
https://eventos.imasters.com.br/jsexperience
Maria Clara Santana
July 05, 2018
Tweet
Share
More Decks by Maria Clara Santana
See All by Maria Clara Santana
You might also like...
olarclara
0
160
Accessibility beyond the aria-label
olarclara
1
200
React nas Trincheiras
olarclara
3
310
ImmutableJS 101
olarclara
0
120
Other Decks in Programming
See All in Programming
俺流レスポンシブコーディング 2025
tak_dcxi
14
9.4k
TestingOsaka6_Ozono
o3
0
170
生成AI時代を勝ち抜くエンジニア組織マネジメント
coconala_engineer
0
350
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
110
AIエージェントの設計で注意するべきポイント6選
har1101
5
2k
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
150
AIコーディングエージェント(skywork)
kondai24
0
200
Navigating Dependency Injection with Metro
l2hyunwoo
1
170
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.2k
GISエンジニアから見たLINKSデータ
nokonoko1203
0
180
Developing static sites with Ruby
okuramasafumi
0
320
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
3
1.3k
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
340
Making Projects Easy
brettharned
120
6.5k
Test your architecture with Archunit
thirion
1
2.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.7k
We Are The Robots
honzajavorek
0
120
Statistics for Hackers
jakevdp
799
230k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
What's in a price? How to price your products and services
michaelherold
246
13k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
190
Transcript
“WHO WATCHES THE WATCHMEN” Testing our tests Maria C. Santana
JS Experience ‘18
Maria Clara • Front-end Developer @ Picter • Live Coding
Instructor @ Udacity • Likes dogs and sparkling water
Types of software errors • Construction errors; • Specification errors;
• Design errors; • Requirements errors; Toward a theory of test data selection, Softech Inc.
BLACK-BOX TESTING
Input Output
None
None
•Pro: Allows to check the functionality of a program without
worrying with the structure behind it; •Con: Does not offer insights about the tested program’s structure;
High code coverage !== Effective Test Suite
Source: https://gph.is/1jE2Wzg
None
None
Take it with a grain of salt.
“Quis custodiet ipsos custodes?” Satires, 2a.c.
WHITE-BOX TESTING
Input Output
None
None
•Pro: More thorough tests; •Con: Can be complex and require
a lot of work due to implementation changes;
MUTATION TESTING
CONCEPT
#1 STEP Test data Original code
•If it fails, then the original program is wrong; •If
it passes, then we should proceed with creating mutants;
#2 STEP Test data N modified versions of the original
code
•#1: given the test data, the modified versions have different
outputs from the original one; •#2: some (or all of them) versions have the same output of the original one;
MUTATORS TYPES
Not this kind, though…
AAR (array for array replacement)
ABS (absolute value insertion)
AOR (arithmetic operator replacement)
UOI (unary operation insertion)
Many others… • Array constant replacement; • Logical connector replacement;
• Relational operator replacement; • Constant replacement; • Return statement replacement; • Statement deletion; • …
EXAMPLE
Original program
Test suite
Mutant #1 - Conditional operator replacement
Mutant #1 - Test suite results Mutant was killed!
Mutant #2 - Conditional operator replacement
Mutant #2 - Test suite results Mutant has survived… ☹
EQUIVALENT MUTANTS
None
Mutant #3 - Return statement replacement
Mutant #3 - Test suite results Mutant was killed!
mutation score = mutants killed / total of mutants; ->
100%
TOOLS
https://stryker-mutator.io/
Trade-offs •Open-source; •Active maintenance and improvements; •Supports most of the
mainstream runners (karma, jasmine, jest, …); •Does not support React;
Other languages… • Python: https://github.com/mutpy/mutpy; • Ruby: https://github.com/mbj/mutant; • Java:
https://github.com/hcoles/pitest;
PROS
•Application safety; •Evaluation of edge cases; •Better test design;
CONS
•High computational costs; •Filtering equivalent mutants is still a non-optimal
task;
Q&A
THANKS! olarclara.github.io