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
64
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.1k
Ruby's Killer Feature: The Community
csexton
0
76
Other Decks in Technology
See All in Technology
MLOpsの「壁」を乗り越える、LINEヤフーの Data Quality as Code
lycorptech_jp
PRO
5
530
本当のAWS基礎
toru_kubota
0
520
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
120
リテール金融(キャッシュレス・ネット銀行・ネット証券)の競争環境と経済圏
8maki
0
1.2k
EMとして2023年度に頑張ったこと / What we did well in FY2023 as a EM
pauli
1
170
Cracking the KubeCon CfP
inductor
2
250
自己改善からチームを動かす! 「セルフエンジニアリングマネージャー」のすゝめ
shoota
6
740
非同期推論システムによるコスト削減と信頼性向上
koki_nishihara
0
260
IaCジェネレーターとBedrockで詳細設計書を生成してみた
tsukasa_ishimaru
1
270
JSON攻略法.pdf
miyakemito
8
5.1k
「スニダン」開発組織の構造に込めた意図 ~組織作りはパッションや政治ではない!~
rinchsan
3
570
On Your Data を超えていく!
hirotomotaguchi
2
690
Featured
See All Featured
Writing Fast Ruby
sferik
621
60k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
2
3.4k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
19
1.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
31
46k
Code Review Best Practice
trishagee
55
15k
In The Pink: A Labor of Love
frogandcode
138
21k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
60
14k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Rebuilding a faster, lazier Slack
samanthasiow
73
8.2k
The Power of CSS Pseudo Elements
geoffreycrofte
60
5k
Art, The Web, and Tiny UX
lynnandtonic
289
19k
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