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, stubs & seams
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
46
big data
ngarneau
5
400
Other Decks in Programming
See All in Programming
SourceGeneratorのススメ
htkym
0
200
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
620
AtCoder Conference 2025
shindannin
0
1.1k
Raku Raku Notion 20260128
hareyakayuruyaka
0
340
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.4k
CSC307 Lecture 02
javiergs
PRO
1
780
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
740
dchart: charts from deck markup
ajstarks
3
1k
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
高速開発のためのコード整理術
sutetotanuki
1
400
Basic Architectures
denyspoltorak
0
680
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
470
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
55
It's Worth the Effort
3n
188
29k
HDC tutorial
michielstock
1
390
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Rails Girls Zürich Keynote
gr2m
96
14k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
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