Releases: jcornaz/kwik
0.5.0
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 usingFuzzer
instead ofGenerator
in moduleevaluator
.
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)
andSimplier.triple(Simplifier, Simplifier, Simplifier)
Are provided -
Arbitrary
an empty object type that can be used to findFuzzer
factories (regardless of the module they come from) -
Arbitrary.pair
andArbitrary.triple
to combine fuzzers.
Dependencies Updated
- Kotlin (from
1.3.61
to1.3.71
)
0.4.0
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 variableKWIK_SEED
on JVM and Linux
(on JVM the system property has precedence over the environment variable)
0.3.0
Removed (Breaking)
- Module
core
. It was an empty module only to provide transitive dependencies to most common used modules.
Added
linux
andwindows
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)
-
Remove all usage of deprecated members
-
Use
Generator.withSamples
instead ofGenerator.samples
-
Use
Generator.randomSequence
instead ofGenerator.randoms
-
-
Replace dependencies of module
core
byevaluator
andgenerator-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") }
0.3.0-alpha.1
Removed (Breaking)
-
Generator.samples
property has been removed.
Now the generator have to have a probability to generate the edge cases ingenerate
.
The recommended option when building a generator, is to usewithSamples
-
Generator.randoms
function has been removed.
Generator.generate
orGenerator.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
to1.3.61
)
0.2.0
Deprecated
samples
property inGenerator
interface. (Samples are about to be included in generation ofgenerate
)
One should usewithSamples
andfrequency
instead.
Added
andThen
operator to make easier building complex generation pipelinefrequency
combinator, allowing to create a frequency-parametrized generator
Dependencies Updated
- Kotlin (from
1.3.50
to1.3.60
)
0.2.0-rc.1
Changed
- default max size/length for string,collection and sequence generators set to
50
(instead of200
)
Added
sequences
generatoruuids
generator
0.2.0-beta.2
Deprecated
- Method
Generator.randoms(Long)
the generator should generate single values, not a sequence.
Added
- (Breaking) method
generate(Random): T
in interfaceGenerator
to generate single value. checkForAll
. An alternative toforAll
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 deprecatedGenerator.randoms(Long): Sequence<T>
0.2.0-beta.1
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
to1.3.50
)
0.1.0
Added
StringCharSets
object withnumeric
,alphaLowerCase
,alphaUpperCase
,alpha
andalphaNumeric
.
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
(artifactsgenerator-api-common
andgenerator-api-jvm
) - Generators for types of the kotlin standard library is moved to
generator-stdlib
module
(artifactsgenerator-stdlib-common
andgenerator-stdlib-jvm
) - The property evaluation is moved to
evaluator
(artifactsevaluator-common
andevaluator-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 tocom.github.jcornaz.kwik.generator.stdlib
- (Breaking) The content
com.github.jcornaz.kwik
as been splitted intocom.github.jcornaz.kwik.generator.api
andcom.github.jcornaz.kwik.evaluator
Dependencies Updated
- Kotlin (from
1.3.40
to1.3.41
)
0.1.0-beta.1
Added
- (Breaking)
PropertyEvaluationContext
available as a type-receiver in property evaluation skipIf
function onPropertyEvaluationContext
allowing to skip a property evaluation for some specific set of input- Few aliases to get common generators:
positiveInts
,naturalInts
,negativeInts
andnonZeroInts
positiveLongs
,naturalLongs
,negativeLongs
andnonZeroLongs
positiveFloats
,negativeFloats
andnonZeroFloats
positiveDoubles
,negativeDoubles
andnonZeroDoubles
nonEmptyStrings
andnonBlankStrings
nonEmptyLists
,nonEmptySets
andnonEmptyMaps
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
to1.3.40
)