There is another type of test that is very useful but is not integrated into the Rust standard library: fuzzing tests.
A fuzzing test will test a function's automatically generated input with the sole purpose of crashing this function or making it behave incorrectly. Fuzzing tests can be used to complement tests that are written manually because they can generate way more input than we can possibly write by hand. We will use cargo-fuzz to test our command parser.
First, we need to install it:
cargo install cargo-fuzz
Next, we will use the new cargo fuzz command to create a new fuzz test crate in our FTP server crate:
cargo fuzz init
This generated a few files. The most important of them and the one we will modify, is fuzz/fuzz_targets/fuzz_target_1.rs ...