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
Brian Gardner
August 27, 2018
Technology
91
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
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
930
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
370
「エーアイ」をバズワードにしないために RPA 導入経験と Kiro 上での Claude モデル利用経験から
kazzpapa3
0
110
夫婦で子育てするための育児標準化
codmoninc
PRO
0
520
「私が一番顧客に詳しい」を捨てる~ 全員が一次情報に精通する開発チームをつくり、PMが次のボトルネックへ染み出すまで
kaminashi
1
450
NDIでApple Vision Proにリアルタイム映像送信
jyouryuusui
0
140
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
210
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
170
sue445's proposals 2026
sue445
0
120
その Valkey 使いこなしていますか?
onk
PRO
5
1.7k
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
150
ウォンテッドリーの最近のプロダクトと技術の紹介
stomk
0
290
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
1.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Side Projects
sachag
456
43k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
How to Ace a Technical Interview
jacobian
280
24k
Between Models and Reality
mayunak
4
500
Automating Front-end Workflow
addyosmani
1369
210k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
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