FFORGE//RS
← Roadmap

rust / LEVEL 3

Six happy paths and three surviving bugs

EST.35 MIN
01

THEORY / RETRIEVAL

What to restore

  • Select cases at equivalence-class and range boundaries
  • Judge tests by the defects they distinguish, not their line count

Boundaries carry more information

For a bounded integer parser, representative valid values are not enough. Zero, both accepted edges, one value beyond the upper edge, empty input and invalid syntax exercise different decisions in the implementation.

Mutation thinking exposes weak suites

Ask whether a plausible wrong implementation would still pass: accepting zero, widening the upper bound, or merging error categories. A small suite that rejects those mutants is stronger than many redundant happy paths.

CHECKPOINT

A parser accepts batch sizes 1..=1024. Which compact set best distinguishes range and syntax defects?

ISOLATED RUST 1.96
tests/batch-size-cases.rsEDIT

02 / TEST DESIGN

Design strong tests

Complete the table-driven suite returned by `cases`. Expected error codes are `empty`, `invalid`, and `range`. Hidden mutation checks require your cases to reject three realistic buggy parsers.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
1 / 64 KB
OUTPUT
Runner is waiting for a submission.