You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mutation-framework.md
+164Lines changed: 164 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -317,6 +317,170 @@ class SimpleClassFuzzTests {
317
317
}
318
318
```
319
319
320
+
## @ValuePool: Guide fuzzing with custom values
321
+
322
+
The `@ValuePool` annotation lets you provide concrete example values of any [supported type](#supported-types) (except for cache-based mutators) that Jazzer's mutators will use when generating test inputs.
323
+
This helps guide fuzzing toward realistic or edge-case values relevant to your application.
324
+
325
+
### Basic Usage
326
+
327
+
You can apply `@ValuePool` in two places:
328
+
-**On method parameter (sub-)types** - values apply only to the annotated types
329
+
-**On the test method itself** - values propagate to all matching types across all parameters
Jazzer automatically routes values to mutators based on type:
361
+
- Strings in your value pool → String mutators
362
+
- Integers in your value pool → Integer mutators
363
+
- Byte arrays in your value pool → byte[] mutators
364
+
365
+
**Type propagation happens recursively by default**, so a `@ValuePool` on a `Map<String, Integer>` will feed both the String mutator (for keys) and Integer mutator (for values).
366
+
367
+
---
368
+
369
+
### Supplying Values: Two Mechanisms
370
+
371
+
#### 1. Supplier Methods (`value` field)
372
+
373
+
Provide the names of static methods that return `Stream<?>`:
0 commit comments