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
Testing value objects
Search
Fran Iglesias
November 02, 2018
Programming
0
260
Testing value objects
How to test things like immutability
Fran Iglesias
November 02, 2018
Tweet
Share
More Decks by Fran Iglesias
See All by Fran Iglesias
Tips for daily refactoring
franiglesias
0
340
Introduction to TDD: Red-Green-Refactor
franiglesias
1
280
testing the unpredictable
franiglesias
0
230
Tests doubles: the motion picture
franiglesias
0
510
Low cost techniques for test doubles
franiglesias
0
210
Other Decks in Programming
See All in Programming
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
CSC307 Lecture 08
javiergs
PRO
0
670
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
6k
高速開発のためのコード整理術
sutetotanuki
1
390
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
250
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.3k
AI & Enginnering
codelynx
0
110
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
160
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
Darren the Foodie - Storyboard
khoart
PRO
2
2.3k
How GitHub (no longer) Works
holman
316
140k
How to Talk to Developers About Accessibility
jct
2
130
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Test your architecture with Archunit
thirion
1
2.1k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
430
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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