Version
jazzer-junit 0.28.0
Description
When a @FuzzTest takes only a single byte[] parameter but that parameter is annotated with mutation framework annotations (e.g. @WithLength), it is nonetheless treated as "classic" fuzz test and the annotations are ignored.
This can be quite irritating, especially if a user is unaware of the "classic" fuzz test mode, or when they change the signature of a mutation framework fuzz test to only have a byte[] parameter and suddenly the fuzz test turns into a "classic" one.
How to reproduce
Run this fuzz test in regression mode:
@FuzzTest
void test(byte @NotNull @WithLength(min = 1) [] b) {
if (b.length < 1) throw new AssertionError();
}
❌ Problem: The test fails for the "<empty input>" run because the @WithLength annotation was ignored and the array is empty.
Expected behavior
If a fuzz test takes only a single byte[] parameter but that parameter is annotated (potentially nested, e.g. for arrays or parameterized types) with mutation framework annotations, then the fuzz test should be executed by the mutation framework.
Might also need some tweaks to the https://github.com/CodeIntelligenceTesting/jazzer/blob/main/docs/mutation-framework.md documentation.