Skip to content

Random Distribution, Edge Cases and More

Compare
Choose a tag to compare
@jlink jlink released this 29 May 08:40

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