Repository navigation
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.
| 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.
- 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.
- It exports the read-contract rows from the same fixture database as a seed.
- The API loads the seed into its stub database, calls the matching endpoint, projects the response to the same facts and compares.
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.
- 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.
The pipeline itself is tested: pull requests that plant a lint error, a failing test and a removed response field must each turn red.
ViaFrei API: a public, keyed, read-only REST API to live German mobility data. Design phase; nothing on these pages is a measurement of a running service. Data on viafrei.de and in every API answer is attributed to its publishers under their licences.
About
Design
- Domain Model
- API Design
- Architecture Overview
- Security and Access Keys
- Rate Limits and Priority
- Performance and Caching
- Configuration
- Observability
Data Model
Technical specification
-
Technical Specification
- Interface
- Scope, Conventions and References
- Protocol
- Common Envelope
- Resource Model
- Endpoints, Places
- Endpoints, Roads
- Endpoints, Energy and Parking
- Endpoints, Public Transport and Accessibility
- Endpoints, Weather Risk, Driving Rules and Composed Features
- Service Endpoints
- Errors
- Authentication and Authorisation
- Rate Limiting, Quotas and Priority
- Data Licensing and Attribution
- Compatibility and Versioning
- OpenAPI Skeleton
- Quality
- Delivery and operations
- Interface
Testing
- Testing Strategy
- Testing and Quality (design summary)
Engineering
Technology choice
- Technology Evaluation
- Architecture: Go
- Architecture: Rust
- Architecture: TypeScript
- Stack Comparison
- Benchmark Plan
Reference