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
61
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.1k
Mocks and Stubs and Spies, oh my!
briangardnerdev
1
220
Take a stab at test friendly architecture
briangardnerdev
1
150
Other Decks in Technology
See All in Technology
Welcome to the LLM Club
koic
0
140
Windows 11 で AWS Documentation MCP Server 接続実践/practical-aws-documentation-mcp-server-connection-on-windows-11
emiki
0
760
エンジニア向け技術スタック情報
kauche
1
110
実践! AIエージェント導入記
1mono2prod
0
150
変化する開発、進化する体系時代に適応するソフトウェアエンジニアの知識と考え方(JaSST'25 Kansai)
mizunori
0
160
Azure AI Foundryでマルチエージェントワークフロー
seosoft
0
160
Amazon ECS & AWS Fargate 運用アーキテクチャ2025 / Amazon ECS and AWS Fargate Ops Architecture 2025
iselegant
16
4.9k
強化されたAmazon Location Serviceによる新機能と開発者体験
dayjournal
2
170
第9回情シス転職ミートアップ_テックタッチ株式会社
forester3003
0
160
Кто отправит outbox? Валентин Удальцов, автор канала Пых
lamodatech
0
300
本当に使える?AutoUpgrade の新機能を実践検証してみた
oracle4engineer
PRO
1
130
rubygem開発で鍛える設計力
joker1007
1
140
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.3k
Scaling GitHub
holman
459
140k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Rebuilding a faster, lazier Slack
samanthasiow
81
9k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
660
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Music & Morning Musume
bryan
46
6.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Become a Pro
speakerdeck
PRO
28
5.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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