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

Read the architecture guide →

Testing and Change Safety

Layered tests and schema checks protect BookWorm behavior, service boundaries, and contract compatibility.

Cross-cutting Concept

Purpose and Scope

Testing and change safety establish evidence that code, contracts, policies, data effects, and user journeys remain acceptable from development through release. These rules apply to shared foundations and every frontend, API, worker, event, integration, and AI boundary.

Visual Reference

Verification and Release Gates

Loading graph...

Core Rules and Standards

  1. Test at the lowest useful boundary. Use fast unit and component tests for local behavior and raise the test level only for interaction or deployment evidence.
  2. Verify contracts independently. Providers and consumers must prove compatibility for APIs and event schemas before deployment.
  3. Protect architectural boundaries. Automated checks must prevent forbidden dependencies and preserve capability ownership.
  4. Test behavior, not implementation. Assert domain outcomes, observable API effects, access decisions, and recoverable failure behavior.
  5. Require quality gates. Formatting, static analysis, tests, security checks, contract checks, and documentation checks must pass before promotion.
  6. Make releases reversible. Deploy behind feature or traffic controls when rollback or staged observation is useful.
  7. Use explicit rollback criteria. A release halts or rolls back for health, error, latency, security, privacy, contract, or business-signal breaches agreed by the owner.
Warning

A green build proves only the evidence it exercises. Critical compatibility, privacy, migration, and rollout risks require targeted tests or a documented human release gate.

Mechanism / How It Works

LayerPrimary Evidence
UnitDomain rules, validation, state transitions, pure transformations, and failure classification
ComponentUI behavior, endpoint behavior, handler behavior, policy decisions, and data access boundaries
IntegrationReal interactions among a host and its database, broker, cache, identity, or external dependency
ContractConsumer/provider compatibility for HTTP, RPC, events, AI tools, and message envelopes
End-to-endCritical journeys across frontends, gateways, capabilities, and asynchronous completion
ArchitectureDependency direction, domain isolation, forbidden references, and infrastructure conventions

Verification and Release Gates

  1. Local evidence

    Run focused tests and formatting or static checks while code is still under development.

  2. Change evidence

    Run the relevant unit, contract, architecture, integration, and user-flow checks for the changed boundary.

  3. Promotion gate

    Require security, privacy, schema, coverage, migration, and quality checks to pass before deployment.

  4. Controlled rollout

    Deploy incrementally, observe health and business signals, and retain the previous reversible artifact.

  5. Decision and rollback

    Promote when agreed criteria hold; halt or roll back when a breach is detected or the outcome cannot be verified.

Rollout and Rollback Criteria

ConcernPromote WhenRoll Back or Halt When
AvailabilityReadiness and liveness remain stable at the approved thresholdHealth probes fail or traffic sheds unexpectedly
Latency and errorsError and latency budgets remain within release limitsSustained breaches correlate with the change
ContractsConsumers pass compatibility checks and replay remains safeAdditive or breaking incompatibility appears
Privacy and securityPolicy tests pass and no secrets or PII leak is detectedUnauthorized access, PII exposure, or policy bypass occurs
Business outcomeAuthoritative state and key journeys complete correctlyReconciliation gaps, duplicate side effects, or incorrect outcomes appear

Verification and Governance

  • Map each shared library or boundary change to its owning test layer and contract.
  • Keep known gaps explicit and prioritize them with release risk.
  • Review failed, flaky, or skipped tests as release evidence, not merely CI noise.
  • Retain rollback evidence and operational criteria with every promoted release.
  • Testing ExecutionCustom DocTesting ExecutionHow to run backend, frontend, contract, browser, and documentation checks locally and interpret their results.Ownerarchitecture-enabling-teamOpen doc — Test commands and focused execution.
  • Testing MatrixCustom DocTesting MatrixReference tables for test scope, dependencies, local and CI execution triggers, and passing criteria.Ownerarchitecture-enabling-teamOpen doc — Framework and coverage details.
  • Pull Request ProcessCustom DocPull Request ProcessPrepare a focused draft, satisfy automated checks and review, and merge a contribution safely.Ownerarchitecture-enabling-teamOpen doc — Pull-request and review requirements.