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
62
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
Transcript
28 slides
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]
More Decks by Tommy Graves
See All by Tommy Graves
Building a Production-Ready React Native App
tagraves
1
160
Fiber or Glimmer?
tagraves
0
32
Learning to Learn From Disagreement
tagraves
0
110
Other Decks in Programming
See All in Programming
小さなアプリを作って公開するまで
onozaty
0
250
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
170
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1.1k
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
210
高速開発を止めずに 性能を上げる Flyleのシステム刷新と改善の歴史
azihsoyn
0
110
JavaScriptはシングルバイナリの夢を見るか / Does JavaScript Dream of a Single Binary?
ssssota
0
200
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
410
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
700
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
340
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
1
250
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.3k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
670
New Earth Scene 8
popppiees
5
2.9k
Product Roadmaps are Hard
iamctodd
55
13k
The Language of Interfaces
destraynor
162
27k
How to Think Like a Performance Engineer
csswizardry
28
3k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
680
Side Projects
sachag
456
43k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.9k
Done Done
chrislema
187
17k