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
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
OTP を自動で入力する裏技
megabitsenmzq
0
120
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
370
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
150
『Kubernetes ☸️ で実践する Platform Engineering 』を最高速度で読み抜いたる!!👊🏻
hiroki_hasegawa
0
100
Windows on Ryzen and I
seosoft
0
350
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
170
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
190
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
900
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
150
How to stabilize UI tests using XCTest
akkeylab
0
140
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
640
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
300
sira's awesome portfolio website redesign presentation
elsirapls
0
200
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
480
Scaling GitHub
holman
464
140k
Un-Boring Meetings
codingconduct
0
230
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
210
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
52k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
200
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