Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.5k
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
390
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
38
26k
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
250
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
2.7k
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
510
エディターってAIで操作できるんだぜ
kis9a
0
730
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
0
170
ゲームの物理 剛体編
fadis
0
350
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
410
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
730
Statistics for Hackers
jakevdp
799
230k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
For a Future-Friendly Web
brad_frost
180
10k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
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]