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
45
big data
ngarneau
5
400
Other Decks in Programming
See All in Programming
Claude Agent SDK を使ってみよう
hyshu
0
1.1k
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
200
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
0
1.3k
2分台で1500examples完走!爆速CIを支える環境構築術 - Kaigi on Rails 2025
falcon8823
3
3.7k
XP, Testing and ninja testing ZOZ5
m_seki
3
700
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
600
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
2
590
CSC509 Lecture 05
javiergs
PRO
0
300
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
250
理論と実務のギャップを超える
eycjur
0
140
Go言語はstack overflowの夢を見るか?
logica0419
0
370
One Enishi After Another
snoozer05
PRO
0
110
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.6k
Being A Developer After 40
akosma
91
590k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
A Tale of Four Properties
chriscoyier
161
23k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
The World Runs on Bad Software
bkeepers
PRO
72
11k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
We Have a Design System, Now What?
morganepeng
53
7.8k
Scaling GitHub
holman
463
140k
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