tests: add Vec + String fuzz harnesses#596
tests: add Vec + String fuzz harnesses#5960xllx0 wants to merge 3 commits intorust-embedded:mainfrom
Vec + String fuzz harnesses#596Conversation
Adds a basic fuzzing test harness using `cargo-fuzz` to run randomized tests against the `Vec` type.
Adds the `testfuzz` workflow to CI for a short fuzz test run on each pull request.
I'm a bit puzzled as to what is being tested here. 🤔 Typically fuzzing is useful for finding out issues with parsers and decoders (i-e something that handles external data) but Vec is just keeping things as they are in the memory. |
Definitely, this harness was the simplest one to open the conversation about introducing fuzzing into the library. It would probably be more useful in a If you have a particular type in mind, I'd be happy to write a harness for it, and add it to this PR. |
Not really. It doesn't do any parsing either. It just stores whatever you give it.
Tbh, I don't think it's a good idea to look for problems for a solution. I'm sure there is some API in this crate that could possibly make use of fuzzing but I don't know it. |
The reason I suggested It decodes from UTF-16 and UTF-8, which is currently handled by the implementation in the
That's an interesting way to frame my contribution to review and test the library. |
I actually thought about that but
I'm sorry for my bluntness. Fuzzing in general is extremely useful so I appreciate what you're trying to do. What I said, was more about how I feel about the conversation is going so far here between us, rather than a criticism of your contribution in general. If you could find a good use for fuzzing in this library, I'd be very happy to help you add fuzzing for that here. I just currently don't see a place for it. Perhaps I'm wrong and that's why I'm keeping this open for now. Perhaps other maintainers would have a better idea than me and can suggest a use. 🤷 |
Adds a basic fuzzing harness for `String` UTF-8 and UTF-16 parsing.
Vec fuzz harnessVec + String fuzz harnesses
No worries, I understand where you're coming from now.
Sounds good to me, I'm happy to leave this up if for no other reason than to serve as a reference point for future contributors who would want to introduce fuzz testing.
This makes sense to me as well. If there ever was a decision to use a custom UTF-8/UTF-16 parser, the fuzz tests might be more useful here. I'll review the Thanks for the feedback. |
Adds a basic fuzzing test harness using
cargo-fuzzto run randomized tests against theVecandStringtypes.