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
68
1
Share
Mocks and Stubs and Spies, oh my!
Slides from my introduction to test doubles talk given at DroidCon NYC
Brian Gardner
August 27, 2018
More Decks by Brian Gardner
See All by Brian Gardner
GoogleMap DroidCon SF 23
briangardnerdev
0
2.4k
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
Standards et agents IA : un tour d’horizon de MCP, A2A, ADK et plus encore
glaforge
0
190
実践ハーネスエンジニアリング:TAKTで実現するAIエージェント制御 / Practical Harness Engineering: AI Agent Control Enabled by TAKT
nrslib
12
4.7k
AWS Agent Registry の基礎・概要を理解する/aws-agent-registry-intro
ren8k
3
390
Rapid Start: Faster Internet Connections, with Ruby's Help
kazuho
2
740
[OAWTT26][THR1028] Oracle AI Database 26ai へのアップグレード:ベストプラクティスと最新情報
oracle4engineer
PRO
1
110
クラウドネイティブな開発 ~ 認知負荷に立ち向かうためのコンテナ活用
literalice
0
140
Hacobu Tech Deck
hacobu
PRO
0
120
「責任あるAIエージェント」こそ自社で開発しよう!
minorun365
9
2.2k
AIコーディング時代における、ソフトウェアサプライチェーン攻撃に対する防衛術(簡易版)
soysoysoyb
0
110
運用システムにおけるデータ活用とPlatform
sansantech
PRO
0
120
「SaaSの次の時代」に重要性を増すステークホルダーマネジメントの要諦 ~解像度を圧倒的に高めPdMの価値を最大化させる方法~
kakehashi
PRO
3
1.7k
レビューしきれない?それは「全て人力でのレビュー」だからではないでしょうか
amixedcolor
0
340
Featured
See All Featured
The agentic SEO stack - context over prompts
schlessera
0
750
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Six Lessons from altMBA
skipperchong
29
4.2k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
890
A better future with KSS
kneath
240
18k
Deep Space Network (abreviated)
tonyrice
0
120
Fireside Chat
paigeccino
42
3.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
230
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
The Limits of Empathy - UXLibs8
cassininazir
1
310
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
180
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