Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Rethinking Testing for React Applications
Search
Tommy Graves
March 20, 2019
Programming
59
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rethinking Testing for React Applications
Tommy Graves
March 20, 2019
More Decks by Tommy Graves
See All by Tommy Graves
Building a Production-Ready React Native App
tagraves
1
150
Fiber or Glimmer?
tagraves
0
31
Learning to Learn From Disagreement
tagraves
0
100
Other Decks in Programming
See All in Programming
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
280
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
ChromeでローカルLLM
ryu1013
0
140
contenteditable と日本語入力に向き合う
colorful12
0
200
残高管理から台帳サービスへの進化
artoy
1
200
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
R8 の設定見直しでアプリサイズ削減
andpad
0
220
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
6.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
The agentic SEO stack - context over prompts
schlessera
0
970
Crafting Experiences
bethany
1
380
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
Six Lessons from altMBA
skipperchong
29
4.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
YesSQL, Process and Tooling at Scale
rocio
174
15k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
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]