Depending on the emphasis on the types of tests, there are 3 types of testing strategies:
- Testing pyramid - Unit test heavy
- Testing diamond - Integration test heavy
- Reversed testing pyramid - End-to-end test heavy
What to choose?
The next heuristic can be applied:
- Domain model or Event-sourced domain model - Testing pyramid. Aggregates and value objects are perfect units.
- Active record - Testing diamond. Business logic is spread across the service and business logic layers, so the focus is on testing integration between these two layers.
- Transaction script - Reversed testing pyramid. The logic is simple, minimal number of layers - easier to verify the end-to-end flow of the system.