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
Fran Iglesias
November 02, 2018
Programming
310
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
350
testing the unpredictable
franiglesias
0
280
Tests doubles: the motion picture
franiglesias
0
580
Low cost techniques for test doubles
franiglesias
0
260
Other Decks in Programming
See All in Programming
Seven New Principles of Software Engineering
yegor256
0
380
R8 の設定見直しでアプリサイズ削減
andpad
0
230
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
12
7.6k
Spec-driven Development with AI
simas
PRO
0
2.2k
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
200
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
6k
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
1.1k
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
180
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
3
1.2k
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
130
LLM 101
dalinaum
0
220
気持ちぃ〜角丸 Squircle
ryu1013
0
370
Featured
See All Featured
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
610
Git: the NoSQL Database
bkeepers
PRO
433
67k
Typedesign – Prime Four
hannesfritz
42
3.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
620
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
540
Docker and Python
trallard
47
4.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
How to Ace a Technical Interview
jacobian
280
24k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
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