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
44
big data
ngarneau
5
400
Other Decks in Programming
See All in Programming
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
530
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
160
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
4.2k
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
1から理解するWeb Push
dora1998
7
1.9k
@Environment(\.keyPath)那么好我不允许你们不知道! / atEnvironment keyPath is so good and you should know it!
lovee
0
120
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
270
はじめてのMaterial3 Expressive
ym223
2
740
今から始めるClaude Code入門〜AIコーディングエージェントの歴史と導入〜
nokomoro3
0
180
Putting The Genie in the Bottle - A Crash Course on running LLMs on Android
iurysza
0
140
Namespace and Its Future
tagomoris
6
700
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
580
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
810
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
How STYLIGHT went responsive
nonsquared
100
5.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Documentation Writing (for coders)
carmenintech
74
5k
Practical Orchestrator
shlominoach
190
11k
Writing Fast Ruby
sferik
628
62k
BBQ
matthewcrist
89
9.8k
Rails Girls Zürich Keynote
gr2m
95
14k
For a Future-Friendly Web
brad_frost
180
9.9k
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