Learn R Programming

hedgehog (version 0.1)

Property-Based Testing

Description

Hedgehog will eat all your bugs. 'Hedgehog' is a property-based testing package in the spirit of 'QuickCheck'. With 'Hedgehog', one can test properties of their programs against randomly generated input, providing far superior test coverage compared to unit testing. One of the key benefits of 'Hedgehog' is integrated shrinking of counterexamples, which allows one to quickly find the cause of bugs, given salient examples when incorrect behaviour occurs.

Copy Link

Version

Install

install.packages('hedgehog')

Monthly Downloads

743

Version

0.1

License

MIT + file LICENSE

Maintainer

Huw Campbell

Last Published

August 22nd, 2018

Functions in hedgehog (0.1)

gen.c

Generate a vector of values from a generator
gen.no.shrink

Stop a generator from shrinking
tree.replicate

Creating trees of lists
gen-element

Random Sample Generation
gen-monad

Generators
generate

Compose generators
hedgehog

Property based testing in R
gen.example

Sample from a generator.
command

State based testing commands
gen.gamma

Generate a float with a gamma distribution
discard

Discard a test case
gen.shrink

Helper to create a generator with a shrink function.
gen.sized

Sized generator creation
shrink.removes

Produce permutations of removing num elements from a list.
shrink.towards

Shrink an integral number by edging towards a destination.
expect_sequential

Execute a state machine model
gen.structure

Generate a structure
forall

Hedgehog property test
gen.unif

Generate a float between the from and to the values specified.
symbolic

A symbolic value.
tree

Lazy rose trees
gen.actions

Generate a list of possible actions.
gen.beta

Generate a float with a gamma distribution
gen.recursive

Build recursive structures in a way that guarantees termination.
gen.run

Run a generator
shrink.halves

Shrink a number by dividing it into halves.
shrink.list

Shrink a list by edging towards the empty list.
gen.date

Generate a date between the from and to dates specified.
gen.list

Generate a list of values, with length bounded by the size parameter.