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
220
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
320
Introduction to TDD: Red-Green-Refactor
franiglesias
1
240
testing the unpredictable
franiglesias
0
190
Tests doubles: the motion picture
franiglesias
0
450
Low cost techniques for test doubles
franiglesias
0
170
Other Decks in Programming
See All in Programming
Jakarta EE Core Profile and Helidon - Speed, Simplicity, and AI Integration
ivargrimstad
0
230
testingを眺める
matumoto
1
120
MCPで実現するAIエージェント駆動のNext.jsアプリデバッグ手法
nyatinte
7
960
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
110
Rancher と Terraform
fufuhu
1
130
あのころの iPod を どうにか再生させたい
orumin
2
2.5k
為你自己學 Python - 冷知識篇
eddie
1
280
Vue・React マルチプロダクト開発を支える Vite
andpad
0
100
Flutter로 Gemini와 MCP를 활용한 Agentic App 만들기 - 박제창 2025 I/O Extended Seoul
itsmedreamwalker
0
150
ソフトウェアテスト徹底指南書の紹介
goyoki
1
120
Infer入門
riru
4
1.6k
🔨 小さなビルドシステムを作る
momeemt
2
600
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
The Pragmatic Product Professional
lauravandoore
36
6.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
490
Docker and Python
trallard
45
3.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Art, The Web, and Tiny UX
lynnandtonic
302
21k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
830
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
900
Embracing the Ebb and Flow
colly
87
4.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
51
5.5k
Raft: Consensus for Rubyists
vanstee
140
7.1k
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