ADR-BW-016: Verify behavior, contracts, and boundaries in separate layers
Combine focused business tests, consumer/provider contracts, architecture checks, schema validation, and high-value user journeys.
November 7, 2026Proposed
| Field | Value |
|---|---|
| Status | Proposed |
| Date | 2026-11-07 |
| Owners | Architecture Enabling TeamTeamArchitecture Enabling TeamEnabling team facilitating BookWorm's architecture governance, ADRs, arc42 documentation, engineering standards, testing...Open docs |
| Affected Resources | BookWormDomainv1.0.0BookWormCore e-commerce domain for the BookWorm online bookstore, coordinating catalog discovery, customer baskets, order fulfil...Ownerarchitecture-enabling-teamDiagramRepositoryOpen docs |
| Related ADRs | ADR-BW-017: Gate independent evolution on contract compatibilityDecision Recordv1.0.0ADR-BW-017: Gate independent evolution on contract compatibilityPrefer compatible contract changes and coordinate breaking migrations using consumer-impact review and the existing sche...Ownerarchitecture-enabling-teamOpen docs, ADR-BW-018: Maintain one authoritative resource per architecture decisionDecision Recordv1.0.0ADR-BW-018: Maintain one authoritative resource per architecture decisionStore whole-system ADRs at the catalog root, preserve existing system ADRs, and make arc42 section 9 a reference registe...Ownerarchitecture-enabling-teamOpen docs |
Context & Problem Statement
No single test layer catches every failure mode in a distributed microservices platform. Unit tests verify domain invariants quickly but miss contract drift; end-to-end browser tests validate user journeys but are too slow and coarse to cover all boundary rules and architecture constraints.
Decision Drivers
- Fast feedback: Catch domain and architecture violations in seconds.
- Contract safety: Verify HTTP, gRPC, and Kafka compatibility without running all live services together.
- Boundary enforcement: Automatically prevent cross-domain coupling and catalog/doc drift.
Options Considered
| Option | Pros | Cons |
|---|---|---|
| Layered verification (unit, architecture, contract, E2E, catalog lint) | Targeted feedback per risk area; fast CI | Multiple test suites to maintain |
| Unit tests only | Very fast execution | Misses contract drift, serialization, and UI integration bugs |
| End-to-end UI tests only | Exercises full real journeys | Slow, flaky, and poor coverage of internal edge cases |
| Manual QA review only | Flexible human judgment | Misses subtle regressions and contract breaks |
Decision & Consequences
Chosen Option: Enforce a layered verification strategy combining unit tests, architecture boundary tests, consumer/provider contract tests, schema/catalog linting, and high-value end-to-end journeys.
- Positive: Regressions in domain logic, contracts, or documentation are caught at the cheapest appropriate layer.
- Negative: Contributors must keep contract and catalog checks aligned with code changes.
Compliance Criteria
- Domain logic changes must include unit tests; cross-service contract changes must pass consumer/provider contract verification.
- Architecture tests must enforce vertical-slice and bounded-context dependency rules.
- Documentation and EventCatalog changes must pass
eventcatalog-linterand link validation.
On this page
Tags
November 7, 2026Proposed