-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathConfiguration.kt
More file actions
98 lines (79 loc) · 2.89 KB
/
Configuration.kt
File metadata and controls
98 lines (79 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package org.utbot.fuzzing
import kotlin.math.pow
/**
* Configures fuzzing behaviour. Usually, it is not required to tune anything.
*/
data class Configuration(
/**
* Choose between already generated values and new generation of values.
*/
var probSeedRetrievingInsteadGenerating: Int = 70,
/**
* Choose between generation and mutation.
*/
var probMutationRate: Int = 99,
/**
* Fuzzer creates a tree of object for generating values. At some point this recursion should be stopped.
*
* To stop recursion [Seed.Recursive.empty] is called to create new values.
*/
var recursionTreeDepth: Int = 5,
/**
* The limit of collection size to create.
*/
var collectionIterations: Int = 5,
/**
* Energy function that is used to choose seeded value.
*/
var energyFunction: (x: Long) -> Double = { x -> 1 / x.coerceAtLeast(1L).toDouble().pow(2) },
/**
* Probability to prefer shuffling collection instead of mutation one value from modification
*/
var probCollectionShuffleInsteadResultMutation: Int = 75,
/**
* Probability of creating shifted array values instead of generating new values for modification.
*/
var probCollectionDuplicationInsteadCreateNew: Int = 10,
/**
* Probability of creating empty collections
*/
var probEmptyCollectionCreation: Int = 1,
/**
* Probability to prefer change constructor instead of modification.
*/
var probConstructorMutationInsteadModificationMutation: Int = 30,
/**
* Probability to a shuffle modification list of the recursive object
*/
var probShuffleAndCutRecursiveObjectModificationMutation: Int = 30,
/**
* Probability to prefer create rectangle collections instead of creating saw-like one.
*/
var probCreateRectangleCollectionInsteadSawLike: Int = 80,
/**
* Probability of updating old seed instead of leaving to the new one when [Feedback] has same key.
*/
var probUpdateSeedInsteadOfKeepOld: Int = 70,
/**
* When mutating StringValue a new string will not exceed this value.
*/
var maxStringLengthWhenMutated: Int = 128,
/**
* Probability of reusing same generated value when 2 or more parameters have the same type.
*/
var probReuseGeneratedValueForSameType: Int = 1,
/**
* When true any [Seed.Collection] will not try
* to generate modification if a current type is already known to fail to generate values.
*/
var generateEmptyCollectionsForMissedTypes: Boolean = true,
/**
* When true any [Seed.Recursive] will not try
* to generate a recursive object, but will use [Seed.Recursive.empty] instead.
*/
var generateEmptyRecursiveForMissedTypes: Boolean = true,
/**
* Limits maximum number of recursive seed modifications
*/
var maxNumberOfRecursiveSeedModifications: Int = 10,
)