Skip to content

Testing and Quality

mavrovde edited this page Nov 2, 2026 · 4 revisions

Testing and Quality

Every promise on Principles has a test that fails when the promise is broken. This page lists the planned test layers and quality gates. They apply to every candidate stack; tool names per stack are on Architecture: Go, Architecture: Rust and Architecture: TypeScript.

A firm rule carried over from the ViaFrei platform: tests never call a live data provider. All tests run against fixtures and throwaway databases.

This page is the short design summary. The full testing document set starts at Testing Strategy (levels, types, targets, gates, roles), with a Test Plan per milestone; where this summary and that set differ, the set applies.

Test layers

Layer How Proves Target
Domain table-driven and property-based tests lamps, kilometre arithmetic, price ordering, the licence gate over every plan × family × acceptance combination, Berlin daylight-saving rendering ≥ 95 % line coverage of domain, access and admission
Use cases hand-written port fakes composition, part statuses, permit weights, graceful degradation ≥ 90 %
Storage mapping a throwaway PostGIS database built from the contract stub, with seed rows every query prepares; rows round-trip; code maps are total; the post-check fires on a planted forbidden row every view and every code
Roles the same database the read role cannot write and cannot see beyond the read contract —
Cancellation a seed-only stub that sleeps answer within the deadline; database backend idle shortly after; no poisoned connection reused —
Query plans a database with several time partitions no sequential scan on time-series data; partition pruning in generic and custom plans —
Handlers in-process HTTP tests and JSON snapshots problems, headers, 304, fields=, the public shape every operation × 200 / 304 / 4xx
OpenAPI contract every recorded response validated against the OpenAPI document; Schemathesis against the running container documentation and behaviour cannot drift zero failures
MCP parity fixtures shared with the platform each endpoint answers the same facts as its MCP counterpart for the same input each feature
Documentation examples every example in the OpenAPI document is executed against the fixture instance examples are true all
Configuration per-key behaviour table and boot-refusal tests every key does what it says every key
Fuzzing parsers for cursors, keys, polylines, location and field parameters, the configuration loader no panics; round-trip and tamper-refusal invariants a short run per pull request, a long run nightly
Load k6 with the budget file; the overload scenario latency budgets; tier protection; 429 with Retry-After see [[Benchmark Plan

Coverage gate: 100 % of statements in every package of every layer (TST-001), from the unit, integration and boot-smoke profiles merged; generated code only through a named exclusion file with reasons; reported per package on every pull request.

MCP parity in detail

  1. The platform runs each mapped MCP capability on fixed inputs against its fixture database and records the facts: normalised ids, names, positions to five decimals, prices, states, instants, source families and note texts.
  2. It exports the read-contract rows from the same fixture database as a seed.
  3. The API loads the seed into its stub database, calls the matching endpoint, projects the response to the same facts and compares.

Scope lint

A repository lint fails on:

  • collection vocabulary in code, documentation or the OpenAPI document (with a short, reasoned allow-list);
  • platform-internal names, checked against a hashed denylist supplied by the platform, so the list itself reveals nothing;
  • public field names equal to a read-contract column.

Static quality

  • Formatting and linting with warnings as errors.
  • Generated artefacts (typed queries, the OpenAPI document, the configuration reference) are regenerated in CI; any diff fails.
  • Spectral rules on the OpenAPI document: every operation has a description, examples and attribution.
  • oasdiff breaking-change detection against main.
  • Vulnerability scanning of dependencies and of the built image.

Planted-fault proof

The pipeline itself is tested: pull requests that plant a lint error, a failing test and a removed response field must each turn red.

Home

About

Design

Data Model

Technical specification

Testing

Engineering

Technology choice

Reference

Clone this wiki locally