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
My Tests are a Mess: The Other Junk Drawer
Search
Christopher Sexton
June 07, 2014
Technology
0
69
My Tests are a Mess: The Other Junk Drawer
Slides from RubyNation
Christopher Sexton
June 07, 2014
Tweet
Share
More Decks by Christopher Sexton
See All by Christopher Sexton
Unraveling the Cable: How Action Cable Works
csexton
1
6.6k
Ruby's Killer Feature: The Community
csexton
0
89
Other Decks in Technology
See All in Technology
菸酒生在 LINE Taiwan 的後端雙刀流
line_developers_tw
PRO
0
130
Copilot Agentを普段使いしてわかった、バックエンド開発で使えるTips
ykagano
1
400
Grafana MCP serverでなんかし隊 / Try Grafana MCP server
kohbis
0
330
Model Mondays S2E01: Advanced Reasoning
nitya
0
310
QAはソフトウェアエンジニアリングを学んで実践するのが大事なの
ymty
1
380
成立するElixirの再束縛(再代入)可という選択
kubell_hr
0
230
TerraformをSaaSで使うとAzureの運用がこんなに楽ちん!HCP Terraformって何?
mnakabayashi
0
120
基調講演: 生成AIを活用したアプリケーションの開発手法とは?
asei
1
120
IAMのマニアックな話 2025を執筆して、 見えてきたAWSアカウント管理の現在
nrinetcom
PRO
3
530
宇宙パトロール ルル子から考える LT設計のコツ
masakiokuda
2
100
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.2k
(非公式) AWS Summit Japan と 海浜幕張 の歩き方 2025年版
coosuke
PRO
1
180
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Adopting Sorbet at Scale
ufuk
77
9.4k
BBQ
matthewcrist
89
9.7k
Building Applications with DynamoDB
mza
95
6.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
123
52k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Faster Mobile Websites
deanohume
307
31k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Documentation Writing (for coders)
carmenintech
71
4.9k
Agile that works and the tools we love
rasmusluckow
329
21k
Transcript
None
None
None
The Other Junk Drawer
Long live TDD TDD is Dead
Thanks for your time! Any questions? $ rm -rf ./tests
Hi I am Aaron @cupakromer
Hi I am Chris @crsexton
None
And mess with the folks next door Let’s wake up
Like I did something super amazing On 3, say “woah”
This will really confuse them On 3, say “Moo”
I feel more awake That’s better
My Tests are a Mess
SRSLY How did it get this way?
10,000 ft
None
Goal
Write code that I can understand when I come back
to it in 6 months My Real Goal
Simple
The Plague It’s easy to build something complicated
Complicated vs. Complex
None
What to Test?
Acceptance Keep the business happy. Make things work.
Units Check all the bits and pieces
Units Sandi is a Wizard Magic Tricks of Testing bit.ly/sandi-wizard
In between Controllers Views Form Object Policies
Overlap Wait a second, that won’t work
None
Mise en Place Put your toys away as you go
Directory Structure mirror `/lib` (and `/app`)
Group Logically Put related things close together
Manage Setup Very carefully
Setup
Setup
Setup
Setup
Setup
Setup
Setup
Setup
Tests should help you understand what you need to test
(state) Class declarations tell you what behaviors you need to test
None
Priority
Intent
Habit
None
Awesome Tests “Bad” tests are 100% more awesome than no
tests
None
None
None
Pictures from TeeFury, Woot, Reddit, Disney, United Artists, Lucasfilm and
others. Images used under fair use. See Section 3.3: Use of Images for Peer Conferences of the Fair Use Guidelines for Digital Images http://copyright.lib.utexas.edu/imagguid.html Credits
Classic Arrange Act Assert
Arrange All the necessary preconditions and inputs
Act On the object or method under test
Assert That the expected results occurred