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
66
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.4k
Ruby's Killer Feature: The Community
csexton
0
89
Other Decks in Technology
See All in Technology
CNAPPから考えるAWSガバナンスの実践と最適化
yuobayashi
5
780
private spaceについてあれこれ調べてみた
operando
1
230
Autify Company Deck
autifyhq
2
41k
Postman Vaultを使った秘密情報の安全な管理
nagix
3
230
技術的負債解消の取り組みと専門チームのお話 #技術的負債_Findy
bengo4com
1
1k
Ask! NIKKEIの運用基盤と改善に向けた取り組み / NIKKEI TECH TALK #30
kaitomajima
1
390
What's New in OpenShift 4.18
redhatlivestreaming
0
1k
データ基盤の成長を加速させる:アイスタイルにおける挑戦と教訓
tsuda7
3
600
Classmethod AI Talks(CATs) #15 司会進行スライド(2025.02.06) / classmethod-ai-talks-aka-cats_moderator-slides_vol15_2025-02-06
shinyaa31
0
140
FastConnect の冗長性
ocise
1
9.5k
プロセス改善による品質向上事例
tomasagi
0
170
20250130_『SUUMO』の裏側!第2弾 ~機械学習エンジニアリング編
recruitengineers
PRO
1
680
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Fireside Chat
paigeccino
34
3.2k
How to Ace a Technical Interview
jacobian
276
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Speed Design
sergeychernyshev
25
770
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Embracing the Ebb and Flow
colly
84
4.6k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.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