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
55
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
1.9k
Mocks and Stubs and Spies, oh my!
briangardnerdev
1
210
Take a stab at test friendly architecture
briangardnerdev
1
150
Other Decks in Technology
See All in Technology
HolidayJp.jl を作りました
mrkn
0
110
【Λ(らむだ)最近のアプデ情報 / RPALT20240904
lambda
0
150
AWSを始めた頃に陥りがちなポイントをまとめてみた
oshanqq
0
300
Evolving DevOps Teams and Flexible Organizational Culture
kakehashi
1
110
Staff Engineer / 20240827 Yuichiro Masui
shift_evolve
0
150
AWS版GitHub?Amazon CodeCatalystの全体像をまとめてみた
oshanqq
1
3.1k
脆弱星に導かれて
nishimunea
1
1.5k
JAWSPANKRATION2024-ECS Best Practice All on board(english)
tkikuchi
0
430
Oracle Database Backup Service:サービス概要のご紹介
oracle4engineer
PRO
0
4k
FastConnect の冗長性
ocise
0
7.1k
中規模・ミドルTier開発組織におけるDevRelの戦略と実行と成果 - DevRel Guild Conference Mini -
leveragestech
2
260
バックログを導入し やっぱやめた話
ota42y
0
160
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
72
8.9k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
165
48k
How STYLIGHT went responsive
nonsquared
93
5.1k
Robots, Beer and Maslow
schacon
PRO
157
8.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
32k
GraphQLとの向き合い方2022年版
quramy
43
13k
Automating Front-end Workflow
addyosmani
1365
200k
A better future with KSS
kneath
235
17k
Being A Developer After 40
akosma
82
580k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
354
29k
5 minutes of I Can Smell Your CMS
philhawksworth
201
19k
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