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
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
事業者間調整の行間を読む 調整の具体事例
sugiim
0
1.5k
Automated Promptingを目指すその前に / Before we can aim for Automated Prompting
rkaga
0
110
コンテンツを支える 若手ゲームクリエイターの アートディレクションの事例紹介 / cagamefi-game
cyberagentdevelopers
PRO
1
130
最速最小からはじめるデータプロダクト / Data Product MVP
amaotone
5
740
生成AIと知識グラフの相互利用に基づく文書解析
koujikozaki
1
140
生成AIの強みと弱みを理解して、生成AIがもたらすパワーをプロダクトの価値へ繋げるために実践したこと / advance-ai-generating
cyberagentdevelopers
PRO
1
180
カメラを用いた店内計測におけるオプトインの仕組みの実現 / ai-optin-camera
cyberagentdevelopers
PRO
1
120
サイバーエージェントにおける生成AIのリスキリング施策の取り組み / cyber-ai-reskilling
cyberagentdevelopers
PRO
2
200
フルカイテン株式会社 採用資料
fullkaiten
0
36k
チームを主語にしてみる / Making "Team" the Subject
ar_tama
4
310
ネット広告に未来はあるか?「3rd Party Cookie廃止とPrivacy Sandboxの効果検証の裏側」 / third-party-cookie-privacy
cyberagentdevelopers
PRO
1
130
CAMERA-Suite: 広告文生成のための評価スイート / ai-camera-suite
cyberagentdevelopers
PRO
3
270
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
38
7k
Gamification - CAS2011
davidbonilla
80
5k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
The Art of Programming - Codeland 2020
erikaheidi
51
13k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
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