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
230
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
250
testing the unpredictable
franiglesias
0
200
Tests doubles: the motion picture
franiglesias
0
460
Low cost techniques for test doubles
franiglesias
0
180
Other Decks in Programming
See All in Programming
Serena MCPのすすめ
wadakatu
4
960
その面倒な作業、「Dart」にやらせませんか? Flutter開発者のための業務効率化
yordgenome03
1
110
The Flutter Journey of Building a Live Streaming App — With a Side of Performance Tuning
u503
1
110
スマホから Youtube Shortsを見られないようにする
lemolatoon
25
28k
CSC305 Lecture 04
javiergs
PRO
0
260
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
4
1.9k
uniqueパッケージの内部実装を支えるweak pointerの話
magavel
0
970
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
230
大規模アプリのDIフレームワーク刷新戦略 ~過去最大規模の並行開発を止めずにアプリ全体に導入するまで~
mot_techtalk
0
430
理論と実務のギャップを超える
eycjur
0
120
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
250
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
0
210
Featured
See All Featured
Side Projects
sachag
455
43k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Designing for Performance
lara
610
69k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
900
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6.1k
A Tale of Four Properties
chriscoyier
160
23k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Optimizing for Happiness
mojombo
379
70k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
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