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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Christopher Sexton
June 07, 2014
Technology
77
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
7k
Ruby's Killer Feature: The Community
csexton
0
99
Other Decks in Technology
See All in Technology
CSに"SLO"は要らない、経営層に"99.9%"は伝わらない - SREを全社に"翻訳"する3原則
cscengineer
PRO
1
4.6k
人を動かすのは時間ではなく、納得感 〜新任EMが入社3ヶ月、組織を2回変えた話〜
kakehashi
PRO
3
220
シンガポールで登壇してきます
yama3133
0
130
Kaggleで成長するために意識したこと
prgckwb
2
340
ZOZOTOWNの進化と信頼性を両立する負荷試験
zozotech
PRO
2
160
しくみを学んで使いこなそう GitHub Copilot app
torumakabe
2
240
クラウド上のデータ復旧で見落としがちな制約: 医療系 SaaS の BCP 設計から得た教訓
kakehashi
PRO
0
3.5k
SRE Lounge Hiroshimaへの招待
grimoh
0
640
しぶいSRE: サーバから見えない障害にどう向き合うか。ラストワンマイルのデバッグ実践 / Shibui SRE
kanny
13
6.1k
Amplify Gen2でbackend.tsにCDKを定義する/しない事によるCDKの挙動の違いとユースケース
smt7174
0
140
はじめてのWDM
miyukichi_ospf
1
140
ローカルLLMとLINE Botの組み合わせ その3 / LINE DC Generative AI Meetup #8
you
PRO
0
130
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.4k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
260
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
480
BBQ
matthewcrist
89
10k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
460
4 Signs Your Business is Dying
shpigford
187
22k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
560
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Automating Front-end Workflow
addyosmani
1370
210k
The agentic SEO stack - context over prompts
schlessera
0
840
Chasing Engaging Ingredients in Design
codingconduct
0
230
A Modern Web Designer's Workflow
chriscoyier
698
190k
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