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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Christopher Sexton
June 07, 2014
Technology
74
0
Share
My Tests are a Mess: The Other Junk Drawer
Slides from RubyNation
Christopher Sexton
June 07, 2014
More Decks by Christopher Sexton
See All by Christopher Sexton
Unraveling the Cable: How Action Cable Works
csexton
1
6.9k
Ruby's Killer Feature: The Community
csexton
0
95
Other Decks in Technology
See All in Technology
[OpsJAWS 40]リリースしたら終わり、じゃなかった。セキュリティ空白期間をAWS Security Agentで埋める
sh_fk2
3
190
AI時代にデータ基盤が持つべきCapabilityを考える + Snowflake Data Superheroやっていき宣言 / Considering the Capabilities Data Platforms Should Have in the AI Era + Declaration of Commitment as a Snowflake Data Superhero
civitaspo
0
110
DevOpsDays Tokyo 2026 軽量な仕様書と新たなDORA AI ケイパビリティで実現する、動くソフトウェアを中心とした開発ライフサイクル / DevOpsDays Tokyo 2026
n11sh1
0
140
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
5
14k
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.3k
AI駆動1on1〜AIに自分を育ててもらう〜
yoshiakiyasuda
0
110
JOAI2026講評会資料(近藤佐介)
element138
1
150
終盤で崩壊させないAI駆動開発
j5ik2o
2
2.2k
新メンバーのために、シニアエンジニアが環境を作る時代
puku0x
0
1.1k
ネットワーク運用を楽にするAWS DevOps Agent活用法!! / 20260421 Masaki Okuda
shift_evolve
PRO
2
170
JEDAI in Osaka 2026イントロ
taka_aki
0
230
幾億の壁を超えて/Beyond Countless Walls(JP)
ikuodanaka
0
130
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
790
Thoughts on Productivity
jonyablonski
76
5.1k
The Invisible Side of Design
smashingmag
302
51k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
98
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
180
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
53k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
340
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
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