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
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
3
780
Grafana:建立系統全知視角的捷徑
blueswen
0
280
JETLS.jl ─ A New Language Server for Julia
abap34
2
480
クラウドに依存しないS3を使った開発術
simesaba80
0
220
AgentCoreとHuman in the Loop
har1101
4
150
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
140
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
180
生成AI時代を勝ち抜くエンジニア組織マネジメント
coconala_engineer
0
39k
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
170
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
3
1.1k
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
180
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
530
Featured
See All Featured
KATA
mclloyd
PRO
33
15k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
98
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
880
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
280
The SEO identity crisis: Don't let AI make you average
varn
0
48
A Modern Web Designer's Workflow
chriscoyier
698
190k
How to train your dragon (web standard)
notwaldorf
97
6.5k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
120
Context Engineering - Making Every Token Count
addyosmani
9
600
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