Intra-system communication is communication between classes inside an application. It describes collaborations used to perform an operation, not behavior directly visible to the client. section 5.3
Treat these collaborations as implementation details when designing tests. Testing them directly couples tests to internal structure and makes refactoring fragile; verify the public API and resulting business behavior instead. section 5.3 section 5.5
Distinguish intra-system communication from boundary communication:
- Intra-system communication occurs between classes within the application and is generally an implementation detail. section 5.3
- Inter-system communication crosses the application boundary and forms observable behavior when external effects are visible. section 5.3 section 5.5
- Mock inter-system calls when their externally visible side effects matter; avoid mocks that merely verify internal domain collaborations. section 5.5
A purchase workflow
A controller retrieves a customer and product, invokes the customer's purchase operation, and sends an email receipt after success. Verify the returned success and the receipt sent through the external gateway; do not make the test depend on the customer's internal store interaction.
