Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
64
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.2k
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
New Relic 1 年生の振り返りと Cloud Cost Intelligence について #NRUG
play_inc
0
220
Strands AgentsとNova 2 SonicでS2Sを実践してみた
yama3133
1
1.7k
MySQLとPostgreSQLのコレーション / Collation of MySQL and PostgreSQL
tmtms
1
1.2k
Bedrock AgentCore Memoryの新機能 (Episode) を試してみた / try Bedrock AgentCore Memory Episodic functionarity
hoshi7_n
2
1.8k
子育てで想像してなかった「見えないダメージ」 / Unforeseen "hidden burdens" of raising children.
pauli
2
320
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
9.9k
_第4回__AIxIoTビジネス共創ラボ紹介資料_20251203.pdf
iotcomjpadmin
0
130
Amazon Bedrock Knowledge Bases × メタデータ活用で実現する検証可能な RAG 設計
tomoaki25
6
2.3k
Identity Management for Agentic AI 解説
fujie
0
450
日本Rubyの会: これまでとこれから
snoozer05
PRO
5
230
AIエージェント開発と活用を加速するワークフロー自動生成への挑戦
shibuiwilliam
4
830
20251203_AIxIoTビジネス共創ラボ_第4回勉強会_BP山崎.pdf
iotcomjpadmin
0
130
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
2
190
How to make the Groovebox
asonas
2
1.8k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
280
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
25
GraphQLとの向き合い方2022年版
quramy
50
14k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
260
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
100
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
The SEO identity crisis: Don't let AI make you average
varn
0
36
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
200
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