Fuzzer cannot create any graphs of objects, other than trees, and fairly rarely reuses the same primitive values in different places #2429
Labels
comp-fuzzing
Issue is related to the fuzzing
ctg-enhancement
New feature, improvement or change request
Description
Right now fuzzer can only create trees of objects (as opposed to DAGs and cyclic graphs), which severely limits its ability to test methods that, for example, try to find something in a database and need to be passed same attribute values as the ones used when saving data to the database.
Real world (concrete) example
To test successful scenario for method
UserService.getOneByUsernameAndRole()
inMedical-Web-App
project, method under test should be called with the sameusername
androle
that were used when creatingUser
fororderRepository.save(User)
modification.Additional context
Limited ability to generate equal values shouldn't be fixed by simply increasing value of
probReuseGeneratedValueForSameType
, because it only helps with generating values that are passed to the same method, while in concrete example above one pair ofusername
androle
are passed tosetUsername()
andsetRole()
respectively, while the other one is passed togetOneByUsernameAndRole()
.To Reproduce
Run the following unit tests.
Limited ability to generate equal values:
Inability to create DAGs and cyclic object graphs:
Expected behavior
All unit tests pass.
Actual behavior
All unit tests fail.
Visual proofs (screenshots, logs, images)
Additional concerns
When generation of cyclic object graphs is supported, fuzzer still must not generate graphs that can't be constructed in practice (i.e. cyclic graphs of immutable objects), meaning the following test should continue to pass.
The text was updated successfully, but these errors were encountered: