Testing

Scepter uses layered testing.

cargo test

Unit tests live beside modules and cover examples at API boundaries.

Property tests live in tests/properties.rs and check invariants over generated inputs, such as lexicographic ordering, route uniqueness, and bucket behavior.

Mutation-regression tests live in tests/mutation_regression.rs. They capture edge cases discovered by mutation testing so future changes keep those behaviors observable.

Run the full mutation suite manually:

cargo mutants --timeout 120 --jobs 2

The generated mutants.out/ directories are local artifacts and are ignored by git.

Fuzzing uses cargo-fuzz with libFuzzer. Smoke the harness locally:

just fuzz-smoke

Production readiness from a repository checkout requires one billion libFuzzer runs per target:

just fuzz-billion

For targeted campaigns, set FUZZ_TARGETS and FUZZ_RUNS_PER_TARGET before running scripts/fuzz-campaign.sh.