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
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
dchart: charts from deck markup
ajstarks
3
990
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
AgentCoreとHuman in the Loop
har1101
5
220
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
170
Patterns of Patterns
denyspoltorak
0
1.4k
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
590
CSC307 Lecture 02
javiergs
PRO
1
770
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
Featured
See All Featured
First, design no harm
axbom
PRO
2
1.1k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
680
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
RailsConf 2023
tenderlove
30
1.3k
It's Worth the Effort
3n
188
29k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
100
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The browser strikes back
jonoalderson
0
360
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
190
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