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
Implementation Patterns
denyspoltorak
0
280
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
150
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
650
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
「ブロックテーマでは再現できない」は本当か?
inc2734
0
680
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
500
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
180
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
250
Oxlint JS plugins
kazupon
1
770
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
4
330
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
Featured
See All Featured
Abbi's Birthday
coloredviolet
1
4.7k
How to make the Groovebox
asonas
2
1.9k
Claude Code のすすめ
schroneko
67
210k
Code Reviewing Like a Champion
maltzj
527
40k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
BBQ
matthewcrist
89
10k
Typedesign – Prime Four
hannesfritz
42
2.9k
My Coaching Mixtape
mlcsv
0
46
How to Ace a Technical Interview
jacobian
281
24k
From π to Pie charts
rasagy
0
120
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
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]