Releases: jqwik-team/jqwik
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>
.
Stabilization and Enhanced Email Generation
New and Enhanced Features
-
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.
Breaking Changes
- Email arbitrary no longer generates domain hosts without top level domain
Bug Fixes
-
Reporting of null values in failed properties
no longer fails with NPE. -
Sampling arbitraries with null values
no longer fails.
Email Generation
New and Enhanced Features
-
You can now
generate valid email addresses. -
The header of the label column in
histograms and number range histograms
can now be changed.
Breaking Changes
-
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
Bug Fixes
No known bugs.