All Projects → pholser → Junit Quickcheck

pholser / Junit Quickcheck

Licence: mit
Property-based testing, JUnit-style

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Junit Quickcheck

Quicktheories
Property based testing for Java 8
Stars: ✭ 483 (-41.17%)
Mutual labels:  junit, property-based-testing, quickcheck
Jqf
JQF + Zest: Coverage-guided semantic fuzzing for Java.
Stars: ✭ 340 (-58.59%)
Mutual labels:  junit, property-based-testing, quickcheck
quickcheck
Randomized testing for Prolog à la QuickCheck
Stars: ✭ 18 (-97.81%)
Mutual labels:  quickcheck, property-based-testing
quick.py
Property-based testing library for Python
Stars: ✭ 15 (-98.17%)
Mutual labels:  quickcheck, property-based-testing
Stream data
Data generation and property-based testing for Elixir. 🔮
Stars: ✭ 597 (-27.28%)
Mutual labels:  property-based-testing, quickcheck
Fsharp Hedgehog
Release with confidence, state-of-the-art property testing for .NET.
Stars: ✭ 219 (-73.33%)
Mutual labels:  property-based-testing, quickcheck
Rantly
Ruby Imperative Random Data Generator and Quickcheck
Stars: ✭ 241 (-70.65%)
Mutual labels:  property-based-testing, quickcheck
ava-fast-check
Property based testing for AVA based on fast-check
Stars: ✭ 44 (-94.64%)
Mutual labels:  quickcheck, property-based-testing
Fast Check
Property based testing framework for JavaScript (like QuickCheck) written in TypeScript
Stars: ✭ 2,604 (+217.17%)
Mutual labels:  property-based-testing, quickcheck
pbt-frameworks
An overview of property-based testing functionality
Stars: ✭ 29 (-96.47%)
Mutual labels:  quickcheck, property-based-testing
kitimat
A library for generative, property-based testing in TypeScript and Jest.
Stars: ✭ 68 (-91.72%)
Mutual labels:  quickcheck, property-based-testing
Haskell Hedgehog
Release with confidence, state-of-the-art property testing for Haskell.
Stars: ✭ 584 (-28.87%)
Mutual labels:  property-based-testing, quickcheck
Rapid
Rapid is a Go library for property-based testing that supports state machine ("stateful" or "model-based") testing and fully automatic test case minimization ("shrinking")
Stars: ✭ 213 (-74.06%)
Mutual labels:  property-based-testing, quickcheck
Qcheck
QuickCheck inspired property-based testing for OCaml.
Stars: ✭ 194 (-76.37%)
Mutual labels:  property-based-testing, quickcheck
Quickcheck State Machine
Test monadic programs using state machine based models
Stars: ✭ 192 (-76.61%)
Mutual labels:  property-based-testing, quickcheck
fuzz-rest-api
Derive property based testing fast-check into a fuzzer for REST APIs
Stars: ✭ 38 (-95.37%)
Mutual labels:  quickcheck, property-based-testing
Qcstm
A simple state-machine framework for OCaml based on QCheck
Stars: ✭ 50 (-93.91%)
Mutual labels:  property-based-testing, quickcheck
Swiftcheck
QuickCheck for Swift
Stars: ✭ 1,319 (+60.66%)
Mutual labels:  property-based-testing, quickcheck
efftester
Effect-Driven Compiler Tester for OCaml
Stars: ✭ 37 (-95.49%)
Mutual labels:  quickcheck, property-based-testing
edd
Erlang Declarative Debugger
Stars: ✭ 20 (-97.56%)
Mutual labels:  quickcheck, property-based-testing

Build Status Code Quality: Java Total Alerts

Software Quality Award 2016

junit-quickcheck: Property-based testing, JUnit-style

junit-quickcheck is a library that supports writing and running property-based tests in JUnit, inspired by QuickCheck for Haskell.

Property-based tests capture characteristics, or "properties", of the output of code that should be true given arbitrary inputs that meet certain criteria. For example, imagine a function that produces a list of the prime factors of a positive integer n greater than 1. Regardless of the specific value of n, the function must give a list whose members are all primes, must equal n when all multiplied together, and must be different from the factorization of a positive integer m greater than 1 and not equal to n.

Rather than testing such properties for all possible inputs, junit-quickcheck and other QuickCheck kin generate some number of random inputs, and verify that the properties hold at least for the generated inputs. This gives us some reasonable assurance upon repeated test runs that the properties hold true for any valid inputs.

Documentation

Documentation for the current stable version

Basic example

    import com.pholser.junit.quickcheck.Property;
    import com.pholser.junit.quickcheck.runner.JUnitQuickcheck;
    import org.junit.runner.RunWith;

    import static org.junit.Assert.*;

    @RunWith(JUnitQuickcheck.class)
    public class StringProperties {
        @Property public void concatenationLength(String s1, String s2) {
            assertEquals(s1.length() + s2.length(), (s1 + s2).length());
        }
    }

Other examples

After browsing the documentation, have a look at some examples in module junit-quickcheck-examples. These are built with junit-quickcheck.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].