Design for testability structures software so developers can write and run automated tests easily. Fast feedback helps teams assess whether changes are releasable without waiting for slower, error-prone manual testing. section 5.4.3
Use three design strategies to make automated testing easier:
- Structure software as small elements with loose design-time coupling; stable APIs also reduce test updates. section 5.4.3
- Eliminate or limit nondeterminism, ideally isolating nondeterministic code in its own component. section 5.4.3
- Use dependency injection to replace troublesome dependencies with test doubles; functional-style programming is another suggested technique. section 5.4.3
For faster test runs, testability is one of several architectural characteristics associated with reducing retesting scope and test-suite execution time. section 5.4.4
Figure 5.15 A subdomain’s clients should depend on the more stable API build project rather than the less stable implementation build project. In this example, the order-management-impl build project does not need to be rested when the customer-management-impl build project changes.
A stable API build project can keep clients from depending on a changing implementation project, limiting which projects need retesting after a change. section 5.4.4
