Skip to content

Releases: jqwik-team/jqwik

Stabilizations and Small Features

22 Mar 09:10
Compare
Choose a tag to compare

New and Enhanced Features

  • Upgraded to JUnit Platform 1.9.2

  • uniqueElements(..) methods are now part of StreamableArbitrary 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

09 Jan 10:27
Compare
Choose a tag to compare

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 have org.jetbrains:annotations as a compile-time dependency.

  • Upgrade to Kotlin 1.8.0

Breaking Changes

  • Renamed ChainArbitrary.addTransformation(..) to ChainArbitrary.withTransformation(..)

  • Renamed ActionChainArbitrary.addAction(..) to ActionChainArbitrary.withAction(..)

Bug Fixes

  • Fixed bug that included never executed actions in chains.
    See #426.

  • Fixed bug when generating list of consumers.
    See #446.

Kotlin extensions and a bit of polishing

04 Nov 09:41
Compare
Choose a tag to compare

New and Enhanced Features

  • Upgrade to Kotlin 1.7.20

  • Added filtering to Combinators.
    See #329.

  • Added Chain.transformers() and ActionChain.transformers() to retrieve
    the list of applied Transformer instances in a chain.

  • Added the capability to
    check statistical coverage of regex patterns.

  • Added optional filter parameter to Kotlin combine 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

  • Histogramms will use # as character for bars on Windows now.
    See #376.

  • Fixed reflection bug for Java >= 17.
    See #393.

Stateful Properties Afresh

30 Sep 08:54
Compare
Choose a tag to compare

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 to MAINTAINED:

    • 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
    for jqwik.failures.after.default is now SAMPLE_FIRST.
    Set it to PREVIOUS_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() and ofMinLength() are handled more intelligently.
    See #377.

Fixing Inconveniences

09 Mar 14:14
Compare
Choose a tag to compare

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 of DomainContextBase
    can no longer be supertypes of the target type to match.
    For example Arbitrary<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

09 Feb 15:02
Compare
Choose a tag to compare

New and Enhanced Features

  • Added Arbitraries.subsetOf(T...values) and Arbitraries.subsetOf(Collection<? extends T> values)

  • Added Kotlin convenience function Collection<T>.anySubset() : SetArbitrary<T>

  • DomainContext and DomainContextBase implementations can now provide SampleReportingFormat 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 return Collection<ArbitraryProvider>

  • Changed DomainContext.getArbitraryConfigurators() to return Collection<ArbitraryConfigurator>

Bug Fixes

  • With AfterFailureMode set to SAMPLE_ONLY or SAMPLE_FIRST recreating previous sample could sometimes
    take VERY long. This has been fixed.

Upgrades, Bugs and Suppliers

14 Jan 10:21
Compare
Choose a tag to compare

New and Enhanced Features

  • Upgraded kotlinx to version 1.6.0

  • Upgraded to Kotlin 1.6.10.

  • @ForAll and @From now support
    arbitrary suppliers
    through a supplier 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
    generate ZonedDateTime objects.
    Many thanks to https://github.com/zinki97 for his continued support with this module!

Breaking Changes

  • kotlinx-coroutine-test replaced runBlockingTest with runTest.

  • Arbitrary provider methods can no longer have a SubtypeProvider parameter.

  • Removed experimental API Store.onClose().

Bug Fixes

  • Shrinking now still works when thrown exception has no stacktrace.
    See #283.

  • Builders can now use nullable arbitraries.
    See #295.

After Failure Handling Redone

18 Dec 10:03
Compare
Choose a tag to compare

New and Enhanced Features

  • Complete Rework of after-failure handling:

    • AfterFailureMode.SAMPLE_FIRST and AfterFailureMode.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 and SAMPLE_ONLY now also work for data-driven properties and exhaustive generation.
      I recommend now to use SAMPLE_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 an IllegalArgumentException.
    See #270.

  • Generic array types in parameters can now be properly resolved

  • After-failure handling now (hopefully) works as expected

@UseType on Steroids

03 Dec 08:18
Compare
Choose a tag to compare

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 attribute enableRecursion,
    which is set to true 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 implement ArbitraryProvider which
    is used as a provider for this domain.

  • Subclasses of DomainContextBase can now implement ArbitraryConfigurator 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 and SAMPLE_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!!!

13 Nov 11:33
Compare
Choose a tag to compare

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 to MAINTAINED:

    • net.jqwik.api.Arbitrary.ignoreException(..)
    • net.jqwik.api.Property.whenFixedSeed
    • net.jqwik.api.RandomDistribution and its usages in numerical arbitraries
    • net.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 deprecated returns().

  • 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 or Boolean.FALSE it will now be considered to have failed.
    All other return values - including null - are regarded as success.
    Before this version the method's return type had to be boolean or Boolean 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.