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
Matheus Richard
May 27, 2021
Programming
0
98
3 Steps Every Test Should Take
Matheus Richard
May 27, 2021
Tweet
Share
More Decks by Matheus Richard
See All by Matheus Richard
The Fast Lane: Asynchronous Rails
matheusrich
0
53
Build in Private
matheusrich
0
72
Start TDDing in 5 minutes
matheusrich
0
110
Taming God Objects: easy, incremental and secure
matheusrich
1
110
Stimulus 2.0-alpha - What's new?
matheusrich
0
52
BEM - A simple CSS methodology
matheusrich
0
52
De Repente 7
matheusrich
0
17
Other Decks in Programming
See All in Programming
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
760
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
240
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
360
文字コードの話
qnighy
44
17k
株式会社 Sun terras カンパニーデック
sunterras
0
2.1k
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
170
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
230
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
110
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
510
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
110
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
410
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
140
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
21k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Code Review Best Practice
trishagee
74
20k
Embracing the Ebb and Flow
colly
88
5k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
150
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.3k
HDC tutorial
michielstock
1
530
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
290
Optimising Largest Contentful Paint
csswizardry
37
3.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
480
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
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