Description
This proposal is to add fuzz test support to Go. This will add a new testing.F
type, support FuzzFoo
functions in _test.go
files, and add new go
command behavior.
A design draft has already been published and iterated on based on feedback from the Go community. This is the next step to propose that this design draft become a language feature.
This feature will be considered experimental in Go 1.18, and the API will not be covered by the Go 1 compatibility promise yet. The functionality that goes into this release is expected to have bugs and be missing features, but should serve as a proof-of-concept for which Go developers can experiment and provide feedback. Since this will be an experimental feature to start, we also expect there will be room for growth for the mutator and fuzzing engine in future Go releases.
Below are the parts of the design draft which will not make it into 1.18, and will be considered later on:
- support for fuzzing with
-race
and-msan
- support for fuzzing with
-keepfuzzing
- deduplication of similar crashes caused by different mutations, which would be a prerequisite to implementing
-keepfuzzing
(to reduce noise) - allowing special options while fuzzing (e.g. maximum input size)
- dictionary support
- customizable coverage instrumentation while fuzzing (e.g. to only instrument certain packages or files)
- custom generators for the mutator
- structured fuzzing support for struct and non-primitive types
- [Stretch goal for 1.18] structured fuzzing support for primitive types other than
[]byte
(e.g. string, int, float64)
Edit: This previously said 1.17, but it was not merged to master to make it into 1.17, so this has been updated to say "1.18" instead.