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
Mocks and Stubs and Spies, oh my!
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Brian Gardner
August 27, 2018
Technology
84
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Mocks and Stubs and Spies, oh my!
Slides from my introduction to test doubles talk given at DroidCon NYC
Brian Gardner
August 27, 2018
More Decks by Brian Gardner
See All by Brian Gardner
GoogleMap DroidCon SF 23
briangardnerdev
0
2.4k
Mocks and Stubs and Spies, oh my!
briangardnerdev
1
240
Take a stab at test friendly architecture
briangardnerdev
1
170
Other Decks in Technology
See All in Technology
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
2
110
WAF 運用改善の承認サイクル/SRE_BizReach_MIXI_1
visional_engineering_and_design
1
360
少人数データチームのDevin活用実践事例
runandy16
2
450
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
170
生成AI時代の クレデンシャルとパーミッション設計
nrinetcom
PRO
4
1.6k
Tab5をRubyで動くパソコンにする
kishima
2
250
V8コントリビュート超入門
riyaamemiya
0
150
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
120
全員がプロダクトへ向き合う組織を持続成長させるために——組織づくりのフライホイールと4象限 / The Flywheel Model and Four Quadrants for Organizational Design
hiro_torii
4
900
【視聴者参加型!】AWSセキュリティアンチパターンクイズ
syoshie
0
450
Bet AI Day 2026丨How We Bet AI: AIとともに働く場をつくる
layerx
PRO
2
2.8k
Guerilla InnerSource in enterprises, during the AI hype
onenashev
PRO
0
150
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Automating Front-end Workflow
addyosmani
1369
210k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
4 Signs Your Business is Dying
shpigford
187
23k
30 Presentation Tips
portentint
PRO
1
390
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
A Soul's Torment
seathinner
7
3.6k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Code Review Best Practice
trishagee
74
20k
Transcript
Mocks and Stubs and Spies, Oh My! Brian Gardner
Test Double Hierarchy Test Doubles Mock Fake Spy Stub Dummy
Types of Tests
When to use Test Doubles? • System under test has
indirect inputs • System under test has indirect outputs • Slow tests*
Indirect Inputs
Indirect Outputs
Slow Tests
Mocks
What is a Mock?
What is a Mock?
What is a Mock?
Mock Types Mocks Strict Lenient
Mock Usage
Mock Usage
Mock Usage
Mock Usage
Stubs
What is a Stub?
What is a Stub?
What is a Stub?
Stub Types Stubs Responder Saboteur Temporary
Stub Usage
Stub Usage
Stub Usage
Stub Usage
Spies
What is a Spy?
Spy Usage
Spy Usage
Spy Usage
Spy Usage
Dummies
What is a Dummy?
What is a Dummy?
Dummy Usage
Dummy Usage
Dummy Usage
Dummy Usage
Fakes
What is a Fake?
Fake Usage
Fake Usage
Fake Usage
Fake Usage
Term Confusion
Mocking Library
Mockito mocks
Mockito Stubs
Mockito Spies
Actual Mockito Spies
Mockito dummies
Mockito Fakes N/A
Recap • Use correct terms for more effective communication •
Match test doubles to the appropriate tests • Don’t over use them
Who am I? Brian Gardner @BrianGardnerAtl