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
Rethinking Testing for React Applications
Search
Tommy Graves
March 20, 2019
Programming
0
50
Rethinking Testing for React Applications
Tommy Graves
March 20, 2019
Tweet
Share
More Decks by Tommy Graves
See All by Tommy Graves
Building a Production-Ready React Native App
tagraves
1
140
Fiber or Glimmer?
tagraves
0
25
Learning to Learn From Disagreement
tagraves
0
98
Other Decks in Programming
See All in Programming
ぼくの開発環境2026
yuzneri
0
110
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
CSC307 Lecture 03
javiergs
PRO
1
490
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.8k
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
Package Management Learnings from Homebrew
mikemcquaid
0
210
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
20
6.8k
MUSUBIXとは
nahisaho
0
130
組織で育むオブザーバビリティ
ryota_hnk
0
170
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
250
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
55
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
430
The Pragmatic Product Professional
lauravandoore
37
7.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Claude Code のすすめ
schroneko
67
210k
Abbi's Birthday
coloredviolet
1
4.7k
Automating Front-end Workflow
addyosmani
1371
200k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
Transcript
Rethinking Testing for React Applications
Tommy Graves Lead Software Engineer, New Channels !2 Twitter: @TAGraves
Email:
[email protected]
• High level discussion of what testing is for •
Three antipatterns that tests can fall into • The big reveal: a testing pattern that avoids those antipatterns !3 A quick overview
• To prevent defects in new code • To ensure
changes don't break existing functionality • To document the intention of the authors of a section of code • To drive the implementation of code? !4 Why do we test?
!5 Testing is about confidence!
What leads to confidence? !6
What leads to confidence? !7
Antipattern #1: Testing implementation details instead of behavior !8
Can the tests fail, but the code work? !9
The hooks rule !10
Antipattern #2: Testing the code instead of the application !11
Can the tests pass, but the code not work? !12
The machine- generated rule !13
Antipattern #3: Testing in isolation (for isolation's sake) !14
Do your tests care about how things really work? !15
!16 The testing pyramid Unit Tests: • Fast • Deterministic
• Easy to write • Easy to diagnose • Isolated confidence Integration Tests: • Slow • Flaky • Hard to write • Hard to diagnose • Overall confidence
!17 Mocks are trade-offs Mocks make tests: • Faster •
More deterministic • Easier to write • Easier to diagnose • Less confidence-giving
!18 Testing is about confidence!
!19 Rethinking Integration Integration tests can be • Fast •
Deterministic • Easy to write
The TDD rule !20
!21 • Testing implementation details instead of behavior • Testing
the code instead of the application • Testing in isolation (for isolation's sake) The three antipatterns
!22 React Testing Library
What leads to confidence? !23
Testing from the user's perspective !24
!25 Test-Driven UI Development
!26
Confidential – for internal use only !27
Thank you!
[email protected]