Input coverage = how well we test the range of inputs, not just which lines or branches we hit. For example:
fn is_even(n: u32) -> bool {
n % 2 == 0
}
Here, testing only n = 2
gives 100% line coverage but misses 0
, 1
, u32::MAX
, etc. That’s low input coverage. We want to hit edge cases, boundaries, and weird values.
By pairing property-based testing (proptest
via cargo test
) with coverage-guided fuzzing (libFuzzer via cargo +nightly fuzz
), we can explore code paths with broader, more meaningful input variation.