# Testing & conformance

Connect a protocol requirement to repeatable tests, failure cases and release evidence.

Canonical page: https://quantumchain.info/docs/developers/testing-and-conformance

Category: Developers · Reviewed: 24 November 2026

## Test what must remain true

An invariant is a property that must hold within a declared scope. For example, invalid authorization must not produce an authorized value transfer, and corrupted snapshot data must not become active state.

The scenario selector illustrates expected assertions and useful evidence. It does not run a protocol test suite or report that these properties have been verified in a released node.

[View the diagram or interactive example](<https://quantumchain.info/docs/developers/testing-and-conformance#failure-lab>). Visual-only examples are not reproduced in this text export.

## Use complementary kinds of evidence

| Layer | What it can establish | Limit |
| --- | --- | --- |
| Unit / codec vectors | Exact expected interpretation of known cases | Only the tested cases and chosen format |
| Property and state-machine tests | Invariants across generated inputs or transitions | Depends on generators and the model |
| Integration / fault tests | Behavior across components under controlled failures | Depends on environment coverage |
| Fuzzing | Unexpected input handling and robustness findings | No complete correctness guarantee |
| Formal reasoning | Properties within a specified model and assumptions | Does not automatically prove the deployed implementation |

## Positive and negative vectors belong together

Shared vectors must identify their specification and schema versions. Passing them supports conformance to that scope; it does not establish all possible safety, performance or operational properties.

| Vector family | Positive case | Negative case |
| --- | --- | --- |
| Transaction / witness | Canonical encoding and authorized descriptor | Malformed encoding, wrong network or invalid signature |
| Block / certificate | Valid structure and authority context | Invalid vote set or incompatible epoch context |
| State / proof | Correct commitment and anchored proof | Mismatched root or malformed evidence |
| Snapshot | Manifest and chunks reconstruct the expected state | Corruption, scope mismatch or incomplete reconstruction |

## High-value properties to protect

Consensus claims depend on the specified network and honest-validator assumptions. A local test must record those assumptions rather than treating one successful run as a universal guarantee.

- Canonical transaction bytes and identity are unambiguous.
- Invalid transitions do not mutate canonical state.
- Amounts and partitions remain consistent with authorized supply and fee rules.
- A validator identity cannot sign conflicting messages in the same protected context.
- Snapshot and proof roots match the declared finalized anchor.
- Version activation cannot create ambiguous interpretation within one execution context.

## Make the evidence traceable

Keep failure bundles, negative cases and compatibility decisions with the release record. A change to an invariant requires explicit review of its tests and assumptions; weakening a test to hide a regression is not conformance.

An evidence chain, not a claim that a review or release has occurred.

1. **Requirement** — Identify the specification section and invariant.
2. **Test** — Bind vectors and scenarios to that requirement.
3. **Implementation** — Record the tested code and toolchain revision.
4. **Release evidence** — Publish scope, results and unresolved findings.

## Related reading

- [Development networks](<https://quantumchain.info/docs/nodes/development-network>)
- [Synchronization & snapshots](<https://quantumchain.info/docs/nodes/synchronization>)
- [Developer orientation](<https://quantumchain.info/docs/developers/getting-started>)
- [QuantumChain whitepaper](<https://quantumchain.info/whitepaper>)
