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
83
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
240
Take a stab at test friendly architecture
briangardnerdev
1
170
Other Decks in Technology
See All in Technology
Go 1.27 の標準パッケージに uuid が入った!のでいろいろ喋る / go_127_std_go_uuid
convto
3
540
老害フォレンジッカーはAI羊の夢を見るか?
tadmaddad
0
360
長期運営で肥大化したExcelマスターデータの解消に向けた移行事例
gree_tech
PRO
0
100
Adding Right-to-Left support to your web application with CSS logical properties — Lessons from Redmine
vividtone
0
160
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
20k
カートの信頼性を担保するWireMockを使ったe2eテスト
ykagano
0
620
社内の7割が使うデータ基盤を、 データチーム2人で回すためにやったこと
koh_yoshi
4
1.5k
自宅NWにISR4331を導入してみた話
okaits
0
120
AI開発に用いられるHPC技術について
gpuunite_official
0
180
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.6k
Genie Codeハンズオン応用編
taka_aki
0
130
ハッカソンで入賞した話 @ Findy LT
asari194617
0
1.4k
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.5k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
580
The Language of Interfaces
destraynor
162
27k
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Un-Boring Meetings
codingconduct
0
390
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
950
The Curse of the Amulet
leimatthew05
2
14k
Documentation Writing (for coders)
carmenintech
77
5.5k
How to train your dragon (web standard)
notwaldorf
97
6.8k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
430
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
300
Google's AI Overviews - The New Search
badams
0
1.1k
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