Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mocks, stubs & seams
Search
ngarneau
January 15, 2014
Programming
0
110
Mocks, stubs & seams
OpenCode talk about unit testing and advanced techniques using mocks stubs & seams
ngarneau
January 15, 2014
Tweet
Share
More Decks by ngarneau
See All by ngarneau
Introduction au machine learning avec Scitkit-learn
ngarneau
0
45
big data
ngarneau
5
400
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
150
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
120
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
510
マスタデータ問題、マイクロサービスでどう解くか
kts
0
110
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
180
ゲームの物理 剛体編
fadis
0
350
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
410
AIコーディングエージェント(NotebookLM)
kondai24
0
200
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
510
認証・認可の基本を学ぼう後編
kouyuume
0
240
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
220
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.4k
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.1k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Music & Morning Musume
bryan
46
7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Context Engineering - Making Every Token Count
addyosmani
9
530
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Into the Great Unknown - MozCon
thekraken
40
2.2k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Side Projects
sachag
455
43k
Transcript
mocks, stubs & seams Nicolas Garneau
stubs Using stubs to break dependencies
seams we are used to it! dependency!
seams we can create a seam in the method call
seams or via a setter
stubs A stub is not like a mock but it
looks like
mocks Use mock to test interaction between objects
mocks The Observer Pattern Observable «interface» attachObserver() detachObserver() notify() ConcreteObservable
setState() getState() Observer «interface» update() ConcreteObserver update()
mocks mock it! expect the call only once attach it
Hell yeah that’s a seam! acts as a test