All Projects → mike-neck → kuickcheck

mike-neck / kuickcheck

Licence: Apache-2.0 license
A property based testing framework for Kotlin

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to kuickcheck

Deepstate
A unit test-like interface for fuzzing and symbolic execution
Stars: ✭ 603 (+2521.74%)
Mutual labels:  property-based-testing, testing-framework
nim-contra
Lightweight Self-Documenting Design by Contract Programming and Security Hardened mode.
Stars: ✭ 46 (+100%)
Mutual labels:  testing-framework
react-native-diagnose
A framework to test a React Native app during runtime
Stars: ✭ 24 (+4.35%)
Mutual labels:  testing-framework
test-drive
The simple testing framework
Stars: ✭ 37 (+60.87%)
Mutual labels:  testing-framework
quick.py
Property-based testing library for Python
Stars: ✭ 15 (-34.78%)
Mutual labels:  property-based-testing
efftester
Effect-Driven Compiler Tester for OCaml
Stars: ✭ 37 (+60.87%)
Mutual labels:  property-based-testing
FactoryOrchestrator
A cross-platform system service which provides a simple way to run and manage factory line validation, developer inner-loop, diagnostics, and fault analysis workflows.
Stars: ✭ 36 (+56.52%)
Mutual labels:  testing-framework
pysys-test
PySys System Test Framework
Stars: ✭ 14 (-39.13%)
Mutual labels:  testing-framework
LuluTest
LuluTest is a Python framework for creating automated browser tests.
Stars: ✭ 14 (-39.13%)
Mutual labels:  testing-framework
ava-fast-check
Property based testing for AVA based on fast-check
Stars: ✭ 44 (+91.3%)
Mutual labels:  property-based-testing
doctest
The fastest feature-rich C++11/14/17/20 single-header testing framework
Stars: ✭ 4,434 (+19178.26%)
Mutual labels:  testing-framework
fuzz-rest-api
Derive property based testing fast-check into a fuzzer for REST APIs
Stars: ✭ 38 (+65.22%)
Mutual labels:  property-based-testing
PixelTest
Fast, modern, simple iOS snapshot testing written purely in Swift.
Stars: ✭ 56 (+143.48%)
Mutual labels:  testing-framework
pry-test
A small test framework that supports debugging test failures & errors when they happen
Stars: ✭ 24 (+4.35%)
Mutual labels:  testing-framework
glados
🍰 A property-based testing framework that tries to break your invariances.
Stars: ✭ 33 (+43.48%)
Mutual labels:  property-based-testing
quickcheck
Randomized testing for Prolog à la QuickCheck
Stars: ✭ 18 (-21.74%)
Mutual labels:  property-based-testing
setup-bats
GitHub Action to setup BATS testing framework
Stars: ✭ 25 (+8.7%)
Mutual labels:  testing-framework
test junkie
Highly configurable testing framework for Python
Stars: ✭ 72 (+213.04%)
Mutual labels:  testing-framework
kitimat
A library for generative, property-based testing in TypeScript and Jest.
Stars: ✭ 68 (+195.65%)
Mutual labels:  property-based-testing
karate
Test Automation Made Simple
Stars: ✭ 6,384 (+27656.52%)
Mutual labels:  testing-framework

kuickcheck

s

KuickCheck is a property based testing framework for Kotlin inspired by other property based testing frameworks, especially scalacheck, junit-quickcheck.KuickCheck has no external dependencies other than Kotlin runtime and Kotlin reflection.

Download

KuickCheck is published to Maven Central, so you can get the latest version by adding the dependency to pom.xml or build.gradle.

Currently KuickCheck is not published, so download or clone this project to your machine.

Maven
<dependency>
  <groupId>org.mikeneck</groupId>
  <artifactId>kuickcheck</artifactId>
</dependency>
Gradle
dependencies {
  testCompile 'org.mikeneck:kuickcheck'
}

Writing Test

Writing test is very easy.

  1. Create class or singleton object.

  2. Prepare your test data with Generator(in the sample code it will be prepared by positiveInt phrase) and pass it to forAll method.

  3. Write the property for the data at satisfy block.

  4. Give the name to the property as read-only field name.

  5. Annotate the property with @Property.

Then KuickCheck will run check for the property 100 times as default.

Sample Code
object GettingStarted {

  @Property
  val positiveNumberIsMoreThan0 =
      forAll(positiveInt).satisfy{ it > 0 }
}

Running Tests

KuickCheck jar contains main function at org.mikeneck.kuickcheck.KuickCheck class. So you can run tests via java -jar command.

With Gradle

Add a new task to run KuickCheck test by JavaExec task.

Running Tests
task runTest(type: JavaExec) {
  classpath sourceSets.test.runtimeClasspath
  main = 'org.mikeneck.kuickcheck.KuickCheck'
  standardOutput = System.out
}

License

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].