Releases: jqwik-team/jqwik
Minor Improvements
New and Enhanced Features
-
Added two edge cases for generation of integral numbers.
-
Reporting of parameters that changed during execution of property is now better
at detecting real changes.
Breaking Changes
- Examples with a failing assumption - i.e. throwing a
TestAbortedException
-
will now be reported as being skipped. See #122
for motivation and reasoning.
Bug Fixes
-
Using some arbitraries with
Arbitrary.sample()
outside of a jqwik context
no longer worked.
Now it does again. -
The default character generator was erroneously considered to produce unique
characters. Resulted in a strange to analyze
bug when generating functions
Edge case generation and shrinking improvements
New and Enhanced Features
-
Shrinking behaviour of arbitraries created with
Combinators.withBuilder(..)
is now much better, especially much faster. -
Upgrade to JUnit Platform 1.7.0
Breaking Changes
-
A maximum of 1000 (instead of 10000) edge cases is generated per arbitrary.
-
Arbitraries that allow nullables through
Arbitrary.injectNull()
or
annotation@WithNull
will now shrink their values tonull
if possible.
Bug Fixes
-
With a lot of edge cases sometimes only edge cases were generated.
Now the minimum ratio is 1 edge case in 3 generating steps. -
Warning about combinatorial explosion of edge cases generation is
now logged only once. -
Edge cases for
oneOf(..)
andfrequencyOf(..)
generators are now correctly being shrunk.
Minor Improvements and Convenience Additions
New and Enhanced Features
-
Added
Tuple.of()
andTuple.empty()
to create an empty tuple. -
The time out for bounded shrinking can now be changed in
jqwik.properties
-
Sample reporting will now report changes to parameters during property execution
-
Added some convenience to use POJOs as builders:
BuilderCombinator.build()
: Return arbitrary of builder itselfCombinableBuilder.inSetter(..)
: Set a builder's property and go on using it
-
Added
SampleReportingFormat.reportJavaBean(Object bean)
Breaking Changes
- Shrinking is no longer bound by number of shrinking attempts, but by time with a 10 seconds default.
The reason is that counting shrinking attempts in a consistent manner was difficult, and
shrinking could take very very long despite being inBOUNDED
mode.
Bug Fixes
- edge cases generation will be stopped when 10000 edge cases have been found.
See #113
Recursive Generation Improvements
New and Enhanced Features
-
Arbitraries.lazyOf(Supplier<Arbitrary<T>> ...)
is now the method of choice for
recursive value generation. It has much better shrinking behaviour than the
more genericlazy()
combined withoneOf()
. -
Added
PropertyLifecycleContext.attributes()
, which allows to query, set and change
a property method's attributes like number of tries and seed within a
AroundPropertyHook
lifecycle hook. -
Added
@PropertyDefaults
annotation which allows to set the defaults
of all property methods in a container.
Breaking Changes
- No known breaking changes
Bug Fixes
- Made loading of services thread-safe to allow use of jqwik generators
in parallel JUnit runs: #117.
Thank you, https://github.com/Danny02!
Shrinking Reloaded
New and Enhanced Features
-
Shrinking has been re-implemented from scratch. Should be more predictable and
shrink to smaller samples in most cases. -
Shrinking now has stronger equivalence requirements for falsification:
- Same type of assertion error or other exception
- Assertion error or exception thrown from the same code location
-
Shrinking
@AlphaChars
will now shrink to uppercase letters (if possible)
since their Unicode codepoint is smaller. -
Negative numbers are shrunk to their positive counterpart if possible
-
Changes in property result reporting:
- Shrunk samples have now header line "Shrunk Sample ( steps)"
- If no shrinking took place samples have header line "Sample"
- Original samples now also report the original error
- Action sequences in stateful properties got their own reporting format
-
Arbitraries.frequencyOf()
now takes covariant arbitrary types
Breaking Changes
-
Exceeding shrinking bound is now logged as warning instead of being reported
through JUnit platform reporting -
Deprecated interface
net.jqwik.api.ShrinkingSequence
. Throw all your implementations away! -
Deprecated class
net.jqwik.api.FalsificationResult
. No longer used anywhere. -
Deprecated method
Shrinkable.shrink(Falsifier<T> falsifier)
.
It's no longer used anywhere.
Bug Fixes
- Reporting an exhausted property had been broken since
1.2.4
and nobody noticed.
Works again.
Fixing Bugs and Adapting Structure
New and Enhanced Features
-
Added
Arbitrary.dontShrink()
-
Added
SetArbitrary.mapEach()
-
Added
SetArbitrary.flatMapEach()
-
Added
ListArbitrary.mapEach()
-
Added
ListArbitrary.flatMapEach()
-
Added
Arbitraries.just(aConstant)
and deprecatedArbitraries.constant(aConstant)
.
Most other PBT libraries seem to usejust
for this functionality. -
Added programmatic access to JUnit 5 platform reporting
Breaking Changes
-
Introduced
StreamableArbitrary
hierarchy:Arbitrary.set()
now has return typenet.jqwik.api.arbitraries.SetArbitrary
Arbitrary.list()
now has return typenet.jqwik.api.arbitraries.ListArbitrary
Arbitrary.stream()
now has return typenet.jqwik.api.arbitraries.StreamArbitrary
Arbitrary.iterator()
now has return typenet.jqwik.api.arbitraries.IteratorArbitrary
-
Arbitraries.maps(...)
now has return typenet.jqwik.api.arbitraries.MapArbitrary
-
net.jqwik.api.lifecycle.Reporter
moved tonet.jqwik.api.Reporter
Bug Fixes
-
Reporting samples with circular dependencies does no longer throw an exception
-
Reporting test failure due to exception without message
no longer leads to ignored test -
Reporting shrunk samples now report the actual sample and not a freshly generated one
Reporting Samples
New and Enhanced Features
-
Reporting of falsified, shrunk and generated samples has been completely reworked.
See this issue for more details. -
Added
Arbitrary.ignoreException(exceptionType)
which allows to ignore exceptions during value generation.
Breaking Changes
-
Arbitraries.of(List<T>)
replaced withArbitraries.of(Collection<T>)
-
Arbitraries.ofSuppliers(List<Supplier<T>>)
replaced withArbitraries.of(Collection<Supplier<T>>)
Bug Fixes
No open bugs had been reported.
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
Decimal Ranges with Borders Excluded
New and Enhanced Features
-
BigDecimalArbitrary
now allows specifying excluded min and max values:BigDecimalArbitrary.between(BigDecimal min, boolean minIncluded, BigDecimal max, boolean maxIncluded)
BigDecimalArbitrary.lessThan(BigDecimal max)
BigDecimalArbitrary.greaterThan(BigDecimal min)
-
Annotation
@BigRange
has two new optional attributesminIncluded
andmaxIncluded
-
DoubleArbitrary
now allows specifying excluded min and max values:DoubleArbitrary.between(double min, boolean minIncluded, double max, boolean maxIncluded)
DoubleArbitrary.lessThan(double max)
DoubleArbitrary.greaterThan(double min)
-
Annotation
@DoubleRange
has two new optional attributesminIncluded
andmaxIncluded
-
FloatArbitrary
now allows specifying excluded min and max values:FloatArbitrary.between(float min, boolean minIncluded, float max, boolean maxIncluded)
FloatArbitrary.lessThan(float max)
FloatArbitrary.greaterThan(float min)
-
Annotation
@DoubleRange
has two new optional attributesminIncluded
andmaxIncluded
-
Warning about JUnit annotations only shows up when test container class has
jqwik property or example methods. -
Upgrade to JUnit Platform 1.6.2
Breaking Changes
- Minor changes to yet undocumented Lifecycle Hooks API
Release 1.2.6: Lifecycle Hooks Improvements
Breaking Changes
- More changes to Lifecycle Hooks API in order to support a
jqwik Spring extension