Releases: jqwik-team/jqwik
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.
Rounding up the 1.5 Series
New and Enhanced Features
-
Upgraded to JUnit platform 1.8.0
-
Improved performance of large collection generation.
See #227.
Breaking Changes
- Parameters for
StringArbitrary.ofMinLength()
andStringArbitrary.ofMaxLength()
are validated.
See #221.
Bug Fixes
-
Added reporting format for type
char[]
. -
@StatisticsReport(onFailureOnly = true)
now also works when failure
is a statistics check failure.
Stabilizing 1.5.x
New and Enhanced Features
-
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.
Breaking Changes
- Properties with single try (aka examples) with at least one
@ForAll
parameter will now
produce a test report even if they succeed.
See #217.
Bug Fixes
- Fixed edge cases performance problem.
See #214
Builders Overhauled
New and Enhanced Features
-
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 typejava.time.Instant
can now be generated by default. -
FloatArbitrary
andDoubleArbitrary
can now
generate special values on demand.
Breaking Changes
-
Generated strings will no longer intentionally generate duplicate characters
by default. You now have to tell it to do so. -
Methods
Combinators.withBuilder(builderSupplier)
and
Combinators.withBuilder(arbitrary)
are now deprecated.
Bug Fixes
-
Addressed performance issues raised in #206
-
Fixed some type resolution and type usage bug found through
https://github.com/mihxil/math.
Influence Distribution of Container Size
New and Enhanced Features
-
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()
.
Breaking Changes
-
ActionSequenceArbitrary
no longer extendsSizableArbitrary
. -
ActionSequenceArbitrary.ofMinSize()
andActionSequenceArbitrary.ofMaxSize()
is now deprecated. -
CharacterArbitrary.digit()
is now deprecated.
Bug Fixes
Implicit Flat Mapping and new DomainContextBase
New and Enhanced Features
-
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
Breaking Changes
-
Removed
leapYears(boolean withLeapyear)
from all date generating arbitraries. -
Changed
Arbitrary<T> Arbitraries.oneOf(List<T> choices)
to
Arbitrary<T> Arbitraries.oneOf(Collection<? extends T> choices)
Bug Fixes
Memory Leak and DateTimes
New and Enhanced Features
-
Implemented
@StatisticsReport.label
as suggested in
#146. -
Time module
- Generation of Times
- Generation of DateTimes
got its first rudimentary support.
-
Added
StringArbitrary.excludeChars(char ... toExclude)
.
See #167.
Breaking Changes
- Trying to add a numerical edge case that is outside the arbitrary's
allowed range will now throw anIllegalArgumentException
.
Bug Fixes
-
Fixed memory leakage introduced in 1.5.0.
-
Shrinking of flat mapped values would sometimes never end.
Performance is Everything
This came shortly after 1.4.0 because 1.4.0 introduce severe performance problems for some users.
New and Enhanced Features
-
Added constraint annotation
@NotBlank
for String parameters -
Generated email addresses get a few more edge cases
Breaking Changes
-
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
Bug Fixes
-
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
.
Edge Cases and Uniqueness Revisited. Emails and Dates.
New and Enhanced Features
-
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 parameter
jqwik.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 injqwik.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
Breaking Changes
-
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
Bug Fixes
- Fixed bug that could lead to strange edge case generation behaviour
whenArbitrary.edgeCases(edgeCasesConfig)
was used.
Some Bugs Fixed
New and Enhanced Features
- Introduced
JavaBeanReportingFormat
for simpler and configurable reporting
of Java beans.
Breaking Changes
SampleReportingFormat.reportJavaBean(..)
has been deprecated.
Will be removed in version 1.4.0.
Bug Fixes
-
Arbitraries.lazy()
did not allow exhaustive generation but does now. -
SampleReportingFormat.reportJavaBean(..)
can now handle methods named
is
orget
. -
SampleReportingFormat.reportJavaBean(..)
can now handle properties
that returnOptional<T>
.