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
100
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
37
big data
ngarneau
5
390
Other Decks in Programming
See All in Programming
Netty Chicago Java User Group 2024-04-17
sullis
0
200
GitHub Copilotのススメ
marcy731
1
220
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
500
PHPはいつから死んでいるかの調査
chiroruxx
2
410
雑に思考を整理する技術と効能
konifar
63
30k
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
120
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
220
Compose-View Interop in Practice (mDevCamp 2024)
stewemetal
0
160
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
410
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
140
検証も兼ねて個人開発でHonoとかと向き合った話
hanetsuki
1
1.3k
Ruby Function Composition
bkuhlmann
1
340
Featured
See All Featured
Happy Clients
brianwarren
92
6.4k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
It's Worth the Effort
3n
180
27k
The Cost Of JavaScript in 2023
addyosmani
20
3.9k
Automating Front-end Workflow
addyosmani
1357
200k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
Testing 201, or: Great Expectations
jmmastey
29
6.4k
The Mythical Team-Month
searls
216
42k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
13
8.3k
Web development in the modern age
philhawksworth
203
10k
Producing Creativity
orderedlist
PRO
338
39k
Building Flexible Design Systems
yeseniaperezcruz
320
37k
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