Property-based testing library for Kotlin

Overview

Kwik

https://img.shields.io/bintray/v/kwik/stable/kwik?color=blue&label=version https://img.shields.io/badge/kotlin-1.4-informational https://readthedocs.org/projects/kwik/badge/?version=latest https://img.shields.io/github/workflow/status/jcornaz/kwik/Build https://img.shields.io/badge/workspace-zenhub-%236061be

Property-based testing library for Kotlin.

Main features:

  • Test-engine agnostic
  • Multiplatform
  • No reflection
  • Configurable built-in generators
  • Easy way to create and combine generators
  • Seeded generation for reproducible results

Find more information on https://kwik.readthedocs.io

Status

This project is discontinued. For property based testing with Kotlin, check out kotest.

How it looks like

class PlusOperatorTest {

    @Test
    fun isCommutative() = forAll { x: Int, y: Int ->
        x + y == y + x
    }

    @Test
    fun isAssociative() = forAll(iterations = 1000) { x: Int, y: Int, z: Int ->
        (x + y) + z == x + (y + z)
    }

    @Test
    fun zeroIsNeutral() = forAll(seed = -4567) { x: Int ->
        x + 0 == x
    }
}

For more information read the usage and look at the available generators

Motivation

Property based testing is great and very powerful. But despite the fact that many good libraries already exist, none of them fully fit my needs.

The known alternatives either:

  • Are bound to a specific test-engine
  • Can only be used when compiling kotlin to Java (and cannot be used in multi-platform projects)
  • Relies on reflection, making the tests slower and make some errors detectable only at runtime
  • Do not allow enough freedom and safety to customize existing generators
  • Force the user to add unwanted dependencies in the classpath

Requirements

  • Kotlin version: 1.4.0 or newer
  • JDK version: 8, 11 or 15

Setup

Example of setup using gradle.

repositories {
    jcenter()
}

dependencies {
    testCompile("com.github.jcornaz.kwik:kwik-core-jvm:$kwikVersion")
}

Find more detailed information in the setup instructions.

Contribute

See how to contribute

Comments
  • DateTime Generators

    DateTime Generators

    It would be nice to have generators for the most common types of java.time api (instant, zone, localDate, localTime, localDateTime, etc.)

    It would obviously be available only for the JVM.

    up for grabs generator 
    opened by jcornaz 4
  • fix: wrong comparison for instants max seconds value

    fix: wrong comparison for instants max seconds value

    In current state the expression instant.epochSecond == instant.epochSecond is of course always true, that's a bug. It was intended to be compared against max.epochSecond.

    opened by mmiikkkkaa 2
  • Range generator

    Range generator

    I'd like to have a range generator.

    The API could look like this:

    fun <T> Generator.Companion.ranges(gen: Generator<T>): Generator<ClosedRange<T>>= TODO()
    

    For the samples I am thinking about:

    • empty range (endInclusive < start) EDIT: Only for concrete ranges such as IntRange or similar.
    • single element range (endInclusive == start)
    • ~~start and/or endInclusive being sample of the underlying generator~~ EDIT: We cannot explicitly query for samples anymore. We can only delegate generation to the unerlying generator which will have higher probability to return its samples.
    up for grabs generator 
    opened by jcornaz 2
  • Add an `Arbitrary` typealias for  `Generator`

    Add an `Arbitrary` typealias for `Generator`

    Despite Generator being quite natural for a Java developer, I think Arbitrary have some good advantages:

    • It is consistent with the naming scheme in the Haskell QuickCheck library.
    • It nicely creates English sentences: forAll(Arbitrary.int()) { x -> ... } = "for all arbitary int x, ..."
    wontfix 
    opened by jcornaz 2
  • chore(deps): bump org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.21

    chore(deps): bump org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.21

    Bumps org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.21.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 1
  • chore(deps): bump org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.20

    chore(deps): bump org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.20

    Bumps org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.20.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 1
  • chore(deps): bump jvm from 1.5.0 to 1.5.10 in /example

    chore(deps): bump jvm from 1.5.0 to 1.5.10 in /example

    Bumps jvm from 1.5.0 to 1.5.10.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 1
  • chore(deps): bump org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.10

    chore(deps): bump org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.10

    Bumps org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.10.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 1
  • chore(deps): bump io.gitlab.arturbosch.detekt from 1.16.0 to 1.17.0

    chore(deps): bump io.gitlab.arturbosch.detekt from 1.16.0 to 1.17.0

    Bumps io.gitlab.arturbosch.detekt from 1.16.0 to 1.17.0.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 1
  • chore(deps): bump org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.0

    chore(deps): bump org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.0

    Bumps org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.0.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 1
  • build(deps): bump junit-jupiter from 5.7.0 to 5.7.1 in /example

    build(deps): bump junit-jupiter from 5.7.0 to 5.7.1 in /example

    Bumps junit-jupiter from 5.7.0 to 5.7.1.

    Release notes

    Sourced from junit-jupiter's releases.

    JUnit 5.7.1 = Platform 1.7.1 + Jupiter 5.7.1 + Vintage 5.7.1

    See Release Notes.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 1
  • chore(deps): bump org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.30

    chore(deps): bump org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.30

    Bumps org.jetbrains.kotlin.multiplatform from 1.4.32 to 1.5.30.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 0
  • chore(deps): bump io.gitlab.arturbosch.detekt from 1.17.1 to 1.18.0

    chore(deps): bump io.gitlab.arturbosch.detekt from 1.17.1 to 1.18.0

    Bumps io.gitlab.arturbosch.detekt from 1.17.1 to 1.18.0.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 0
  • Publish to maven central

    Publish to maven central

    Resolves #260

    Todo

    • [ ] Exclude generator-test from publication (It is an internal package)

    Current problems/blockers

    • ./gradlew closeAndReleaseRepository hangs.
    opened by jcornaz 0
