Skip to content

Releases: jqwik-team/jqwik

Minor Improvements

27 Oct 08:25
Compare
Choose a tag to compare

New and Enhanced Features

  • 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.

Breaking Changes

  • Examples with a failing assumption - i.e. throwing a TestAbortedException -
    will now be reported as being skipped. See #122
    for motivation and reasoning.

Bug Fixes

  • 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

Edge case generation and shrinking improvements

21 Sep 12:37
Compare
Choose a tag to compare

New and Enhanced Features

  • Shrinking behaviour of arbitraries created with
    Combinators.withBuilder(..) is now much better, especially much faster.

  • Upgrade to JUnit Platform 1.7.0

Breaking Changes

  • 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 to null if possible.

Bug Fixes

  • 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(..) and frequencyOf(..) generators are now correctly being shrunk.

Minor Improvements and Convenience Additions

26 Aug 07:02
Compare
Choose a tag to compare

New and Enhanced Features

  • Added Tuple.of() and Tuple.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 itself
    • CombinableBuilder.inSetter(..): Set a builder's property and go on using it
  • Added SampleReportingFormat.reportJavaBean(Object bean)

Breaking Changes

  • 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.

Bug Fixes

  • edge cases generation will be stopped when 10000 edge cases have been found.
    See #113

Recursive Generation Improvements

18 Aug 15:21
Compare
Choose a tag to compare

New and Enhanced Features

  • Arbitraries.lazyOf(Supplier<Arbitrary<T>> ...) is now the method of choice for
    recursive value generation. It has much better shrinking behaviour than the
    more generic lazy() combined with oneOf().

  • Added PropertyLifecycleContext.attributes(), which allows to query, set and change
    a property method's attributes like number of tries and seed within a
    AroundPropertyHook lifecycle hook.

  • Added @PropertyDefaults annotation which allows to set the defaults
    of all property methods in a container.

Breaking Changes

  • No known breaking changes

Bug Fixes

Shrinking Reloaded

08 Aug 14:02
Compare
Choose a tag to compare

New and Enhanced Features

  • 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

Breaking Changes

  • 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.

Bug Fixes

  • Reporting an exhausted property had been broken since 1.2.4 and nobody noticed.
    Works again.

Fixing Bugs and Adapting Structure

02 Jul 10:56
Compare
Choose a tag to compare

New and Enhanced Features

  • Added Arbitrary.dontShrink()

  • Added SetArbitrary.mapEach()

  • Added SetArbitrary.flatMapEach()

  • Added ListArbitrary.mapEach()

  • Added ListArbitrary.flatMapEach()

  • Added Arbitraries.just(aConstant) and deprecated Arbitraries.constant(aConstant).
    Most other PBT libraries seem to use just for this functionality.

  • Added programmatic access to JUnit 5 platform reporting

Breaking Changes

  • Introduced StreamableArbitrary hierarchy:

    • Arbitrary.set() now has return type net.jqwik.api.arbitraries.SetArbitrary
    • Arbitrary.list() now has return type net.jqwik.api.arbitraries.ListArbitrary
    • Arbitrary.stream() now has return type net.jqwik.api.arbitraries.StreamArbitrary
    • Arbitrary.iterator() now has return type net.jqwik.api.arbitraries.IteratorArbitrary
  • Arbitraries.maps(...) now has return type net.jqwik.api.arbitraries.MapArbitrary

  • net.jqwik.api.lifecycle.Reporter moved to net.jqwik.api.Reporter

Bug Fixes

  • 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

Reporting Samples

20 Jun 11:23
Compare
Choose a tag to compare

New and Enhanced Features

  • 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.

Breaking Changes

  • Arbitraries.of(List<T>) replaced with Arbitraries.of(Collection<T>)

  • Arbitraries.ofSuppliers(List<Supplier<T>>) replaced with Arbitraries.of(Collection<Supplier<T>>)

Bug Fixes

No open bugs had been reported.

Random Distribution, Edge Cases and More

29 May 08:40
Compare
Choose a tag to compare

New and Enhanced Features

  • 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 between RandomDistribution.biased() (default),
    RandomDistribution.uniform() and RandomDistribution.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 to MAINTAINED

    • 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

Breaking Changes

  • Decimal Generation: min and max values are now rejected if they have more decimal places
    than the generator's scale 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 by net.jqwik.api.statistics.Statistics
  • Set most public methods of RandomGenerator to API status INTERNAL

  • Set Arbitrary.exhaustive() to API status INTERNAL

  • Set ExhaustiveGenerator and all its methods to API status INTERNAL

  • The evaluation order of SkipExecutionHook hooks can no longer be influenced.

Bug Fixes

  • 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

Decimal Ranges with Borders Excluded

13 Apr 09:11
Compare
Choose a tag to compare

New and Enhanced Features

  • 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 attributes minIncluded and maxIncluded

  • 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 attributes minIncluded and maxIncluded

  • 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 attributes minIncluded and maxIncluded

  • Warning about JUnit annotations only shows up when test container class has
    jqwik property or example methods.

  • Upgrade to JUnit Platform 1.6.2

Breaking Changes

  • Minor changes to yet undocumented Lifecycle Hooks API

Release 1.2.6: Lifecycle Hooks Improvements

28 Mar 13:59
Compare
Choose a tag to compare

Breaking Changes