-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate how to use fuzzing in Spring unit tests #2321
Labels
comp-fuzzing
Issue is related to the fuzzing
comp-spring
Issue is related to Spring projects support
ctg-enhancement
New feature, improvement or change request
Milestone
Comments
One not mentioned alternative, is to always use fuzzing in unit tests, and generate two (possibly nested) test classes:
Furthermore, if either of these classes turns out to be empty we should skip it. Finally, the only scenario when these two test classes can be merged into one seem to be when we have no |
@IlyaMuravjov Please discuss possibility of mocking in Spring-specific-only Fuzzing |
6 tasks
IlyaMuravjov
added a commit
that referenced
this issue
Aug 21, 2023
* Extract `JavaFuzzingContext` into separate interface * Add mock and inject mocks value providers * Add `StateBeforeAwareIdGenerator` * Properly handle `canHaveRedundantOrMissingMocks` in instrumentation * Properly create `void` models (for mocking `void` methods) * Add utils to ease configuring `ApplicationContext` * Configure Spring unit tests to use fuzzer with mocks * Refactor to only transform `JavaValueProvider` via `applicationContext` (avoid redundant lambdas) * Fix test compilation * Improve default mock answers of unmockable types (arrays and sealed interfaces) * Set default fuzzing value to 0.3 for Spring * Avoid creating too deep dynamic mocks * Avoid recording multiple mock answers if same answer is reused over and over again * Fix JS compilation --------- Co-authored-by: Egor Kulikov <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
comp-fuzzing
Issue is related to the fuzzing
comp-spring
Issue is related to Spring projects support
ctg-enhancement
New feature, improvement or change request
Description
We should finally investigate what to do with fuzzer in unit tests.
No configuration
mode?Investigate is it useful to generate unit tests with Fuzzing with Spring configuration applied
Substitute interfaces with implementations.
Seems that at least non-Spring classes (that do not inject mocks) Fuzzer may be useful in the mode with configuration too.
Investigate other cases to use Fuzzing with configuration.
There is a connected question how do we test some Utils class in Spring projects now, that injects nothing
The text was updated successfully, but these errors were encountered: