Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

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
FieldValue
StatusProposed
Date2026-11-07
OwnersArchitecture Enabling TeamTeamArchitecture Enabling TeamEnabling team facilitating BookWorm's architecture governance, ADRs, arc42 documentation, engineering standards, testing...Open docs
Affected ResourcesBookWormDomainv1.0.0BookWormCore e-commerce domain for the BookWorm online bookstore, coordinating catalog discovery, customer baskets, order fulfil...Ownerarchitecture-enabling-teamDiagramRepositoryOpen docs
Related ADRsADR-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

OptionProsCons
Layered verification (unit, architecture, contract, E2E, catalog lint)Targeted feedback per risk area; fast CIMultiple test suites to maintain
Unit tests onlyVery fast executionMisses contract drift, serialization, and UI integration bugs
End-to-end UI tests onlyExercises full real journeysSlow, flaky, and poor coverage of internal edge cases
Manual QA review onlyFlexible human judgmentMisses 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-linter and link validation.