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
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Mocks, stubs & seams
OpenCode talk about unit testing and advanced techniques using mocks stubs & seams
ngarneau
January 15, 2014
More Decks by ngarneau
See All by ngarneau
Introduction au machine learning avec Scitkit-learn
ngarneau
0
49
big data
ngarneau
5
400
Other Decks in Programming
See All in Programming
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
120
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
120
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.2k
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
140
AIに既存システムを理解させる技術 ~レガシーを見捨てないハーネスエンジニアリング入門~
ochtum
0
150
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
610
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
2
440
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
3
1.9k
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
240
リアルな遅延を測る仕様
kota_yata
1
130
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
540
Press start. Python's next generation.
willingc
PRO
3
130
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
The Language of Interfaces
destraynor
162
27k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
390
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
280
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Automating Front-end Workflow
addyosmani
1369
210k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
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