Questions tagged [jqwik]

jqwik (pronounced "jay quick") is a library for performing property-based-testing (PBT) on JVM languages including Java, Kotlin and Groovy. Use this tag for questions about the jqwik library.

jqwik is a property-based testing framework for the JVM. It is annotation-based and runs as test engine on the junit 5 platform. Just like its famous ancestor quickcheck jqwik generates test input data for test cases provided by the programmer. Documentation can be found on https://jqwik.net.

28 questions
1
vote
1 answer

Run jqwik tests with Jupiter console launcher

For testing purposes (no pun intended) I run some tests outside the IDE or MAven using the Console Launcher that comes with JUnit Jupiter. It finds all the JUnit 4 (aka. Vintage) and JUnit 5 (aka. Jupiter) tests. However, it does not discover my…
Michael Piefel
  • 18,660
  • 9
  • 81
  • 112
0
votes
1 answer

How do I generate a positive list of integers in jqwik and Kotlin?

I have tried something like this, but seems like it's not working since I can see negatives in the generated list: @Property fun ( @ForAll @Size(min = 0, max = 1_500) @Positive @UniqueElements partials: List<@IntRange(min =…
Akhha8
  • 418
  • 3
  • 10
0
votes
1 answer

jqwik strategies for combining arbitraries

(Context: my background in property-based testing is mostly from scala's scalacheck library, the use of some of the types and annotations in jqwik feels a bit different and there are a couple paradigms I can't quite get the hang of yet.) I'm not…
drobert
  • 1,230
  • 8
  • 21
0
votes
1 answer

Inject returns NULL when activating jqwik in Quarkus test

We want to introduce property-based testing into our Quarkus project, preferably with jqwik. We already got numerous test cases using junit jupiter. We also use CDI in out test cases. Getting jqwik running in a small Quarkus example project went…
aaberg
  • 21
  • 2
0
votes
1 answer

A chain with Action.Dependent throws JqwikException: empty set of values

I am doing stateful testing using Jqwik. The problem I am facing is as follows: The action chain contains a set of state dependent actions that can produce empty Arbitraries (example: no "pop" action should be produced for an empty stack). Some…
0
votes
1 answer

Difference between List and ActionSequence in jqwik

What exactly is the difference in between List and ActionSequence in jqwik. In the doc of jqwik, ActionSequence is created using Arbitraries.sequences(...) and the List is created using Arbitraries.oneOf().list() Since the purpose of…
Sagar Khurana
  • 184
  • 1
  • 2
  • 11
0
votes
1 answer

Is it possible to mix jqwik with mockito tests?

I'm working in a project which contains tests in mockito. I need to add more tests to this file, so I added a simple jqwik test, but if I try to run all tests all mockito ones are ignored.
0
votes
2 answers

When to choose Example based testing and property based for Stateful Testing

I'm doing unit testing mostly these days for Android SDK in Android Studio and using Jqwik which is a Property-Based testing tool on the JUnit Platform. While exploring the different test techniques approach with my seniors, I learned about…
Sagar Khurana
  • 184
  • 1
  • 2
  • 11
0
votes
2 answers

Jqwik: How to check if all possibilities is covered?

How to check if all possibilities (cartesian product of arguments) is covered in summary by N properties? Some of them can be tested few times by different properties.
0
votes
1 answer

OutsideJqwikException on simple test case after 1.5.0+ upgrade

Testing Problem I wrote the following sample code and run it on intelliJ and kept getting the same exception on v1.5.0+. The same code works fine on 1.4.0 and lower... This is the sample code I reduced my actual test code down to: import…
0
votes
1 answer

How do you use a jqwik @Provider specified in another class as part of a @ForAll paramter?

We have a bunch of generators specified in a class. class MyUsefulGenerators { @Provide public Arbitrary someDomainSpecificThing() { ... } } They're broadly useful, so I'd like to be able to use them in different test…
0
votes
1 answer

Is there an annotation for @NegativeOrZero / @PositiveOrZero annotation?

According to the jqwik documentation here: https://jqwik.net/docs/current/user-guide.html#integer-constraints it states the integer constraint annotations as: @Positive: Numbers larger than 0. For all integral types. @Negative: Numbers lower than…
vab2048
  • 1,065
  • 8
  • 21
0
votes
1 answer

Is it possible to mix jqwik @Property methods and junit5 @Test methods in the same test file?

Im porting some Python code using hypothesis, and trying to keep the sources as close as possible. The python test file has both parameterized and non-parameterized methods. If I mark them all as @Property, the non-parameterized (and so identical)…
John Caron
  • 1,367
  • 1
  • 10
  • 15
1
2