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
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
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
980
CSC307 Lecture 04
javiergs
PRO
0
660
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
AI時代の認知負荷との向き合い方
optfit
0
160
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
140
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
470
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
Architectural Extensions
denyspoltorak
0
290
CSC307 Lecture 02
javiergs
PRO
1
780
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
470
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
67
How to make the Groovebox
asonas
2
1.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
97
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
54
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
130
Deep Space Network (abreviated)
tonyrice
0
49
Into the Great Unknown - MozCon
thekraken
40
2.3k
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