Releases: jqwik-team/jqwik
Stabilizations and Small Features
New and Enhanced Features
-
Upgraded to JUnit Platform 1.9.2
-
uniqueElements(..)
methods are now part ofStreamableArbitrary
interface.
See #466. -
Added
Arbitrary.ignoreException(int maxThrows, Class<? extends Throwable> exceptionType)
and
Arbitrary.ignoreExceptions(maxThrows, Class<? extends Throwable> ... exceptionTypes)
Breaking Changes
no breaking changes
Bug Fixes
-
Fixed timezone-related bug in time module.
-
Fixed "Shrink&Grow" bug: #439
Performance, Bugs and Small Things
New and Enhanced Features
-
Introduced
Arbitrary.ignoreExceptions(exType1, exType2, ...)
. -
Introduced
@Provide(ignoreExceptions = {<ExceptionType>})
attribute, which allows to ignore exceptions in provider methods in a simple way. -
Introduced
Footnotes.addAfterFailure(Supplier<String>)
.
See #310. -
Fixed quite a few performance and memory issues by means of merging pull requests
from vlsi. Thanks a lot! -
All methods of
net.jqwik.api.Arbitrary
and subtypes now have@CheckReturnValue
annotation.
That means you will get a warning from your IDE if you don't use the result of an arbitrary method,
given that you haveorg.jetbrains:annotations
as a compile-time dependency. -
Upgrade to Kotlin 1.8.0
Breaking Changes
-
Renamed
ChainArbitrary.addTransformation(..)
toChainArbitrary.withTransformation(..)
-
Renamed
ActionChainArbitrary.addAction(..)
toActionChainArbitrary.withAction(..)
Bug Fixes
Kotlin extensions and a bit of polishing
New and Enhanced Features
-
Upgrade to Kotlin 1.7.20
-
Added
Chain.transformers()
andActionChain.transformers()
to retrieve
the list of appliedTransformer
instances in a chain. -
Added the capability to
check statistical coverage of regex patterns. -
Added optional
filter
parameter to Kotlincombine
functions. -
Added Kotlin convenience function
Collection<T>.anyValue()
to facilitate Kotlin syntax for random value selection.
Breaking Changes
- All combinator types in
Combinators
are now interfaces instead of classes:Combinators.Combinator2
Combinators.Combinator3
Combinators.Combinator4
Combinators.Combinator5
Combinators.Combinator6
Combinators.Combinator7
Combinators.Combinator8
Combinators.ListCombinator
Bug Fixes
Stateful Properties Afresh
New and Enhanced Features
-
A new and more powerful approach to stateful testing
has been introduced into jqwik.
It's still "experimental" but supposed to be propagated to "stable" very soon. -
Promoted APIs from
EXPERIMENTAL
toMAINTAINED
:net.jqwik.api.ArbitrarySupplier
net.jqwik.api.Arbitraries.subsetOf(Collection<T>)
net.jqwik.api.Arbitraries.subsetOf(T...)
net.jqwik.api.JavaBeanReportingFormat
net.jqwik.api.arbitraries.StringArbitrary.repeatChars(double)
net.jqwik.api.domains.DomainContext.initialize(PropertyLifecycleContext)
net.jqwik.api.footnotes.EnableFootnotes
net.jqwik.api.footnotes.Footnotes
- Large chunks of the hooks and extension API in package
net.jqwik.api.lifecycle
-
Upgrade to JUnit Platform 1.9.1
Breaking Changes
-
Default configuration
forjqwik.failures.after.default
is nowSAMPLE_FIRST
.
Set it toPREVIOUS_SEED
if you want the behaviour of jqwik < 1.7. -
Arbitrary.filter(Predicate<T> predicate, int maxMisses)
has swapped arguments:
Arbitrary.filter(int maxMisses, Predicate<T> predicate)
to allow for a more idiomatic use in Kotlin.
See #334. -
Removed method
ActionSequenceArbitrary.ofMinSize(int)
which had been deprecated in 1.5.3 -
Removed method
ActionSequenceArbitrary.ofMaxSize(int)
which had been deprecated in 1.5.3 -
Removed method
Combinators.withBuilder(Supplier)
which had been deprecated in 1.5.4 -
Removed method
Combinators.withBuilder(Arbitrary)
which had been deprecated in 1.5.4 -
Removed type
Combinators.BuilderCombinator
which had been deprecated in 1.5.4 -
Removed type
Combinators.CombinableBuilder
which had been deprecated in 1.5.4 -
Removed method
Functions.FunctionWrapper.returns(Arbitrary)
which had been deprecated in 1.6.0 -
Removed method
CharacterArbitrary.digit()
which had been deprecated in 1.5.3
Bug Fixes and Improvements
-
Generated TLDs in
web-module
will no longer start with digit.
See #316. -
Fixed potential stack overflow when dealing with recursive types.
See #327. -
Property methods in Kotlin with
internal
modifier get now their correct name. -
Combined arbitraries will not explode so easily now.
See #342. -
Frequency based arbitraries now perform better with large number of options.
See #332. -
Generator memoization now works for most kinds of arbitraries and therefore uses less memory.
See #339. -
Arbitrary API methods
ofMinSize()
andofMinLength()
are handled more intelligently.
See #377.
Fixing Inconveniences
New and Enhanced Features
- After-execution sample will only be reported if there are visible differences
to the before-execution sample.
Breaking Changes
- The return type of
@Provide
methods in subclasses ofDomainContextBase
can no longer be supertypes of the target type to match.
For exampleArbitrary<List<?>>
will no longer match target type `List``
Bug Fixes
-
Some false-positive matching of provider method return types has been fixed.
-
Data-driven properties now allow compatible null values.
See #308.
Minor Improvements
New and Enhanced Features
-
Added
Arbitraries.subsetOf(T...values)
andArbitraries.subsetOf(Collection<? extends T> values)
-
Added Kotlin convenience function
Collection<T>.anySubset() : SetArbitrary<T>
-
DomainContext
andDomainContextBase
implementations can now provideSampleReportingFormat
classes and instances. -
Added
Arbitraries.recursive(Supplier<Arbitrary<T>> base, Function<Arbitrary<T>, Arbitrary<T>> recur, int minDepth, int maxDepth)
.
You can find a usage example here
Breaking Changes
-
Changed
DomainContext.getArbitraryProviders()
to returnCollection<ArbitraryProvider>
-
Changed
DomainContext.getArbitraryConfigurators()
to returnCollection<ArbitraryConfigurator>
Bug Fixes
- With
AfterFailureMode
set toSAMPLE_ONLY
orSAMPLE_FIRST
recreating previous sample could sometimes
take VERY long. This has been fixed.
Upgrades, Bugs and Suppliers
New and Enhanced Features
-
Upgraded
kotlinx
to version1.6.0
-
Upgraded to Kotlin 1.6.10.
-
@ForAll
and@From
now support
arbitrary suppliers
through asupplier
attribute. -
Changed Lifecycle Storage API
so that stored values can now implementStore.CloseOnReset
if they need closing action. -
Added capability to automatically resolve Arbitrary parameters.
This is an experimental feature. -
Module
time
has added the capability to
generateZonedDateTime
objects.
Many thanks to https://github.com/zinki97 for his continued support with this module!
Breaking Changes
-
kotlinx-coroutine-test
replacedrunBlockingTest
withrunTest
. -
Arbitrary provider methods can no longer have a
SubtypeProvider
parameter. -
Removed experimental API
Store.onClose()
.
Bug Fixes
After Failure Handling Redone
New and Enhanced Features
-
Complete Rework of after-failure handling:
AfterFailureMode.SAMPLE_FIRST
andAfterFailureMode.SAMPLE_ONLY
no longer depends on serializability of generated parameters.- If random seed is manually changed after a failing test run using
Property.seed=<new random seed>
the configured after-failure-mode does not apply for the next test run. SAMPLE_FIRST
andSAMPLE_ONLY
now also work for data-driven properties and exhaustive generation.
I recommend now to useSAMPLE_FIRST
as
default configuration value for most projects.
-
Added
PropertyDefaults.maxDiscardRatio
-
Added two Kotlin convenience functions:
fun <T> frequency(vararg frequencies: Pair<Int, T>)
fun <T> frequencyOf(vararg frequencies: Pair<Int, Arbitrary<out T>>)
-
Maximum size of generated collections and arrays is now generated regularly, if no size distribution is specified
Breaking Changes
-
Parameter annotations on array types (e.g.
@WithNull String[]
)
are no longer applied to the component type. -
The jqwik database no longer stores test run data for succeeding tests and properties.
This means that the file.jqwik-database
in now much smaller in most cases.
Bug Fixes
-
Using
@WithNull
on primitive array types no longer leads to anIllegalArgumentException
.
See #270. -
Generic array types in parameters can now be properly resolved
-
After-failure handling now (hopefully) works as expected
@UseType on Steroids
New and Enhanced Features
-
Added
TypeArbitrary.enableRecursion()
to enable recursive usage of type based
generation for types that do not have an applicable default arbitrary. -
@UseType
now has an additional attributeenableRecursion
,
which is set totrue
by default. -
Added experimental
Arbitraries.traverse(..)
as a mechanism to traverse a type
and all the types it depends on for arbitrary generation. -
TypeArbitrary.use(Executable creator)
is now deprecated and will be removed in 1.8.0 -
A container class will now inherit
@PropertiesDefault
annotations from superclass and interfaces. -
A container class will now inherit
@AddLifecycleHook
annotations from superclass and interfaces. -
A container class will now inherit
@Domain
annotations from superclass and interfaces. -
A container class will now inherit
@Tag
annotations from superclass and interfaces. -
Subclasses of
DomainContextBase
can now implementArbitraryProvider
which
is used as a provider for this domain. -
Subclasses of
DomainContextBase
can now implementArbitraryConfigurator
which
is used as a configurator for this domain. -
Multi-value arbitraries (ListArbitrary, SetArbitrary etc.) check minSize and maxSize
values at configuration time now. -
Upgrade to Kotlin 1.6.0. Versions 1.5.x should still work with the binary.
-
DomainContext
implementation classes can now be annotated with@Domain
themselves. -
Tags added to containers or property methods through
@Tag
annotations
are now being reported in execution result report as part of the key. -
After failure modes
SAMPLE_ONLY
andSAMPLE_FIRST
now discover changes
to parameter configuration with better accuracy, which leads to fewer
"impossible" samples being injected into property methods. -
Upgrade to JUnit Platform 1.8.2
Breaking Changes
-
Inherited property defaults could change behaviour of existing properties
-
Inherited lifecycle hooks could break existing properties
-
Inherited domain contexts could break existing properties
-
@UseType
will by default allow recursively resolve by type
Bug Fixes
-
Arbitraries.defaultFor(..)
did not apply configurators, but does now. -
Kotlin provider methods can now have
internal
modifier
Kotlin Support!!!
New and Enhanced Features
-
Added new module
jqwik-kotlin
for improved Kotlin support. -
Introduced new lifecycle hook
InvokePropertyMethodHook
in order to support some Kotlin specialties. -
Introduced new lifecycle hook
ProvidePropertyInstanceHook
in order to allow Kotlin singleton objects as test containers. -
Promoted APIs from
EXPERIMENTAL
toMAINTAINED
:net.jqwik.api.Arbitrary.ignoreException(..)
net.jqwik.api.Property.whenFixedSeed
net.jqwik.api.RandomDistribution
and its usages in numerical arbitrariesnet.jqwik.api.arbitraries.ArbitraryDecorator
net.jqwik.api.constraints.NotBlank
net.jqwik.api.domains.DomainContextBase
net.jqwik.api.statistics.StatisticsReport
-
Upgraded to JUnit Platform 1.8.1
-
Added experimental
JqwikSession
API to
use arbitraries outside jqwik's lifecycle. -
Added
Functions.FunctionWrapper.returning()
as replacement for deprecatedreturns()
. -
Added explicit module information for all modules.
See #243.
Thank you https://github.com/sormuras for the support!
Breaking Changes
-
Removed
AbstractDomainContextBase
which had been deprecated in 1.5.2 -
@WithNull
now has a default probability of 0.05 instead of 0.1 -
Configuration through a
jqwik.properties
file is no longer supported.
Please use JUnit Platform configuration instead. -
If a property methods returns
false
orBoolean.FALSE
it will now be considered to have failed.
All other return values - includingnull
- are regarded as success.
Before this version the method's return type had to beboolean
orBoolean
for the return value to matter.
Bug Fixes
-
Fixed memory leak when calling
Arbitrary.sample()
in jqwik scope.
See #236. -
Sometimes Kotlin method names have a postfix.
They can now be resolved and have normal display names. -
Arbitrary.withoutEdgeCases() sometimes did not work in combination with
filter, map and flatMap. -
When an arbitrary fails to generate values, the property seed will now be reported.