Value objects
...are valuable for testing
Part fourteen of a series of posts about automated testing.
Value objects are defined by their attributes - if two value objects have the same attributes, they are equal. For example:
Two of these objects with the same red/green/blue values define the same colour - it would not make sense to compare the memory address of these objects when judging if they were equal.
Why does this matter for testing? Identifying which objects are value objects can help prevent over-mocking - these types of objects are easy to construct, so there is no advantage to replacing them with fake implementations.