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
79
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
230
Take a stab at test friendly architecture
briangardnerdev
1
160
Other Decks in Technology
See All in Technology
データベース研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
1
720
書籍セキュアAPIについて
riiimparm
0
390
検索技術知識0のエンジニアが広告検索システムを内製化して運用するまで
lycorptech_jp
PRO
0
170
システム監視入門
grimoh
5
770
ソフトウェアアーキテクチャ研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
2
1k
コンポーネント名には何を含めるべきなのか? / what-should-be-included-in-component-names
airrnot1106
0
200
個人OSSが、机の上から世界に広がるまでの話
shinyasaita
0
130
Retriever と Reranker、結局どうする?
kazuaki
1
530
セキュリティ研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
32
26k
Escolhendo LLMs na Prática: Lições Reais em Busca Agêntica no Mercado Livre —TDC 2026 Floripa
jpbonson
0
110
なぜ、あなたのAPIは使われないのか? AX時代の設計原則、ガードレール、運用体制
yokawasa
1
270
PLaMoを毎日の開発で使い育てていく
pfn
PRO
0
150
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
250
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Context Engineering - Making Every Token Count
addyosmani
9
1k
Embracing the Ebb and Flow
colly
88
5.1k
Claude Code のすすめ
schroneko
67
230k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.2k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Ethics towards AI in product and experience design
skipperchong
2
330
The Language of Interfaces
destraynor
162
27k
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