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
89
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
The kernel report
ennael
PRO
1
140
高負荷プロダクション環境におけるAWS Lambdaのリアル 〜スケールとコストを左右する実行ライフサイクルの技術仕様〜
maimyyym
2
830
AI coding 整合正規方法
philipz
0
570
営業オントロジーの作り方と、エージェントからの辿り方 ── ナレッジワークの現場から
kworkdev
PRO
1
200
Lambda MicroVMsが分からなすぎたので使い所を1から考えてみた
tsukuboshi
1
250
Claude Designがめちゃくちゃ便利なので使ってほしい
diggymo
0
160
スキルを作る、その前に!複数人で使われるスキルを 作るためのプロセス
junkifurukawa
0
100
顧客の成果創出とプロダクトの成長を 両立するためのFDE
sansantech
PRO
0
500
spanner-autoscalerに学ぶ CRD設計パターン 〜自動化と緊急時対応を両立する Kubernetesコントローラーの作り方〜
tkuchiki
0
210
HolmesGPTで始めるSREエージェント入門!プラットフォームの障害調査はAIにお任せ 〜
sanghyuk
0
250
手を動かして実感する、Kiro が変える開発体験
inariku
0
420
Claude起点の仕様駆動開発
tanakaseiya
0
220
Featured
See All Featured
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
960
Building Applications with DynamoDB
mza
96
7.2k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
390
WENDY [Excerpt]
tessaabrams
14
39k
Chasing Engaging Ingredients in Design
codingconduct
0
340
Everyday Curiosity
cassininazir
0
330
The Language of Interfaces
destraynor
162
27k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Believing is Seeing
oripsolob
1
230
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
A Modern Web Designer's Workflow
chriscoyier
699
190k
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
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