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
49
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
24
Learning to Learn From Disagreement
tagraves
0
98
Other Decks in Programming
See All in Programming
エンジニアインターン「Treasure」とHonoの2年、そして未来へ / Our Journey with Hono Two Years at Treasure and Beyond
carta_engineering
0
390
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
1
340
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
6
3.3k
Introduce Hono CLI
yusukebe
6
3k
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
33k
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
2
650
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
630
Devoxx BE 2025 Loom lab
josepaumard
0
110
AkarengaLT vol.38
hashimoto_kei
1
110
All About Angular's New Signal Forms
manfredsteyer
PRO
0
200
Go言語はstack overflowの夢を見るか?
logica0419
0
510
テーブル定義書の構造化抽出して、生成AIでDWH分析を試してみた / devio2025tokyo
kasacchiful
0
250
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
115
20k
GitHub's CSS Performance
jonrohan
1032
470k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
22k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Thoughts on Productivity
jonyablonski
70
4.9k
Automating Front-end Workflow
addyosmani
1371
200k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
920
Designing for humans not robots
tammielis
254
26k
Being A Developer After 40
akosma
91
590k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
How STYLIGHT went responsive
nonsquared
100
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]