Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Testing value objects
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Fran Iglesias
November 02, 2018
Programming
300
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Testing value objects
How to test things like immutability
Fran Iglesias
November 02, 2018
More Decks by Fran Iglesias
See All by Fran Iglesias
Tips for daily refactoring
franiglesias
0
380
Introduction to TDD: Red-Green-Refactor
franiglesias
1
340
testing the unpredictable
franiglesias
0
270
Tests doubles: the motion picture
franiglesias
0
570
Low cost techniques for test doubles
franiglesias
0
260
Other Decks in Programming
See All in Programming
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1.3k
Are APIs Still Relevant in the AI Era?
soyuka
0
410
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
600
Security issues being discussed on Web Platforms
petamoriken
0
1.4k
Simple Storage Service(S3) is not simple
iwatsukayura
0
120
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
110
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
380
速習iPhone Duo対応
yuukiw00w
2
940
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.4k
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
330
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
220
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
340
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
470
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Fireside Chat
paigeccino
43
4k
Between Models and Reality
mayunak
4
480
Music & Morning Musume
bryan
48
7.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Visualization
eitanlees
153
17k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
420
Transcript
TDD 101 2. TDDing Value Objects
TDDing Value Objects
Value Object (DDD) Small object Represents a concept Equality based
on value Immutable: • Should be created consistent • Mutators should return new instances
So… How do you TDD a VO?
TDD VO Think of an invalid example Write a test
that fails expecting exception Make the test pass Repeat as needed to test invalid cases
TDD VO Think of a valid example Write a test
that fails asserting value Make the test pass
TDD VO Equality Write a test that fails expecting inequality
Make the test pass Then write a test that fails expecting equality Make the test pass
TDD VO Immutability Think of a valid example of a
mutator Write a test that fails expecting a different instance Make the test pass
None