Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
89
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
250
Take a stab at test friendly architecture
briangardnerdev
1
170
Other Decks in Technology
See All in Technology
AIエージェントの自己改善をどう設計するか / How to Design Self-Improvement for AI Agents
22mi
23
15k
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
150
データ_AIの事業の勝敗をわけるもの
nek0128
0
350
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
220
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
200
作品が生態系になった ─ Mini Tokyo 3D から世界へ
nagix
0
190
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
400
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
110
Genieを崇めよ
kameitomohiro
0
130
MCPをつなげて作る組織横断のAIエージェント基盤(の開発工程)
tsubakimoto_s
0
130
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
190
Geolonia の開発現場における AIの活用について
miya0001
0
100
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
Claude Code のすすめ
schroneko
67
230k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
380
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
500
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
350
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
800
Building Applications with DynamoDB
mza
96
7.2k
The SEO Collaboration Effect
kristinabergwall1
1
560
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Building AI with AI
inesmontani
PRO
1
1.2k
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