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
3 Steps Every Test Should Take
Search
Matheus Richard
May 27, 2021
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
3 Steps Every Test Should Take
Matheus Richard
May 27, 2021
More Decks by Matheus Richard
See All by Matheus Richard
The Fast Lane: Asynchronous Rails
matheusrich
0
81
Build in Private
matheusrich
0
75
Start TDDing in 5 minutes
matheusrich
0
130
Taming God Objects: easy, incremental and secure
matheusrich
1
140
Stimulus 2.0-alpha - What's new?
matheusrich
0
57
BEM - A simple CSS methodology
matheusrich
0
56
De Repente 7
matheusrich
0
23
Other Decks in Programming
See All in Programming
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
150
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
280
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
370
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
180
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
130
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
940
Jetpack Compose Mechanisms
skydoves
3
870
No More NoSuchMethodError
exoego
1
110
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
200
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.8k
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
460
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
720
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
350
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
310
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
580
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
The SEO identity crisis: Don't let AI make you average
varn
0
600
Color Theory Basics | Prateek | Gurzu
gurzu
1
490
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
440
We Have a Design System, Now What?
morganepeng
55
8.4k
Transcript
3 Steps Every Test Should Take
About me Matheus Richard
This is a ⚡lightning talk⚡, so I’m gonna go FAST
💨
🧪 Tests
😄 Tests are good! They make us more productive. Right?
❌ WRONG!
✔Good tests are good
🐢 Poorly written tests slow us down!
Developer happiness-meter: 🙁 🐌 Slow tests
Developer happiness-meter: 😞 🤔 Confusing tests 🐌 Slow tests
Flaky tests Developer happiness-meter: 😠 🤔 Confusing tests 🐌
Slow tests
Flaky tests Developer happiness-meter: 🤬 🤔 Confusing tests 📦
Brittle tests 🐌 Slow tests
🐌 Slow tests Flaky tests 📦 Brittle tests 🤔
Confusing tests
Good tests tell a story
The story has 4 acts
📝 1. Setup
📝 1. Setup Create objects Define function inputs
📝 1. Setup 🏋 2. Exercise
📝 1. Setup 🏋 2. Exercise Calling methods Saving objects
to DB
📝 1. Setup 🏋 2. Exercise 3. Verify
📝 1. Setup 🏋 2. Exercise 3. Verify Check
if the output is the expected
📝 1. Setup 3. Verify 🏋 2. Exercise 💥
4. Teardown
📝 1. Setup 3. Verify 🏋 2. Exercise 💥
4. Teardown Undo changes Release memory Restore DB
📝 1. Setup 🏋 2. Exercise 3. Verify 💥
4. Teardown You’re welcome!
📝 1. Setup 3. Verify 🏋 2. Exercise
📝 1. Arrange 3. Assert 🏋 2. Act aka
📝 1. Given 3. Then 🏋 2. When aka
None
None
None
🤨 Why is this good?
Consistency
None
None
None
None
E X E R C I S E
Tests are self-contained. No mystery guests here
None
1. Verify Developer confusion-meter: 🤔❓
1. Verify 2. Exercise + Setup Developer confusion-meter: 🥴⁉
1. Verify 2. Exercise + Setup? 3. Verify Developer confusion-meter:
😵
Developer confusion-meter: 😵
Developer happiness-meter: 🥰
SPACE IS IMPORTANT Developer happiness-meter: 🥰
Developer happiness-meter: 😐
Developer happiness-meter: 🥰
Good tests have 4 3 steps
📝 1. Setup
📝 1. Setup 🏋 2. Exercise
📝 1. Setup 3. Verify 🏋 2. Exercise
We need not only tests, but good tests!
We want good code and tests are code too!
That’s it Feel free to ask any question