Home

jqwik

jqwik is a property-based testing library for Java and the JVM. It implements the QuickCheck style of testing, generating large numbers of random inputs to validate properties and relationships of code under test. It integrates with JUnit 5, enabling tests to be discovered and run using standard build tools and IDEs.

A test in jqwik is a property annotated with @Property, and inputs can be declared with the

Built-in and composable arbitraries: jqwik provides generators for primitive types, strings, collections, optionals, maps, and more,

Execution and results: When a property runs, jqwik executes it against many generated inputs. If a counterexample

Open source and ecosystem: jqwik is open-source software available on its repository. It is actively maintained

@ForAll
annotation
on
method
parameters.
The
framework
uses
Arbitrary<T>
generators
to
create
values;
developers
can
supply
custom
generators
via
@Provide
methods
that
return
Arbitrary<T>
for
their
types.
and
supports
composing
them
with
functional
combinators
to
build
complex
inputs.
It
also
supports
shrinking
to
simplify
failing
counterexamples,
aiming
to
produce
the
smallest
input
that
still
reproduces
a
failure.
is
found,
jqwik
shrinks
it
to
a
minimal
example
and
reports
the
seed
used
for
reproduction,
aiding
debugging.
Tests
remain
deterministic
when
a
seed
is
fixed,
facilitating
reproducibility.
with
documentation
and
examples,
and
it
can
be
used
with
Maven
or
Gradle
to
run
through
the
standard
JUnit
5
test
lifecycle.