Chapter 9. Testing your domain model

This chapter covers

  • Designing testable domain models
  • Learning why xUnit-based testing isn’t enough
  • Introducing property-based testing
  • Using properties as executable blueprints for domain behaviors

This chapter covers testing your domain model. I begin with an explanation of what is meant by a testable model and how testability is related to the modularity of a model architecture. I take examples from some of the model components discussed in earlier chapters and look at how to test them. Then I discuss briefly the shortcomings of xUnit-based testing and dive into the details of property-based testing using ScalaCheck.

Figure 9.1 diagrams the chapter content.

Figure 9.1. The progression of this chapter’s ...

Get Functional and Reactive Domain Modeling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.