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
56
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
2k
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
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
100
DUSt3R, MASt3R, MASt3R-SfM にみる3D基盤モデル
spatial_ai_network
2
110
UI State設計とテスト方針
rmakiyama
2
580
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
13
3.7k
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
AWS re:Invent 2024 ふりかえり
kongmingstrap
0
130
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
3
2.3k
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
130
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
450
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
530
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
95
5.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Thoughts on Productivity
jonyablonski
67
4.4k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Site-Speed That Sticks
csswizardry
2
190
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
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