Domain significance measures how important code is to the business meaning and consequences of a project. Business-critical behavior matters more than boilerplate because defects there cause greater damage. section 7.6 section 4.1
Use domain significance with code complexity to prioritize unit-testing effort: complex or business-significant code usually offers the strongest protection against regressions, while trivial code rarely justifies dedicated tests. section 7.6 section 4.1
Classify production code by complexity or domain significance and collaborator count:
- Domain models and algorithms have high testing value when they combine substantial complexity or business significance with few collaborators. section 7.6
- Trivial code has low complexity and significance with few collaborators, so testing it is usually not worthwhile. section 7.6
- Controllers coordinate many collaborators but contain little significance or complexity; cover them briefly with integration tests. section 7.6
- Overcomplicated code combines high significance or complexity with many collaborators; split business logic from orchestration. section 7.6
Test the behavior that matters
A message renderer produces "<h1>h</h1><b>b</b><i>f</i>" from a header, body, and footer. Testing that observable result protects behavior while avoiding brittle dependence on its internal renderer structure.
