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
3 Steps Every Test Should Take
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Matheus Richard
May 27, 2021
Programming
110
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
79
Build in Private
matheusrich
0
74
Start TDDing in 5 minutes
matheusrich
0
120
Taming God Objects: easy, incremental and secure
matheusrich
1
130
Stimulus 2.0-alpha - What's new?
matheusrich
0
56
BEM - A simple CSS methodology
matheusrich
0
56
De Repente 7
matheusrich
0
22
Other Decks in Programming
See All in Programming
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
150
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
340
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
420
DroidKaigi 2026 「個人開発という実験場: Android エンジニアが手にする4つの自由」
slashnephy
0
220
ALB ログから Trace を気合で繋げる技術
fohte
7
870
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
630
「AI時代、配布するPythonコードをどう守るか: 難読化の実験と判断軸」 #PyconJP2026
pkshadeck
PRO
2
170
不幸な GC
chencmd
0
880
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
160
이 함수, 실패하면 어떻게 되나요? null부터 Rich Errors까지, Kotlin 에러 처리 15년
haeti2
0
130
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
560
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
108
250k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
Practical Orchestrator
shlominoach
191
12k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
520
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
600
Making the Leap to Tech Lead
cromwellryan
135
10k
Technical Leadership for Architectural Decision Making
baasie
3
550
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