nw-pbt-jvm

Solid

JVM property-based testing with jqwik, ScalaCheck, and ZIO Test frameworks

Testing & QA 526 stars 55 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
91
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# PBT JVM -- jqwik (Java/Kotlin) + ScalaCheck + ZIO Test ## Framework Selection | Framework | Language | Shrinking | Stateful | Choose When | |-----------|----------|-----------|----------|-------------| | jqwik | Java/Kotlin | Integrated | Yes (actions) | Java/Kotlin projects (recommended default) | | ScalaCheck | Scala | Type-based | Yes (Commands) | Scala projects (established choice) | | ZIO Test | Scala | Integrated | Via effects | ZIO-based Scala projects | ## Quick Start (jqwik) ```java import net.jqwik.api.*; class SortProperties { @Property void sortPreservesLength(@ForAll List<Integer> list) { List<Integer> sorted = new ArrayList<>(list); Collections.sort(sorted); Assertions.assertEquals(list.size(), sorted.size()); } } // Run: ./gradlew test (or mvn test) ``` ## Generator (Arbitrary) Cheat Sheet (jqwik) ```java @ForAll int x // any int @ForAll @IntRange(min = 0, max = 99) int x @ForAll @StringLength(min = 1, max = 50) String s @ForAll @Size(min = 1, max = 10) List<Integer> list // Custom provider @Provide Arbitrary<String> emails() { return Arbitraries.strings().alpha().ofMinLength(1).ofMaxLength(10) .map(name -> name + "@example.com"); } // Combinators Arbitraries.integers().between(0, 100) Arbitraries.of("a", "b", "c") Arbitraries.frequencyOf(Tuple.of(80, Arbitraries.integers()), Tuple.of(20, Arbitraries.just(0))) // Combine Combinators.combine( Arbitraries.strings().alpha().of...

Details

Author
nWave-ai
Repository
nWave-ai/nWave
Created
3 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category