title |
---|
jqwik Release Notes |
User guide, javadoc and kdoc
-
Introduced API to handle random seeds outside jqwik's lifecycle. See issue 581.
- Added
JqwikSession.getRandom()
- Added
JqwikSession.start(String randomSeed)
- Added
JqwikSession.run(String randomSeed, Runnable runnable)
- Added
No breaking changes
- Upgrade to Gradle 8.10.2
- Upgraded to JUnit Platform 1.11.1
- Upgraded to KotlinX 1.9.0
User guide, javadoc and kdoc
-
Upgraded to Kotlin 2.0.0
-
Upgraded to JUnit Platform 1.10.3
-
StatisticsCoverage.checkQuery(Predicate<? super List<?>> query)
:query
is now of typePredicate<? super List<?>>
instead ofPredicate<? super List<Object>>
. -
Nullability annotations have been added to many API methods and interfaces. This could lead to compile-time warnings or errors in your code if you are using tool chains that validate those.
-
UniqueElements.by()
now requires aClass<? extends Function<? extends @Nullable Object, ?>>
instead of aClass<? extends Function<?, Object>>
.
-
Tools like CheckerFramework did not play well with jqwik's (wrong) usage of
@Nullable
on type variables. This has been fixed. See issue 575 for details. Thanks to vlsi for working out all the nitty, gritty details! -
Fixed type matching bug as revealed in this comment
User guide, javadoc and kdoc
- Upgraded to Kotlin 1.9.24
No breaking changes
- Fixed bug that led to duplicate lifecycle invocations under inheritance. See issue 562.
User guide, javadoc and kdoc
-
Kotlin module: Added
anyForSubtypeOf<MyInterface>()
. Many thanks to jibidus for the contribution! -
Upgraded to Kotlin 1.9.23
No breaking changes
- Fixed bug in Kotlin module that let Java properties fail. See issue 557.
User guide, javadoc and kdoc
-
Upgraded to KotlinX 1.8.0
-
Upgraded to JUnit Platform 1.10.2
-
Upgraded to Kotlin 1.9.22
No breaking changes
-
Shrinking of strings with uniqueChars() constraint did not work properly. See issue 541.
-
Fixed integer generation bug with uniform distribution. See issue 544:
User guide, javadoc and kdoc
- Upgraded to JUnit Platform 1.10.0
No breaking changes
-
Nested test containers using
@Group
have not been working properly with JDK >= 18. Now they do. See issue 528. -
Fixed stack overflow exception while shrinking. See issue 526.
-
Fixed out of memory error while shrinking. See issue 525. Many thanks to Juhan Oskar Hennoste for providing a fix.
User guide, javadoc and kdoc
No new features
No breaking changes
-
Fixed bug when using
Combinators.combine()
on empty list of arbitraries. See issue 522. -
Fixed type resolution bug. See issue 519.
User guide, javadoc and kdoc
-
Upgraded to KotlinX 1.7.3
-
Upgraded to JUnit Platform 1.10.0
-
Upgraded to Kotlin 1.9.10
-
Added
StringArbitrary.uniqueChars()
to generate strings with unique characters. Discussion in issue 506. This is an experimental feature. -
Added constraint annotation
@UniqueChars
for String parameters. This is an experimental feature. -
Added
Arbitraries.fromGeneratorWithSize(..)
. See issue 494. This is an experimental feature. -
The Kotlin module got a brand new Combinator DSL.
-
Configurators that are based on
ArbitraryConfiguratorBase
will now consider any public method the name of which starts withconfigure
as a configuration method candidate. This allows heterogeneous arbitrary configurators that differ in arbitrary type only. -
Multiple
@CharRange
annotations are now also possible for@ForAll char
parameters. -
EXPERIMENTAL
APIs promoted toMAINTAINED
:Arbitrary.edgeCases(Consumer<EdgeCases.Config<T>> configurator)
Arbitrary.withoutEdgeCases()
@Property.edgeCases()
@ForAll.supplier()
@From.supplier()
@Provide.ignoreExceptions()
Combinator[2-8].filter(..)
ListCombinator.filter(..)
NumericalArbitrary.withDistribution(..)
TraverseArbitrary
TypeArbitrary.enableRecursion()
@UseType.enableRecursion()
DomainContext.getReportingFormats()
JqwikSession
-
Configurators that are based on
ArbitraryConfiguratorBase
must mark theirconfigure()
methods aspublic
. Private and package-scope methods are no longer supported considered as configuration method candidates. -
TypeUsage.canBeAssignedTo(TypeUsage)
behaves now closer to the Java compiler's rules about allowing assignments - including co- and contravariance. This has the potential to break domains, arbitrary providers, and lifecycle hooks that depend on the old, more loose, behaviour. -
@Provide
methods are now matched more strictly, based on assignability of returned arbitrary type. That means that potential mismatches of generated values and the corresponding@ForAll
parameters will show up already at property setup time through aCannotFindArbitraryException
. -
StringArbitrary.repeatChars(0.0)
will now redirect toStringArbitrary.uniqueChars()
. Previously it used to just make the probability of repeating characters very low. See discussion in issue 506. -
Removed deprecated method
TypeArbitrary.use(Executable)
. -
Removed deprecated methods
ActionChainArbitrary.addAction(action)
andActionChainArbitrary.addAction(weight, action)
.
-
Fixed bug when selecting parameterized values from domain contexts. See issue 499.
-
Fixed type variable resolution bug. See issue 492.
-
Fixed bug where presence of Kotlin module could mess up annotations of parameters in Java classes.
User guide, javadoc and kdoc
-
Upgraded to KotlinX 1.7.2
-
Upgraded to JUnit Platform 1.9.3
-
Upgraded to Kotlin 1.8.22
-
Added interface method
LifecycleContext.findRepeatableAnnotations(annotationClass)
and implementations in all subtypes. -
Performance improvement for
@UniqueElements
. Many thanks to DirkToewe. See PR 491. -
Added interface
MethodLifecycleContext
as a supertype of bothPropertyLifecycleContext
andTryLifecycleContext
.
- The new interface
MethodLifecycleContext
is a supertype of bothPropertyLifecycleContext
andTryLifecycleContext
. This could lead to compile-time errors in rare cases of self-implemented context classes.
- Fixed bug in
AroundPropertyHook
extensions combined with@AfterProperty
methods. See Issue 473.
User guide, javadoc and kdoc
-
Upgraded to JUnit Platform 1.9.2
-
uniqueElements(..)
methods are now part ofStreamableArbitrary
interface. See jqwik-team/jqwik#466. -
Added
Arbitrary.ignoreException(int maxThrows, Class<? extends Throwable> exceptionType)
andArbitrary.ignoreExceptions(maxThrows, Class<? extends Throwable> ... exceptionTypes)
StreamableArbitrary
now has to implementuniqueElements()
anduniqueElements(by)
-
Fixed timezone-related bug in time module.
-
Fixed "Shrink&Grow" bug: jqwik-team/jqwik#439
User guide, javadoc and kdoc
-
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
-
Renamed
ChainArbitrary.addTransformation(..)
toChainArbitrary.withTransformation(..)
-
Renamed
ActionChainArbitrary.addAction(..)
toActionChainArbitrary.withAction(..)
-
Fixed bug that included never executed actions in chains. See #426.
-
Fixed bug when generating list of consumers. See #446.
User guide, javadoc and kdoc
-
Upgrade to Kotlin 1.7.20
-
Added filtering to Combinators. See jqwik-team/jqwik#329.
-
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.
- 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
-
Histogramms will use
#
as character for bars on Windows now. See jqwik-team/jqwik#376. -
Fixed reflection bug for Java >= 17. See jqwik-team/jqwik#393.
User guide, javadoc and kdoc
-
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
-
Default configuration for
jqwik.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 jqwik-team/jqwik#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
-
Generated TLDs in
web-module
will no longer start with digit. See jqwik-team/jqwik#316. -
Fixed potential stack overflow when dealing with recursive types. See jqwik-team/jqwik#327.
-
Property methods in Kotlin with
internal
modifier get now their correct name. -
Combined arbitraries will not explode so easily now. See jqwik-team/jqwik#342.
-
Frequency based arbitraries now perform better with large number of options. See jqwik-team/jqwik#332.
-
Generator memoization now works for most kinds of arbitraries and therefore uses less memory. See jqwik-team/jqwik#339.
-
Arbitrary API methods
ofMinSize()
andofMinLength()
are handled more intelligently. See jqwik-team/jqwik#377.
User guide, javadoc and kdoc
- After-execution sample will only be reported if there are visible differences to the before-execution sample.
- 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``
-
Some false positive matching of provider method return types has been fixed.
-
Data-driven properties now allow compatible null values. See jqwik-team/jqwik#308.
User guide, javadoc and kdoc
-
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
-
Changed
DomainContext.getArbitraryProviders()
to returnCollection<ArbitraryProvider>
-
Changed
DomainContext.getArbitraryConfigurators()
to returnCollection<ArbitraryConfigurator>
- With
AfterFailureMode
set toSAMPLE_ONLY
orSAMPLE_FIRST
recreating previous sample could sometimes take VERY long. This has been fixed.
User guide, javadoc and kdoc
-
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 implement
Store.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!
-
kotlinx-coroutine-test
replacedrunBlockingTest
withrunTest
. -
Arbitrary provider methods can no longer have a
SubtypeProvider
parameter. -
Removed experimental API
Store.onClose()
.
-
Shrinking now still works when thrown exception has no stacktrace. See jqwik-team/jqwik#283.
-
Builders can now use nullable arbitraries. See jqwik-team/jqwik#295.
User guide, javadoc and kdoc
-
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
-
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.
-
Using
@WithNull
on primitive array types no longer leads to anIllegalArgumentException
. See jqwik-team/jqwik#270. -
Generic array types in parameters can now be properly resolved
-
After-failure handling now (hopefully) works as expected
User guide, javadoc and kdoc
-
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
-
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
-
Arbitraries.defaultFor(..)
did not apply configurators, but does now. -
Kotlin provider methods can now have
internal
modifier
User guide, javadoc and kdoc
-
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 jqwik-team/jqwik#243. Thank you https://github.com/sormuras for the support!
-
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.
-
Fixed memory leak when calling
Arbitrary.sample()
in jqwik scope. See jqwik-team/jqwik#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.
User guide and javadoc
-
Upgraded to JUnit platform 1.8.0
-
Improved performance of large collection generation. See jqwik-team/jqwik#227.
- Parameters for
StringArbitrary.ofMinLength()
andStringArbitrary.ofMaxLength()
are validated. See jqwik-team/jqwik#221.
-
Added reporting format for type
char[]
. -
@StatisticsReport(onFailureOnly = true)
now also works when failure is a statistics check failure.
User guide and javadoc
-
You can now add footnotes to failure reports
-
Added
StatisticsReport.onFailureOnly()
to suppress statistics reporting for properties that do not fail. -
Shrinking across several for-all parameters has been improved.
-
The Web module now supports web domain name generation.
-
The Time module now supports the generation of
java.time.OffsetDateTime
instances.
- Properties with single try (aka examples) with at least one
@ForAll
parameter will now produce a test report even if they succeed. See jqwik-team/jqwik#217.
- Fixed edge cases performance problem. See jqwik-team/jqwik#214
User guide and javadoc
-
Added default method
DomainContext.initialize(PropertyLifecycleContext)
which can be overridden if domain context implementations need access to the property context. -
Added
StringArbitrary.repeatChars(double repeatProbability)
-
Added
Arbitrary.optional(double presenceProbability)
-
Improved shrinking performance of combinator-based arbitraries
-
Added
net.jqwik.api.Builders
as replacement for the now deprecatednet.jqwik.api.Combinators.withBuilder(..)
API. Here's the relevant section in the user guide. -
Progress on generation of DateTimes: Objects of type
java.time.Instant
can now be generated by default. -
FloatArbitrary
andDoubleArbitrary
can now generate special values on demand.
-
Generated strings will no longer intentionally generate duplicate characters by default. You now have to tell it to do so.
-
Methods
Combinators.withBuilder(builderSupplier)
andCombinators.withBuilder(arbitrary)
are now deprecated.
-
Addressed performance issues raised in jqwik-team/jqwik#206
-
Fixed some type resolution and type usage bug found through https://github.com/mihxil/math.
User guide and javadoc
-
You can now influence the random distribution of the size of generated multi-value containers (sets, lists, arrays, streams, iterators and maps).
-
You can now influence the random distribution of the size of generated strings.
-
All container-based arbitraries (e.g. List, Sets, Strings) now generate containers without duplicated elements with a higher probability even when they have many elements.
-
String arbitraries now generate duplicate chars and series of chars with a higher probability.
-
Added
CharacterArbitrary.numeric()
andCharacterArbitrary.alpha()
.
-
ActionSequenceArbitrary
no longer extendsSizableArbitrary
. -
ActionSequenceArbitrary.ofMinSize()
andActionSequenceArbitrary.ofMaxSize()
is now deprecated. -
CharacterArbitrary.digit()
is now deprecated.
-
Module name now correctly set for testing, web and time modules. See jqwik-team/jqwik#201.
-
No longer throwing ConcurrentModificationException when using
sample()
within another generator. This happened in Java >= 11 only. See jqwik-team/jqwik#205
User guide and javadoc
-
Added new base class
DomainContextBase
, which changes the way how you typically provide domain contexts.That's the reason why
AbstractDomainContextBase
is now deprecated. -
Provider Methods annotated with
@Provide
now support implicit flat mapping. -
More progress on generation of DateTimes
-
Upgrade to JUnit Platform 1.7.2
-
Removed
leapYears(boolean withLeapyear)
from all date generating arbitraries. -
Changed
Arbitrary<T> Arbitraries.oneOf(List<T> choices)
toArbitrary<T> Arbitraries.oneOf(Collection<? extends T> choices)
-
Fixed bug in edge case generation: jqwik-team/jqwik#180
-
Fixed bug when running inner tests of an extended test container: jqwik-team/jqwik#179
-
Fixed bug in Tuple.toString(): jqwik-team/jqwik#187
User guide and javadoc
-
Implemented
@StatisticsReport.label
as suggested in jqwik-team/jqwik#146. -
Time module
- Generation of Times
- Generation of DateTimes got its first rudimentary support.
-
Added
StringArbitrary.excludeChars(char ... toExclude)
. See jqwik-team/jqwik#167.
- Trying to add a numerical edge case that is outside the arbitrary's
allowed range will now throw an
IllegalArgumentException
.
-
Fixed memory leakage introduced in 1.5.0.
-
Shrinking of flat mapped values would sometimes never end.
User guide and javadoc
-
Added constraint annotation
@NotBlank
for String parameters -
Generated email addresses get a few more edge cases
-
Shrinking of long Strings (length > 100) is faster now
-
Removed
Arbitrary.unique()
which had been deprecated in 1.4.0 -
Removed annotation
@Unique
which had been deprecated in 1.4.0 -
Removed
Arbitraries.constant(..)
which had been deprecated in 1.3.2
-
Fixed degraded generation performance introduced in version 1.4.0.
-
Arbitrary.withoutEdgeCases()
did not really get rid of all edge case generation. Now it does. -
Some arbitrary types, e.g.
Arbitraries.lazyOf()
could not be used in sampling. Now all should work. -
Bounded shrinking could previously result in an
OutsideJqwikException
.
Unless you don't have the time for migrating from Arbitrary.unique()
to
the new uniqueness approach
but still need some of the newly added features, you should directly upgrade to
version 1.5.0.
User guide and javadoc
-
Upgrade to JUnit Platform 1.7.1
-
Using
@Property(edgeCases = NONE)
will now also suppress the generation of edge cases in embedded arbitraries. -
You now have the capability to configure an arbitrary's edge case generation.
-
There is a new annotation attribute
@Property.whenSeedFixed
and a new configuration parameterjqwik.seeds.whenfixed
to warn or even fail when a property has been given a fixed random seed. See this issued for more details. Many thanks to osi for this contribution. -
jqwik's approach to specify uniqueness of generated objects has been completely revamped:
Arbitrary.unique()
and the annotation@Unique
are now deprecated and will be removed in version 1.5.- Uniqueness constraints are now handled by the elements' container.
- The new annotation to require uniqueness
is called
@UniqueElements
and applied to the container's type.
-
Arbitraries modified through
Arbitrary.unique()
, which is deprecated anyway, no longer generate edge cases. This is actually a bug fix since the generated edge were not considered for uniqueness. -
There's a new jqwik module
jqwik-time
which simplifies the generation of dates (and times in a future release). Many thanks to zinki97 for this contribution. -
There's a new jqwik module
jqwik-web
which is currently home of email addresses generation. -
Configuration parameters are now loaded via JUnit's Configuration Parameters mechanism. Parameters specified in
jqwik.properties
continue to work, but are considered deprecated. Log messages will be emitted for any used properties with their new name. Some parameter names have also changed. Many thanks to osi for this contribution. -
Using internal Kotlin methods as properties will now produce the correct name as seen in the Kotlin source code.
-
The User Guide has been restructured.
-
There will now be a warning log entry when a property with more than 1 try has no '@ForAll' parameters.
-
Promoted APIs from
EXPERIMENTAL
toMAINTAINED
- Mostly everything in package
net.jqwik.api.lifecycle
- Method
Arbitrary.dontShrink()
- Method
Combinators.CombinableBuilder.inSetter(..)
- Class
PropertyDefaults
- Class
Reporter
- Class
SampleReportingFormat
- Method
Tuple.of()
- Method
Tuple.empty()
- Method
BigDecimalArbitrary.shrinkTowards(..)
- Method
BigIntegerArbitrary.shrinkTowards(..)
- Method
ByteArbitrary.shrinkTowards(..)
- Method
DoubleArbitrary.shrinkTowards(..)
- Method
FloatArbitrary.shrinkTowards(..)
- Method
IntegerArbitrary.shrinkTowards(..)
- Method
LongArbitrary.shrinkTowards(..)
- Method
ShortArbitrary.shrinkTowards(..)
- Method
SetArbitrary.mapEach(..)
- Method
SetArbitrary.flatMapEach(..)
- Method
ListArbitrary.mapEach(..)
- Method
ListArbitrary.flatMapEach(..)
- Method
ActionSequence.withInvariant(..)
- Method
Statistics.coverage(..)
- Method
StatisticsCollector.coverage(..)
- Class
StatisticsCoverage
- Class
StatisticsEntry
- Mostly everything in package
-
Arbitraries.emails()
has been moved tonet.jqwik.web.api.Web.emails()
in new Web module. -
@net.jqwik.api.constraints.Email
annotation has been moved to@net.jqwik.web.api.Email
in new Web module. -
Parameters annotated with
@Email
will by default only generate "standard" email addresses. -
Removed deprecated APIs
Arbitrary.samples(..)
- Interface
FalsificationResult
SampleReportingFormat.reportJavaBean(..)
Shrinkable.shrink(Falsifier<T> falsifier)
- Interface
ShrinkingSequence
CharacterArbitary.with(Arbitrary<Character> characterArbitrary)
StringArbitary.withChars(Arbitrary<Character> characterArbitrary)
-
Unconstrained wildcards are no longer handled in a special way but just like unconstrained type variables.
-
Arbitrary.array(..)
now returnsArrayArbitrary
instead ofStreamableArbitrary
- Fixed bug that could lead to strange edge case generation behaviour
when
Arbitrary.edgeCases(edgeCasesConfig)
was used.
User guide and javadoc
- Introduced
JavaBeanReportingFormat
for simpler and configurable reporting of Java beans.
SampleReportingFormat.reportJavaBean(..)
has been deprecated. Will be removed in version 1.4.0.
-
Arbitraries.lazy()
did not allow exhaustive generation but does now. -
SampleReportingFormat.reportJavaBean(..)
can now handle methods namedis
orget
. -
SampleReportingFormat.reportJavaBean(..)
can now handle properties that returnOptional<T>
.
User guide and javadoc
-
Generating email addresses has now configuration options.
-
Generated email addresses now have fewer edge cases.
-
Added constraint annotation
@Email
for generating valid email addresses. -
Experimental support for changing an arbitrary's edge cases.
-
Constraint annotation
@StringLength
now works for any arbitrary that generates aString
. -
Range annotations (
@Byte|Short|Int|Long|Float|Double|BigRange
) do work now when applied to any arbitrary that generates the appropriate numeric type.
- Email arbitrary no longer generates domain hosts without top level domain
-
Reporting of null values in failed properties no longer fails with NPE.
-
Sampling arbitraries with null values no longer fails.
User guide and javadoc
-
You can now generate valid email addresses.
-
The header of the label column in histograms and number range histograms can now be changed.
-
The distribution of char groups when generating
Character
s orString
s is now weighted by the number of chars in each group so that each possible char has the same probability of being generated - except for edge cases. -
StringArbitrary.withChars(Arbitrary<Character>)
was deprecated -
CharacterArbitrary.with(Arbitrary<Character>)
was deprecated
No known bugs.
User guide and javadoc
-
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.
- Examples with a failing assumption - i.e. throwing a
TestAbortedException
- will now be reported as being skipped. See jqwik-team/jqwik#122 for motivation and reasoning.
-
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
User guide and javadoc
-
Shrinking behaviour of arbitraries created with
Combinators.withBuilder(..)
is now much better, especially much faster. -
Upgrade to JUnit Platform 1.7.0
-
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.
-
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.
User guide and javadoc
-
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)
- 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 in
BOUNDED
mode.
- edge cases generation will be stopped when 10000 edge cases have been found. See jqwik-team/jqwik#113
User guide and javadoc
-
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()
. Consult the user guide for an example. -
Added
PropertyLifecycleContext.attributes()
, which allows to query, set and change a property method's attributes like number of tries and seed within aAroundPropertyHook
lifecycle hook. -
Added
@PropertyDefaults
annotation which allows to set the defaults of all property methods in a container.
- No known breaking changes
- Made loading of services thread-safe to allow use of jqwik generators in parallel JUnit runs: jqwik-team/jqwik#117. Thank you, https://github.com/Danny02!
User guide and javadoc
-
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
-
Made loading of services thread-safe to allow use of jqwik generators in parallel JUnit runs: jqwik-team/jqwik#117. Thank you, https://github.com/Danny02!
-
Added
PropertyLifecycleContext.attributes()
, which allows to query, set and change a property method's attributes like number of tries and seed within aAroundPropertyHook
lifecycle hook.
-
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.
- Reporting an exhausted property had been broken since
1.2.4
and nobody noticed. Works again.
User guide and javadoc
-
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
-
Added
Tuple.Tuple5<T,T,T,T,T> Arbitrary.tuple5()
-
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
-
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
User guide and javadoc
-
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.
-
Arbitraries.of(List<T>)
replaced withArbitraries.of(Collection<T>)
-
Arbitraries.ofSuppliers(List<Supplier<T>>)
replaced withArbitraries.of(Collection<Supplier<T>>)
No open bugs had been reported.
User guide and javadoc
-
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 support
withDistribution(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
-
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.
-
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
User guide and javadoc
-
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
- Minor changes to yet undocumented Lifecycle Hooks API
User guide and javadoc
- More changes to Lifecycle Hooks API in order to support a jqwik Spring extension
User guide and javadoc
-
Added
@BeforeExample
as an alias of@BeforeProperty
-
Added
@AfterExample
as an alias of@AfterProperty
-
Lifecycle methods annotated with
@BeforeTry
,@AfterTry
,@BeforeProperty
,@AfterProperty
,@BeforeContainer
and@AfterContainer
can now have parameters that will be resolved using registeredResolveParameterHook
instances. -
Added
ActionSequence.withInvariant(String label, Invariant<M> invariant);
. -
Added
ActionSequence.peek(Consumer<M> modelPeeker)
. -
Arbitraries.sequences(Arbitrary<? extends Action<M>> actionArbitrary)
does now accept covariant subtypes and still returns typeArbitrary<Action<M>>
. -
Reporting text on failed statistics coverage check improved.
-
Upgrade to JUnit Platform 1.6.1
- Some fundamental changes to Lifecycle Hooks API in order to support a jqwik Spring extension
- Labelled statistics reports should now reliably being reported in order of first usage.
User guide and javadoc
-
Annotated lifecycle methods have been implemented:
@BeforeContainer
@AfterContainer
@BeforeProperty
@AfterProperty
@BeforeTry
@AfterTry
-
@StatisticsReport
can now also be used on container classes -
Statistical coverage checking can now be done in a fluent API style
-
Improved shrinking of parameters that require duplicate values for falsifying a property
-
Upgrade to JUnit Platform 1.6.0
-
Removed
Statistics.coverageOf()
. It's nowStatistics.label(..).coverage(..)
-
Falsifier
no longer extendsPredicate<T>
-
Many breaking changes in Lifecycle API; but this API had not been published or documented anyway.
No open bugs had been reported.
User guide and javadoc
-
The new big feature of this release is coverage checking.
-
Statistics reporting can now be switched off. Alternatively you can plug in your own reporting format.
-
Added
Arbitrary.injectDuplicates(duplicateProbability)
to enable the high probability generation of duplicate values -
Added
Arbitrary.tuple1(), Arbitrary.tuple2(), Arbitrary.tuple3(), Arbitrary.tuple4()
to generate tuples of same base type -
Character
\u0000
is being generated as default edge case in String and Character arbitraries - if it lies within the allowed character range.
-
Statistics.collect(..)
andStatisticsCollector.collect(..)
can no longer be called with no values. There must be at least one - but it can benull
. -
Statistics.collect(..)
andStatisticsCollector.collect(..)
must always be called with same number of parameters. -
Deprecated
net.jqwik.api.Statistics
. Usenet.jqwik.api.statistics.Statistics
instead. -
The standard property report is now the last thing to be reported, i.e. after statistics reports.
-
Default priority in AbstractDomainContextBase is now 0 (previously 1), i.e. they no longer supersede built-in jqwik arbitrary providers but mix in.
No open bugs had been reported.
User guide and javadoc
-
When configuration parameter
database
is set to empty, test run recording is now completely disabled. -
Exhaustive generation of single decimals and floats
-
Added
Arbitrary.sample()
andArbitrary.sampleStream()
for enabling the use of generators outside of properties -
Arbitraries.oneOf(Arbitrary<? extends T>... arbitraries)
does now accept covariant subtypes and still returns typeArbitrary<T>
.
- Deprecated
Arbitrary.withSamples(T... samples)
- Statistics formatting bug
- Exhaustive generation bug
- Using Arbitraries.forType() outside property bug
User guide and javadoc
- New configuration parameter
defaultGeneration
forjqwik.properties
file - Added
CharacterArbitrary.with(CharSequence allowedChars)
- Added
StringArbitrary.withChars(CharSequence allowedChars)
- Arbitraries of List, Set, Stream und arrays are now of type
StreamableArray
- Introduced
StreamableArray.reduce()
HashMap
can now be generated by default
-
Arbitrary.exhaustive()
must no longer be overridden in implementors of Arbitrary. OverrideArbitrary.exhaustive(long maxNumberOfGeneratedSamples)
instead. -
TypeUsage.getTypeArguments()
: In case of type variables or wildcard types this method will now return the upper bound's type arguments if there is a single upper bound and no lower bound. This enables correct generation of variables likeT extends Map<Integer, String>
.
-
@ForAll
annotation could not be replaced by self-made annotation. Now it can. -
Annotations in type parameters of bounds of type variables are now correctly recognized.
-
Annotations in type parameters of bounds of wildcards are now correctly recognized.
User guide and javadoc
- Introduced Labeled Statistics
- Added
Arbitraries.entries()
- Added default generation for
Map.Entry
instances - Enhanced statistics reporting by absolute count
- jqwik can now generate instances of functions and other functional types
- Provider methods do now accept two optional parameters
- New
@From
annotation to provide arbitraries for embedded type parameters
- Removed
CharacterArbitrary.between(min, max)
which had been deprecated in 1.1.3
-
Promoted from
API.Status.EXPERIMENTAL
toAPI.Status.MAINTAINED
:Arbitraries.forType(Class<T> targetType)
and interfaceTypeArbitrary
- Annotation
@UseType
and enumUseTypeMode
Arbitrary.fixGenSize(int genSize)
Combinators.withBuilder(Supplier<B> builderSupplier)
andCombinators.withBuilder(Arbitrary<B> builderArbitrary)
- Annotation
@Domain
and interfaceDomainContext
- Upgrade to JUnit platform 1.5.1
- Upgrade to Gradle 5.5.1
- Default character generation now excludes codepoints
0xd800
through0xdfff
- Fixed set generation bug jqwik-team/jqwik#65
- Fixed bug in Unshrinkable.equals. Many thanks to mhyeon-lee for that pull request!
- List and array generation from unique arbitraries now have a default max size that makes sense
User guide and javadoc
- Removed dependencies to internal classes in JUnit platform
- Added
Arbitraries.maps()
- Added default generation for
Map
instances @Domain
annotation can now also refer to inner class of test container's base class. Many thanks to larsrh for that pull request!
User guide and javadoc
- Added
shrinkTowards(value)
to all decimal number arbitraries: FloatArbitrary, DoubleArbitrary, BigDecimalArbitrary - Exceptions during test class instance creation are now reported as failures
- Removed caching of engine descriptor in JqwikTestEngine
User guide and javadoc
- Upgrade to junit-platform 1.4.2
- Added
Arbitrary.collect(Predicate<List<T>> until)
in order to collect values in a list - Added
shrinkTowards(value)
to all integral number arbitraries: ByteArbitrary, ShortArbitrary, IntegerArbitrary, LongArbitrary, BigIntegerArbitrary in order to change the shrinking target - Upgrade Gradle to 5.4.2
- Improved shrinking of collections
User guide and javadoc
- Whitespace characters for generation of Strings and chars are now platform and JDK version dependent. See this Github issue.
- Missing
@ForAll
annotation will now fail test - instead of skipping it. See this Github issue. - Added
CharacterArbitrary.with(char ... allowedChars)
- Added
CharacterArbitrary.range(char min, char max)
- Deprecated
CharacterArbitrary.between(char min, char max)
User guide and javadoc
- Added
Arbitrary.forEachValue(Consumer action)
- Fixed Kotlin compatibility issue
- Fixed decimal generation bug
- Update to JUnit Platform 5.4.1
User guide and javadoc
-
Added
Combinators.withBuilder
to enable a different way for combining arbitraries. -
You can configure if you want to report only failures.
-
The reporting format for run properties has changed.
-
Added
@Domain.priority()
to enable prioritisation of domain context classes. -
Added
Arbitraries.create
. -
Fixed problem with double and float conversion in range constraints. My thanks go to blairdye for that!
-
Annotation
@Provide
can now be placed on a "super method" i.e. a method from a superclass or super interface that is overridden. -
Annotation
@Provide
can now be placed on another annotation for composite annotations. -
Loosened matching of return type of
@Provide
to enable generic provider method's in derived container classes.
User guide and javadoc
-
Added capability to collect arbitrary providers and configurators in domains
-
Added
Arbitraries.defaultFor(TypeUsage typeUsage)
-
Added capability to generate objects from their type's constructors and factories
-
Breaking Change: Best fit search for provider methods is no longer supported. Reason: Using
@Domain
requires less magic and is a better abstraction for automatic arbitrary provision. -
Update to JUnit Platform 5.4
User guide and javadoc
-
Removed all deprecated APIs
- Annotation attribute
net.jqwik.api.Property.reporting()
- Class
net.jqwik.api.Tuples
- Method
net.jqwik.api.providers.TypeUsage.getAnnotation()
- Annotation attribute
-
jqwik now produces three artefacts: jqwik-api, jqwik-engine, jqwik
-
Filled in some missing parts in API Javadoc
-
Introduced
Arbitrary.allValues()
-
Adding annotations from JUnit Jupiter or Vintage engine will lead to warnings being logged
-
Range annotations (
IntRange
etc.) don't needmax
attribute any more -
@Positive
and@Negative
constraints no longer include 0 as possible value -
Added
@org.apiguardian.api.API
annotation to all types innet.jqwik.api.**
-
Added annotation
@Disabled
as a means to temporarily skip test methods or test containers
User guide and javadoc
- The probability of edge cases being generated is now higher
- New constraint annotation
@NotEmpty
- Arrays and varargs parameters hand configuration annotations down to their component type arbitrary
- Properties with unconstrained wildcards will now use any registered arbitrary for value generation
- Added
Arbitraries.frequencyOf()
- Added
Arbitraries.recursive()
- Integral number generation generates a few more edge cases
- You can use
@Size
to constrain the generation ofActionSequence
parameters - Some incompatible changes to the
ActionSequence
interface - jqwik.jar does no longer deliver a jqwik.properties file in its classpath
- jqwik logs WARNING if unsupported property is used in
jqwik.properties
file - Replaced configuration file property
rerunFailuresWithSameSeed
by `defaultAfterFailure' - Introduced
@Property(afterFailure)
ArbitraryConfiguratorBase
has new methodacceptType(TypeUsage)
, which can be overridden.- Added two new after-failure-modes:
SAMPLE_ONLY
andSAMPLE_FIRST
- Action sequences for state-based properties are serializable now
in order to enable
SAMPLE_ONLY
andSAMPLE_FIRST
- Exhaustive generation works for ambiguous arbitrary resolution if each arbitrary can be generated exhaustively
- Fixed bug related to correct throwable propagation when shrinking
- Erroneous properties will also be shrunk now
- Container shrinking tries one more thing to get smaller results
- Removed
RandomGenerator.reset()
since it's no longer needed for uniqueness behaviour_This is an incompatible API change!_
Arbitrary.unique()
does no longer propagate uniqueness across usages of same arbitrary.- Implemented exhaustive generation for
Arbitrary.unique()
- Fixed bug when resolving recursive types
- Added
Arbitraries.shuffle()
as a way to generate permutations - Implemented exhaustive generation for
Arbitraries.frequency()
- Changed display name of test engine to "jqwik for Java"
- Per default jqwik no longer uses the JUnit platform reporter for reporting because Gradle does not support it yet
- Using JUnit platform reporter can now be configured
@Size
: min and max values can be used without the other@StringLength
: min and max values can be used without the other- Implemented exhaustive generation for
Arbitrary.flatMap()
- Implemented exhaustive generation for
Arbitraries.oneOf()
- Implemented exhaustive generation for
Arbitraries.strings()
- Support default generation of Iterables and Iterators
- Removed deprecated static methods in
Arbitraries
- Removed deprecated method
ArbitraryProvider.provideFor(TypeUsage targetType, Function<TypeUsage, Optional<Arbitrary<?>>> subtypeProvider)
- Removed default implementation of
ArbitraryProvider.provideFor(TypeUsage targetType, SubtypeProvider subtypeProvider)
- Removed deprecated annotation
@Digits
- Renamed
TypeUsage.getAnnotation(Class annotationClass)
tofindAnnotation
- Added
TypeUsage.isAnnotated(Class annotationClass)
- Added
Arbitrary.unique()
- Added constraint
@Unique
- Implementations of
ArbitraryConfigurator
can optionally implementint order()
- It's now possible to "flat combine" arbitraries
- Deprecated all types and methods in
net.jqwik.api.Tuples.*
in favour ofnet.jqwik.api.Tuple.*
- There are new tuple types
Tuple5
up toTuple8
- Data-Driven Properties: Feed data into your properties instead of randomized generation
- Display names of test containers and properties will now automatically be prettified, i.e. each underscore will be replaced by a single space.
- Added
@Report
annotation to replaceProperty.reporting
- Added exhaustive value generation
StringArbitrary.withChars()
now accepts varargs.- Added
StringArbitrary.whitespace()
- Added
@Whitespace
annotation - Improved shrinking of action sequences
- Default String generation does no longer generate Unicode "noncharacters" or "private use characters"
- Added
StringArbitrary.all()
for also generating Unicode "noncharacters" and "private use characters"
- Some potentially incompatible stuff has changed for
default arbitrary providers:
- Introduced
ArbitraryProvider.priority()
- The old
ArbitraryProvider.provideFor(TypeUsage, Function)
is now deprecated, overrideArbitraryProvider.provideFor(TypeUsage, SubtypeProvider)
instead - If more than one provider fits a given type, one of the will be chosen randomly
- Introduced
Arbitraries.defaultFor()
will randomly choose one arbitrary if there is more than one fitting registered arbitrary provider
Faulty release. Do not use!
- Implemented generic type resolution to enable contract tests
- Renamed
GenericType
toTypeUsage
_This is an incompatible API change!_
- Reporting with
Reporting.FALSIFIED
now reports much less, and hopefully no wrong values anymore. - Shrinking with filtered values finds simpler values in some circumstance
- Generation of strings will allow any unicode character by default
Combinators.combine()
can now take a list of arbitraries of same return type.- Generated edge cases are now injected again and again and not only in the beginning.
- Complete re-implementation of shrinking with a few implications:
- Shrinking should work better and more efficient overall. There might be situations, though, in which shrinking does no longer find the simplest example.
ShrinkingMode.BOUNDED
might interrupt shrinking with completely different results.- When using
Reporting.FALSIFIED
you will see different inbetween shrinking steps that before. - The public interface of
Shrinkable
has changed in an incompatible way, but that shouldn't affect anyone but myself.
- Fixed shrinking bug that could result in integers not being shrunk as far as possible
- Integer shrinking should be faster in most cases and cover more cases
- Some minor but potentially incompatible API changes in
GenericType
. - Tags from parent (e.g. container class) are now also present in children (methods)
- Renamed
ShrinkingMode.ON
toShrinkingMode.FULL
_This is an incompatible API change!_
- Introduced
ShrinkingMode.BOUNDED
and made it the default - Introduced
ShrinkingMode.FULL
- Some bounded wildcard types and type variables can be provided automatically
- Added
Arbitraries.lazy()
to allow recursive value generation - Added
Arbitrary.fixGenSize()
to enable a fixed genSize when creating random generators - Added
Arbitrary.sequences()
to create sequences of actions for stateful testing
- Property methods that also have Jupiter annotations are skipped
- Added
@Label
to allow the labeling of examples, properties and containers - Changed license from EPL 1.0 to EPL 2.0
- Added
@Tag
to allow the tagging of examples, properties and containers - User guide: Added links to example sources on github
- Added
Arbitraries.frequency()
to enable choosing values with weighted probabilities - Collection and String generation now explores a wider range of sizes and lengths
- BigInteger generation does no longer support
@LongRange
but only@BigRange
_This is an incompatible API change!_
- BigDecimal generation does no longer support
@DoubleRange
but only@BigRange
_This is an incompatible API change!_
- BigInteger generation now supports numbers outside long range
- Property.seed is now of type String
_This is an incompatible API change!_
- Property methods without @ForAll parameters are now also tried as many times as
specified by
tries
parameter. - Added new method
Arbitraries.constant()
- Added new method
Arbitraries.defaultFor()
@WithNull.target()
has been removed_This is an incompatible API change!_
- Parameterized types can now be annotated directly
- Added
@Size.value()
for fixed size collections - Added
@StringLength.value()
for fixed size Strings
- All decimal generation (float, double, BigDecimal) now uses BigDecimal under the hood
- All integral generation (int, short, byte, long, BigInteger) now uses BigInteger under the hood
- Numbers are now generated within their full domain (min, max)
- Decimal shrinking improved
- Fixed bug: Reporting.FALSIFIED now also works for falsification through exception
- Added support for running all tests in a module (Java 9 only). I HAVE NOT TESTED IT!
- Completely rebuild the annotation-based configuration of registered arbitrary providers
- Introduced fluent configuration interfaces
- Introduced Arbitrary.list/set/stream/optional/array
- Combinators.combine() now allows up to 8 parameters
- Character creation does no longer support
@Chars
but only@CharRange
_This is an incompatible API change!_
- 'Arbitraries.chars(char[] validChars)' does no longer exist
_This is an incompatible API change!_
- Added
Arbitraries.oneOf
@Char
cannot takefrom
andto
any longer. Replaced by@CharRange
- Deprecated many methods in
Arbitraries
class. Replaced by fluent interface methods. - Deprecated
@Digits
constraint. Replaced by@NumericChars
. - Upgrade to JUnit 5.1.0
- Bugfix: Injected empty list samples are now mutable
- Bugfix: Injected empty set samples are now mutable
- Unbound type variables in properties can now be provided
-
Added support for
java.util.Random
generation. -
Added Tuple types (
Tuple2
,Tuple3
,Tuple4
) to use inArbitrary.flatMap()
. -
Renamed
ReportingMode
toReporting
and removedReporting.MINIMAL
._This is an incompatible API change!_
-
Added
Reporting.FALSIFIED
. See section on optional property parameters
- Added support for default arbitrary providers.
- Added support for
byte
andByte
generation. - Added support for
short
andShort
generation.
The first release published on maven central.