This is very cool!
Have you tried to run it on stdlib? If yes, what are the results?
Finding new bugs in stdlib is always a good demo of a tool :)
I agree that this should be an independent layer on top of go-fuzz (or go tool).
I agree that structured inputs are especially helpful here.
And I agree that multiple fuzz functions should be supported
gracefully to move fuzzing closer to unit testing (you have lots of
unit tests and you are not restricted to running 1 test at a time, you
just say "run the tests").
Why is the constructor mode is optional?
I agree that generating nil checks is probably the right thing. Since
it's doing assumptions and will have some false positives, the right
way to look at it may be as follows: it generates as much code as
possible, maybe with blocks with some additional checks, maybe with
some TODOs for a human (e.g. // TODO: delete this if the method should
handle nil) and then human looks at it at deletes excessive code
(deleting code is easier than writing!). Then maybe it can avoid some
of the knobs?
It would be super awesome if it could detect round-trip functions
(like UUID.MarshalText/UnmarshalText) and generate round-trip fuzz
tests. Not sure how hard it is to do, but could be tuned to work at
least on main things from stdlib (compress/encoding).
Another idea looking at uuid_fuzz.go. If I would be writing a fuzz
function for that package I would try to combine as many methods in a
single Fuzz function as possible. E.g. Unmarshal and then call all of
the accessors. This would both help to reduce the number of fuzz
functions, but also would help with coverage guiding (one method helps
to progress with another, then vise versa and so on). Though, an
obvious problem is that some methods may already receive the object in
some limited states (rather than full generality of what fuzzer could
generate). Perhaps your idea of calling different methods in a loop is
better solution for this.
> --
> You received this message because you are subscribed to the Google Groups "golang-fuzzing-proposal" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
golang-fuzzing-pr...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-fuzzing-proposal/d220ac98-0dc2-4a5e-938d-3c68751775bb%40googlegroups.com.