Random Distribution, Edge Cases and More
New and Enhanced Features
-
Added user-guide documentation for Lifecycle Hooks
-
Added new statistics report formats: Histogram and NumberRangeHistogram
-
Improved shrinking of dependent parameters.
-
Added
Arbitraries.ofSuppliers(..)
to choose among a set of mutable objects. -
You can now influence the distribution of random number generation:
All numeric arbitraries now supportwithDistribution(RandomDistribution)
to choose betweenRandomDistribution.biased()
(default),
RandomDistribution.uniform()
andRandomDistribution.gaussian(borderSigma)
. -
Default number generation has now a much higher bias towards numbers
that are closer to the shrinking target of a number range. -
Using a faster implementation of
java.util.Random
under the hood -
Massively improved and enhanced generation of edge cases
-
Edge Cases Mode is now being reported per property
-
Added
StringArbitrary.withChars(Arbitrary<Character> characterArbitrary)
-
Added
CharacterArbitrary.with(Arbitrary<Character> characterArbitrary)
-
Promoted APIs from
EXPERIMENTAL
toMAINTAINED
Arbitraries.nothing()
Arbitrary.collect(Predicate<List<T>> until)
Arbitrary.sample()
Arbitrary.sampleStream()
Arbitrary.injectDuplicates(double duplicateProbability)
Arbitrary.tuple1()
Arbitrary.tuple2()
Arbitrary.tuple3()
Arbitrary.tuple4()
- Annotation
net.jqwik.api.From
- Class
net.jqwik.api.Functions
- Class
net.jqwik.api.arbitraries.FunctionArbitrary
Breaking Changes
-
Decimal Generation:
min
andmax
values are now rejected if they have more decimal places
than the generator'sscale
allows. -
Decimal Shrinking: Values without decimal places are no longer preferred while shrinking.
-
Removed deprecated APIs
Arbitrary.withSamples(T... samples)
RandomGenerator.withSamples(T... samples)
TryLifecycleContext.propertyContext()
net.jqwik.api.Statistics
: Replaced bynet.jqwik.api.statistics.Statistics
-
Set most public methods of
RandomGenerator
to API statusINTERNAL
-
Set
Arbitrary.exhaustive()
to API statusINTERNAL
-
Set
ExhaustiveGenerator
and all its methods to API statusINTERNAL
-
The evaluation order of
SkipExecutionHook
hooks can no longer be influenced.
Bug Fixes
-
An
OutOfMemoryError
will go through to the top. Fix for
bug report from jqwik-spring. -
Arbitraries.of(listOfValues)
would break when list does not allow null values. -
Generated functions now handle default methods correctly