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
PdM業務における使い分け
shinshiro
0
590
Ktor + Google Cloud Tasks/PubSub におけるOTel Messaging計装の実践
sansantech
PRO
1
280
OpenTelemetry の Log を使いこなそう
biwashi
5
1k
2025/07/22_家族アルバム みてねのCRE における生成AI活用事例
masartz
2
110
大規模組織にAIエージェントを迅速に導入するためのセキュリティの勘所 / AI agents for large-scale organizations
i35_267
6
220
AI駆動開発 with MixLeap Study【大阪支部 #3】
lycorptech_jp
PRO
0
210
組織内、組織間の資産保護に必要なアイデンティティ基盤と関連技術の最新動向
fujie
0
510
室長の逆襲 :データ活用の陣地を増やすためのヒント
masatoshi0205
0
190
Shadow DOMとセキュリティ - 光と影の境界を探る / Shibuya.XSS techtalk #13
masatokinugawa
0
270
Expertise as a Service via MCP
yodakeisuke
1
150
経験がないことを言い訳にしない、 AI時代の他領域への染み出し方
parayama0625
0
160
Talk to Someone At Delta Airlines™️ USA Contact Numbers
travelcarecenter
0
170
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Visualization
eitanlees
146
16k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Thoughts on Productivity
jonyablonski
69
4.7k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Why Our Code Smells
bkeepers
PRO
337
57k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
21
1.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
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