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
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
370
Introduction to TDD: Red-Green-Refactor
franiglesias
1
340
testing the unpredictable
franiglesias
0
260
Tests doubles: the motion picture
franiglesias
0
560
Low cost techniques for test doubles
franiglesias
0
250
Other Decks in Programming
See All in Programming
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
56
37k
Intent as Code
shoppingjaws
6
870
Family mrubyの進捗
kishima
1
110
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
300
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
540
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
2
290
App Intentsのビルドプロセスを支える技術
kntkymt
0
230
アクセシビリティから考える情報設計
high_g_engineer
0
350
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
140
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
高専キャリア LT 発表内容
crysta1221
6
5.6k
デプロイ直後のレイテンシスパイクを調べたら、 Railsの仕様にたどり着いた
nhsykym
0
110
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
310
Raft: Consensus for Rubyists
vanstee
141
7.7k
Into the Great Unknown - MozCon
thekraken
41
2.7k
Building Adaptive Systems
keathley
44
3.2k
Scaling GitHub
holman
464
140k
Navigating Team Friction
lara
192
16k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Amusing Abliteration
ianozsvald
1
290
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
820
Discover your Explorer Soul
emna__ayadi
2
1.3k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
270
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