Releases(v0.9.0-alpha.0)
  • v0.9.0-alpha.0(Nov 22, 2020)

    ⚠ BREAKING CHANGES

    • Now forAny requires a function that returns a TestResult (issue: #85, pr: #244)

    Features

    • Now forAny requires a function that returns a TestResult (issue: #85, pr: #244)
    Source code(tar.gz)
    Source code(zip)
  • v0.8.4(Nov 22, 2020)

  • v0.8.3(Oct 20, 2020)

    Features

    • ExperimentalKwikApi annotation (#224) (6a629c3)

    • Generator for LocalDateTime (#223) (4422e1a)

      Thanks to @mmiikkkkaa

    Deprecations

    • The experimental annotation '@ExperimentalKwikFuzzer' has been deprecated in favor of the new '@ExperimentalKwikApi' annotation (03362bb)

    Bug fixes

    • Incomplete domain of Java Instant generation (#228) (6ed57fc)

      Thanks to @mmiikkkkaa

    • Missing values near boundary for instant and duration generators (#229) (68a6fb9)

      Thanks to @mmiikkkkaa

    Source code(tar.gz)
    Source code(zip)
  • v0.8.2(Oct 13, 2020)

  • v0.8.1(Oct 12, 2020)

  • v0.8.0(Oct 2, 2020)

    ⚠ BREAKING CHANGES

    • Deprecated functions have been removed (Generator.create and simplifier). The deprecation level has also been raised to "error" for Generator.flatMap. Make sure you're not using any deprecated members before updating.

    Features

    • Add character generator (#215) (2e8b7a6) And let the string generator be configured using a character generator.

      Thanks to @Kantis

    Removed

    Documentation

    • Recomands to use fun interface capabilities to create a generator (instead of the deprecated create method) (#197) (8ab7b38)
    • Remove gitter badge (da4d049)
    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Aug 15, 2020)

  • v0.6.2(Aug 4, 2020)

  • 0.6.1(Jul 20, 2020)

  • 0.6.0(Apr 1, 2020)

  • 0.5.0(Mar 29, 2020)

    Added

    Reintroduce core core module that adds all transitive dependencies necessary for property based testing.

    Fuzzer

    A new module fuzzer has been added. It contains an experimental abstraction layer which is meant to be above the Generator. (Note that fuzzer-api is transitively added by evaluator and core)

    The (existing) Generator is responsible only for generating random value (without even knowing if it is for testing purposes or not).

    A Fuzzer is specialized for property based testing. It contains a Generator, a Simplifier and a list of guarantees that must be satisfied at least once during evaluation.

    • A new function forAny is provided to run test using Fuzzer instead of Generator in module evaluator. In case of property falsification, this function will simplify the input to the simplest input that still falsify the property.

    • Simplifier combination Simplifier.pair(Simplifier, Simplifier) and Simplier.triple(Simplifier, Simplifier, Simplifier) Are provided

    • Arbitrary an empty object type that can be used to find Fuzzer factories (regardless of the module they come from)

    • Arbitrary.pair and Arbitrary.triple to combine fuzzers.

    Dependencies Updated

    • Kotlin (from 1.3.61 to 1.3.71)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Feb 8, 2020)

    Added

    • Allow to configure default number of iteration via environment variable KWIK_ITERATIONS on JVM and Linux (on JVM the system property has precedence over the environment variable)
    • Allow to configure default seed via system property kwik.seed (on JVM) or via environment variable KWIK_SEED on JVM and Linux (on JVM the system property has precedence over the environment variable)
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Jan 24, 2020)

    Removed (Breaking)

    • Module core. It was an empty module only to provide transitive dependencies to most common used modules.

    Added

    • linux and windows artifacts (x64 arch) Thanks to contribution of @michellesantos and @drodel

    Migration from 0.2.0

    Before updating to 0.3.0 (so using version 0.2.0)

    1. Remove all usage of deprecated members

      • Use Generator.withSamples instead of Generator.samples

      • Use Generator.randomSequence instead of Generator.randoms

    2. Replace dependencies of module core by evaluator and generator-stdlib Example with gradle for JVM project:

      dependencies {
          testImplementation("com.github.jcornaz.kwik:kwik-evaluator-jvm:0.2.0")
          testImplementation("com.github.jcornaz.kwik:kwik-generator-stdlib-jvm:0.2.0")
      }
      
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0-alpha.1(Dec 5, 2019)

    Removed (Breaking)

    • Generator.samples property has been removed. Now the generator have to have a probability to generate the edge cases in generate. The recommended option when building a generator, is to use withSamples

    • Generator.randoms function has been removed. Generator.generate or Generator.randomSequence should be used instead.

    Changed

    All generators no longer statically provide samples. Instead they have a good probability to generate edge cases.

    • (Breaking binary) withSample now takes a probability argument, and include the samples in the generation

    Added

    • ensureAtLeastOne utility in evaluation context, that will force property evaluation until a given predicate gets satisfied

    Dependencies Updated

    • Kotlin (from 1.3.60 to 1.3.61)
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Nov 19, 2019)

    Deprecated

    • samples property in Generator interface. (Samples are about to be included in generation of generate) One should use withSamples and frequency instead.

    Added

    • andThen operator to make easier building complex generation pipeline
    • frequency combinator, allowing to create a frequency-parametrized generator

    Dependencies Updated

    • Kotlin (from 1.3.50 to 1.3.60)
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0-rc.1(Sep 18, 2019)

    Changed

    • default max size/length for string,collection and sequence generators set to 50 (instead of 200)

    Added

    • sequences generator
    • uuids generator
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0-beta.2(Sep 16, 2019)

    Deprecated

    • Method Generator.randoms(Long) the generator should generate single values, not a sequence.

    Added

    • (Breaking) method generate(Random): T in interface Generator to generate single value.
    • checkForAll. An alternative to forAll allowing to use assertion (throw in case of error) instead of returning a boolean. It can be especially helpful to more descriptive message about what is wrong.
    • Generator.randomSequence extension function to replace the deprecated Generator.randoms(Long): Sequence<T>
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0-beta.1(Sep 15, 2019)

    Changed

    • Wrap exceptions thrown by the properties so that a helpful message can be displayed (number of attempts, arguments, etc.)

    Dependencies Updated

    • Kotlin (from 1.3.41 to 1.3.50)
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Jul 28, 2019)

    Added

    • StringCharSets object with numeric, alphaLowerCase, alphaUpperCase, alpha and alphaNumeric. Sets of character to easily configure the string generator.
    • kwik.iterations system property to globally define a default number of iteration.

    Modules extracted from core

    • Generator API moved to generator-api module (artifacts generator-api-common and generator-api-jvm)
    • Generators for types of the kotlin standard library is moved to generator-stdlib module (artifacts generator-stdlib-common and generator-stdlib-jvm)
    • The property evaluation is moved to evaluator (artifacts evaluator-common and evaluator-jvm)

    Package names changed (Breaking)

    The packages have been renamed, and classes/files have been moved to reflect their new module

    • (Breaking) The content com.github.jcornaz.kwik.generator as been moved to com.github.jcornaz.kwik.generator.stdlib
    • (Breaking) The content com.github.jcornaz.kwik as been splitted into com.github.jcornaz.kwik.generator.api and com.github.jcornaz.kwik.evaluator

    Dependencies Updated

    • Kotlin (from 1.3.40 to 1.3.41)
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0-beta.1(Jul 1, 2019)

    Added

    • (Breaking) PropertyEvaluationContext available as a type-receiver in property evaluation
    • skipIf function on PropertyEvaluationContext allowing to skip a property evaluation for some specific set of input
    • Few aliases to get common generators:
      • positiveInts, naturalInts, negativeInts and nonZeroInts
      • positiveLongs, naturalLongs, negativeLongs and nonZeroLongs
      • positiveFloats, negativeFloats and nonZeroFloats
      • positiveDoubles, negativeDoubles and nonZeroDoubles
      • nonEmptyStrings and nonBlankStrings
      • nonEmptyLists, nonEmptySets and nonEmptyMaps

    Changed

    • Show test details in console only in case of success
    • Improved exception message in case of falsified property (and introduce typed exception FalsifiedPropertyError

    Dependencies Updated

    • Kotlin (from 1.3.31 to 1.3.40)
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0-alpha.4(Jun 10, 2019)

    Added

    • filter operator for generators
    • (Breaking) samples property in the Generator interface to improve management of the value samples (edge-cases)
    • forAll non-inline function, allowing to hide implementation details.
    • + operator for generator, allowing to merge 2 generators. Example: nonZeroInts() = ints(max = -1) + ints(min = 1)

    Changed

    • (Breaking) Renamed arguments from and until of floats and doubles generators for more consistency with the int and long generators
    • (Breaking) Make the lambda of forAll crossinline, to allow usage of a non-inline function and hide implementation details.
    • Now the size probability for strings a collections generators is similar for all sizes. Instead, they have empty and singletons instances as samples
    • combine and combineWith now start by a combination of the source generators and will randomly add samples in the random generations.
    • Prevent error when passing a big min size/length without a max size/length for collection and strings generators

    Removed

    • (Breaking) ratio argument from the withSamples and withNull operators
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0-alpha.3(Jun 8, 2019)

    Added

    • Generator.combine as a style alternative to combine generators

    Changed

    • (Breaking) zip operator renamed to combineWith for better clarity and discoverability
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0-alpha.2(May 19, 2019)

    Added

    • ints, longs, floats, doubles and boolean generators
    • map operator to transform an existing generator
    • Generator.of() to create a generate from a finite set of samples
    • enum to create a generator from an enum
    • strings to create a String generator
    • default Capable of inferring what generator to return for a given type.
    • lists, sets and maps generators

    Changed

    • Default generator arguments added in forAll and checkForAll.

    Removed

    • checkForAll functions as it was unsafe, allowing to forget assertions without compile-time error.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0-alpha.1(May 18, 2019)

    Added

    • Generator interface for generating random values
    • randomSequence helper to easily create a random (yet predictable) sequence of value
    • forAll and checkForAll function to assess a property of the system under test.
    • withSample and withNull to inject constants values to be always tested
    • zip operator to combine two given generators
    Source code(tar.gz)
    Source code(zip)
Owner
Jonathan Cornaz
Loving Kotlin and Rust!
Jonathan Cornaz
Registration validation testing, Room database testing using JUnit4

Notes app Registration details validation testing, Room database testing using JUnit4 ✨ Screenshots Authors Tridev Deka - LinkedIn - Tridev Deka MIT L

Tridev Deka 0 Mar 30, 2022
Wiremock-testing - WireMock - A great library to mock APIs in your tests and supports Junit5

WireMock Testing WireMock is a great library to mock APIs in your tests and supp

Roger Viñas 1 Oct 4, 2022
TODO API Client Kata for Kotlin Developers. The main goal is to practice integration testing using MockWebServer

KataTODOApiClient for Kotlin We are here to practice integration testsing using HTTP stubbing. We are going to use MockWebServer to simulate a HTTP se

Karumi 61 Nov 20, 2022
Screenshot Kata for Android Developers with Kotlin. The main goal is to practice UI Screenshot Testing.

KataScreenshot in Kotlin We are here to practice UI testing using screenshot tests for Android. We are going to use Espresso to interact with the Appl

Karumi 76 Nov 20, 2022
Super Heroes Kata for Android Developers in Kotlin. The main goal is to practice UI Testing.

KataSuperHeroes in Kotlin We are here to practice UI Testing. We are going to use Espresso to interact with the Application UI. We are going to use Ko

Karumi 86 Nov 20, 2022
Example of a multimodule project following SOLID principles and MVVM, Hilt, Room, coroutines and testing.

MarvelCharacters David Ferrándiz Features Retrieve Marvel’s characters and show them in a grid. See more information about the character in a new scre

David Ferrandiz 2 Aug 22, 2022
sample codebase for E2E testing with Jest, Appium and WebDriverIO for Android and iOS

E2E testing for React Native with Jest, Appium and WebDriverIO (iOS and Android) In this repo you will find a sample project to showcase how to do E2E

Lorenzo Sciandra 23 Nov 9, 2022
FDPClient-EDITED - A free mixin-based injection hacked-client for Minecraft using Minecraft Forge based on LiquidBounce

FDPClient A free mixin-based injection hacked-client for Minecraft using Minecra

SuperSkidder 7 Aug 29, 2022
A Kotlin/JVM based library for BitShares blockchain.

A Kotlin/JVM based library for BitShares blockchain. It implements most functions of BitShares Core including objects (de)serialization, transactions sign/broadcast, wallet create/restore, and more.

Husk 1 Apr 9, 2022
Samples demonstrating the features and use of Koala Plot, a Compose Multiplatform based charting and plotting library written in Kotlin.

Koala Plot Samples This repository houses samples demonstrating the use and features of Koala Plot libraries. How to run Build koalaplot-core with the

Koala Plot 6 Oct 18, 2022
UIPresenter library for android view-based UI presentation

UIPresenter This android library is like a tour guide for your app's Views. It h

Germain Kevin 21 Sep 21, 2022
Android library for Tesla Authentication based on Tesla JSON API (Unofficial)

TeslaAndroidAuth Lightweight Android library for Tesla SSO Authentication based

Octopus Energy 3 Jan 10, 2022
🎬 A demo project for The Movie DB based on Kotlin MVVM architecture and material design & animations.

TheMovies A simple project for The Movie DB based on Kotlin MVVM clean architecture and material design & animations. How to build on your environment

Jaewoong Eum 420 Nov 29, 2022
🎬 A demo project using The Movie DB based on Kotlin MVVM architecture and material design & animations.

TheMovies2 A simple project using The Movie DB based on Kotlin MVVM architecture and material designs & animations. How to build on your environment A

Jaewoong Eum 450 Jan 2, 2023
Android multimodule project based on Kotlin, MVVM, SOLID, flow, coroutines and paging3.

TVMaze David Ferrándiz Features Retrieve TVMaze shows in a grid. See more information about the show in a new screen Tech Kotlin Retrofit Modularizati

David Ferrandiz 1 Nov 18, 2022
🚧 A fully open-source project for creating and maintaining a Kotlin-based Minecraft: Java Edition server.

Hexalite: Java Edition ⚠️ WARNING: The Hexalite Network is a work in progress. It is not yet ready for production. You may encounter bugs and other is

Hexalite Studios 38 Nov 28, 2022
Kotlin Based Project using MVVM Architecture

Cinema Operator Demo App Simple Cinema Operator Demo App for Android platform Code Design Architecture Code Design follows the following Design View T

null 2 Oct 2, 2021
PopularMovieApp - A simple project to Chiper challenge taken data from The Movie DB based on Kotlin MVVM clean architecture

A simple project to Chiper challenge taken data from The Movie DB based on Kotli

Jhonatan Alvarez Caicedo 0 Jan 4, 2022
Quote-App-Kotlin - Quote App Based on MVVM clean architecture getting quote from json file stored in assets

Quotify - Simple Quotes App This app shows the use of ViewModel and ViewModelFac

Ali Ahmad 2 Apr 14, 2022