A test harness is the infrastructure that runs tests and reports their results. Rust’s built-in libtest harness covers standard execution, while specialized helpers, fixtures, and parameterized testing require custom code or libraries. section 6.3 section 6.5
Use the harness ecosystem according to the testing requirement:
- Add parameterized testing with parameterized or test-case, fixtures with rstest, and alternative assertions with assert2. section 6.3
- Use proptest for generated inputs, failure reporting, and minimized failing cases; retain hand-picked values for specification compliance. section 6.3
- Treat shared test state as concurrent state: use atomic types, Arc, lazy_static, or Mutex rather than unsynchronized mutable statics. section 6.5
Finding an overflow with proptest
A generic add function can pass a property test for ordinary inputs yet fail on generated i64 values. proptest reports a minimal failing pair; changing the implementation and assertion to wrapping_add makes cargo test pass.

