Testing and delivery¶
Test strategies that support the architecture, and delivery practices that keep it changeable.
Entries are sorted by score from 1 to 10 (criteria): 9โ10 start here or strongly recommended, 6โ8 recommended, 1โ5 further reading or conditional.
Adopted references¶
- 9 The Practical Test Pyramid (Ham Vocke): our default test strategy, with worked examples.
- 9 DORA: research-backed capabilities and metrics for software delivery performance.
- 8 Software Engineering at Google (free online): testing, code review and large-scale change.
- 7 Testing Strategies in a Microservice Architecture (Toby Clemson): test types for distributed systems.
- 7 Trunk Based Development: the branching model that supports continuous integration.
Key rules¶
- 8
TEST-2Keep the software deployable at all times, and prioritise that over new features. (Fowler, Continuous Delivery) - 7
TEST-1Write many fast unit tests, fewer integration tests and very few end-to-end tests. (Vocke, The Practical Test Pyramid, Google Testing Blog, Just Say No to More End-to-End Tests) - 7
TEST-3Integrate small changes into the main branch at least daily. (Trunk Based Development) - 6
TEST-4Enforce architecture rules such as layering and dependency direction with automated tests. (ArchUnit for Java, ArchUnitNET for .NET) - 6
TEST-5Test service boundaries with contract tests rather than relying on slow, brittle end-to-end integration suites. (Pact, Introduction, Fowler, Contract Test) - 6
TEST-6Decouple deployment from release with feature toggles, and remove toggles once they've served their purpose. (Hodgson, Feature Toggles) - 6
TEST-7Measure software delivery throughput and instability with the DORA metrics, and use them to improve, not to compare teams. (DORA metrics guide)
How to enforce¶
Tools that check the key rules above automatically, in CI, the IDE or a commit hook. "Partly" means the tool covers only some of what the rule asks.
- 7 ArchUnit (Java): layer, dependency and cycle checks as unit tests. Checks
TEST-4. - 7 Pact can-i-deploy: blocks a deployment unless contract tests show it's compatible with what's deployed. Checks
TEST-5. - 6 ArchUnitNET (.NET): namespace dependency, layer and cycle rules as unit tests. Checks
TEST-4. - 6 Konsist (Kotlin):
assertArchitectureverifies that layers depend only on the layers they're allowed to. ChecksTEST-4. - 6 dependency-cruiser (JavaScript and TypeScript): validates module dependencies against your rules, and fails CI on violations. Checks
TEST-4. - 6 Import Linter (Python): layers contracts let higher layers depend on lower ones, but not the other way around. Checks
TEST-4.
Tutorials and further reading¶
- 7 Software Engineering at Google, table of contents.
- 6 Test Double (Martin Fowler): the vocabulary of mocks, stubs and fakes.