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
Brian Gardner
August 27, 2018
Technology
66
1
Share
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.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
スクラムを支える内部品質の話
iij_pr
0
260
AI時代に新卒採用、はじめました/junior-engineer-never-die
dmnlk
0
120
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
11k
Goビルドを理解し、 CI/CDの高速化に挑む
satoshin
0
130
「活動」は激変する。「ベース」は変わらない ~ 4つの軸で捉える_AI時代ソフトウェア開発マネジメント
sentokun
0
150
20260326_AIDD事例紹介_ULSC.pdf
findy_eventslides
0
520
スケーリングを封じられたEC2を救いたい
senseofunity129
0
140
TanStack Start エコシステムの現在地 / TanStack Start Ecosystem 2026
iktakahiro
1
290
ログ基盤・プラグイン・ダッシュボード、全部整えた。でも最後は人だった。
makikub
1
220
OpenClawでPM業務を自動化
knishioka
2
390
プロダクトを育てるように生成AIによる開発プロセスを育てよう
kakehashi
PRO
1
620
プロダクトを触って語って理解する、チーム横断バグバッシュのすすめ / 20260411 Naoki Takahashi
shift_evolve
PRO
0
110
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Utilizing Notion as your number one productivity tool
mfonobong
4
280
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
94
エンジニアに許された特別な時間の終わり
watany
106
240k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
240
Technical Leadership for Architectural Decision Making
baasie
3
310
Un-Boring Meetings
codingconduct
0
250
Building Adaptive Systems
keathley
44
3k
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