Snodge returns a fixed-size sample of a stream of mutations generated by applying a mutagen to a valid original value.
-
Original Value: an input value that is known to be valid (whatever that means for your application).
-
Mutation: a copy of the original value changed in some way that may prevent it from being valid input to your application.
-
Mutagen: a function that maps a value to a finite stream of lazy mutations. A mutagen may be exhaustive, returning a stream of all possible mutations of the original value. For types where that is not practical, a mutagen may return a stream of random mutations. The elements of the stream returned by a mutagen are lazy so that only the sampled elements need be calculated.
-
Sample: Snodge returns a sample from the stream of mutations generated by the mutagen. Elements of the stream are selected with uniform probability. The size of the sample can be adjusted to trade off confidence in the test against run time.
You can define a suitable mutagen for your test by composing primitive mutagens.
Examples for specific use cases are given in the cookbook.