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
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
生成AIの利用とセキュリティ /gen-ai-and-security
mizutani
1
1.2k
Lookerの最新バージョンv26.2がやばい話
waiwai2111
1
160
ビズリーチにおける検索・推薦の取り組み / DEIM2026
visional_engineering_and_design
1
100
EMからICへ、二周目人材としてAI全振りのプロダクト開発で見つけた武器
yug1224
4
400
メタデータ同期に潜んでいた問題 〜 Cache Stampede 時の Cycle Wait を⾒つけた話
lycorptech_jp
PRO
0
150
マネージャー版 "提案のレベル" を上げる
konifar
19
12k
白金鉱業Meetup_Vol.22_Orbital Senseを支える衛星画像のマルチモーダルエンベディングと地理空間のあいまい検索技術
brainpadpr
2
210
Kaggleの経験が実務にどう活きているか / kaggle_findy
sansan_randd
4
760
Claude Codeの進化と各機能の活かし方
oikon48
11
3.2k
OpenClawで回す組織運営
jacopen
2
450
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4k
Master Dataグループ紹介資料
sansan33
PRO
1
4.4k
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
22k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
140
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
430
Become a Pro
speakerdeck
PRO
31
5.8k
Done Done
chrislema
186
16k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
The agentic SEO stack - context over prompts
schlessera
0
680
Accessibility Awareness
sabderemane
0
73
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
140
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