The `arbitrary` crate is approaching 1.0!

The Arbitrary crate lets you construct arbitrary instance of a type.

This crate is primarily intended to be combined with a fuzzer like libFuzzer and cargo-fuzz or AFL, and to help you turn the raw, untyped byte buffers that they produce into well-typed, valid, structured values. This allows you to combine structure-aware test case generation with coverage-guided, mutation-based fuzzers.

Learn more:

And the arbitrary crate is approaching 1.0! We've already released two 1.0 release candidates. Now we're asking for your help: Please try out the latest release candidate with your existing fuzz targets (or new ones) and let us know if there is anything that isn't smooth, feels like a regression, etc.

# Update your Cargo.toml to take the release
# candidate for a spin.
[dependencies]
arbitrary = "1.0.0-rc2"

If all goes smoothly, we intend to release 1.0 in two weeks on February 23rd.


CHANGELOG

1.0.0-rc2

Released 2021-02-09.

Added

  • The Arbitrary trait is now implemented for &[u8]. #67

Changed

  • Rename Unstructured#get_bytes to Unstructured#bytes. #70
  • Passing an empty slice of choices to Unstructured#choose returns an error. Previously it would panic. 71

1.0.0-rc1

Released 2020-11-25.

Added

  • The Arbitrary trait is now implemented for &str. #63

Changed

  • The Arbitrary trait now has a lifetime parameter, allowing Arbitrary implementations that borrow from the raw input (e.g. the new &str implementaton). The derive(Arbitrary) macro also supports deriving Arbitrary on types with lifetimes now. #63

Removed

  • The shrink method on the Arbitrary trait has been removed.

    We have found that, in practice, using internal reduction via approaches like cargo fuzz tmin, where the raw input bytes are reduced rather than the T: Arbitrary type constructed from those raw bytes, has the best efficiency-to-maintenance ratio. To the best of our knowledge, no one is relying on or using the Arbitrary::shrink method. If you are using and relying on the Arbitrary::shrink method, please reach out by dropping a comment here and explaining how you're using it and what your use case is. We'll figure out what the best solution is, including potentially adding shrinking functionality back to the arbitrary crate.

Also: huge huge huge thanks to @frewsxcv for adding all the finishing touches and polish to push this crate to 1.0!!!!

2 Likes