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
1
65
Mocks and Stubs and Spies, oh my!
Slides from my introduction to test doubles talk given at DroidCon NYC
Brian Gardner
August 27, 2018
Tweet
Share
More Decks by Brian Gardner
See All by Brian Gardner
GoogleMap DroidCon SF 23
briangardnerdev
0
2.3k
Mocks and Stubs and Spies, oh my!
briangardnerdev
1
220
Take a stab at test friendly architecture
briangardnerdev
1
160
Other Decks in Technology
See All in Technology
「使いにくい」も「運用疲れ」も卒業する UIデザイナーとエンジニアが創る持続可能な内製開発
nrinetcom
PRO
1
510
2026年のAIエージェント構築はどうなる?
minorun365
12
2.7k
AIエンジニア Devin と歩む、自律型運用プロセスの構築
a2ito
0
270
社内でAWS BuilderCards体験会を立ち上げ、得られた気づき / 20260225 Masaki Okuda
shift_evolve
PRO
1
150
三菱UFJ銀行におけるエンタープライズAI駆動開発のリアル / Enterprise AI_Driven Development at MUFG Bank: The Real Story
muit
10
20k
20260222ねこIoTLT ねこIoTLTをふりかえる
poropinai1966
0
300
生成AI活用によるPRレビュー改善の歩み
lycorptech_jp
PRO
4
1.7k
クラウド時代における一時権限取得
krrrr38
1
130
APMの世界から見るOpenTelemetryのTraceの世界 / OpenTelemetry in the Java
soudai
PRO
0
200
Serverless Agent Architecture on Azure / serverless-agent-on-azure
miyake
1
110
AI活用を"目的"にしたら、データの本質が見えてきた - Snowflake Intelligence実験記 / chasing-ai-finding-data
pei0804
0
810
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
95k
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
100
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
62
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
130
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
470
How to Think Like a Performance Engineer
csswizardry
28
2.5k
The Spectacular Lies of Maps
axbom
PRO
1
570
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
470
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