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
72
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.8k
Ruby's Killer Feature: The Community
csexton
0
95
Other Decks in Technology
See All in Technology
ECS障害を例に学ぶ、インシデント対応に備えたAIエージェントの育て方 / How to develop AI agents for incident response with ECS outage
iselegant
2
190
Greatest Disaster Hits in Web Performance
guaca
0
280
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.4k
コンテナセキュリティの最新事情 ~ 2026年版 ~
kyohmizu
6
1.2k
20260208_第66回 コンピュータビジョン勉強会
keiichiito1978
0
190
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
93k
StrandsとNeptuneを使ってナレッジグラフを構築する
yakumo
1
120
SRE Enabling戦記 - 急成長する組織にSREを浸透させる戦いの歴史
markie1009
0
170
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
740
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
6
2.8k
20260204_Midosuji_Tech
takuyay0ne
1
160
【Oracle Cloud ウェビナー】[Oracle AI Database + AWS] Oracle Database@AWSで広がるクラウドの新たな選択肢とAI時代のデータ戦略
oracle4engineer
PRO
2
180
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
260
Into the Great Unknown - MozCon
thekraken
40
2.3k
Why Our Code Smells
bkeepers
PRO
340
58k
Un-Boring Meetings
codingconduct
0
200
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
330
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
WENDY [Excerpt]
tessaabrams
9
36k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
130
Crafting Experiences
bethany
1
50
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
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