kudzu: coverage driven random testing framework

[ bsd3, library, program, testing ] [ Propose Tags ] [ Report a vulnerability ]

Kudzu is a coverage driven random testing framework


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.1.0
Change log CHANGELOG.md
Dependencies base (>=4.14 && <4.20), hedgehog (>=1.2 && <1.5), hpc (>=0.6.0 && <0.8.0), kudzu, leancheck (>=1.0.0 && <1.2), QuickCheck (>=2.12 && <2.16) [details]
License BSD-3-Clause
Author Shae Erisson
Maintainer shae@scannedinavian.com
Category Testing
Home page https://github.com/shapr/kudzu
Source repo head: git clone https://github.com/shapr/kudzu.git
Uploaded by ShaeErisson at 2024-04-27T15:51:15Z
Distributions
Executables kudzu
Downloads 136 total (4 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-04-27 [all 1 reports]

Readme for kudzu-0.1.1.0

[back to package description]

KUDZU will slowly grow to cover all of your code

Kudzu is a library that throws test cases at your property tests until the code coverage no longer increases.

WHY?

Property testing has no feedback loop, you randomly choose a number of test cases and hope for the best.

How do you know if your property tests were any good? The best feedback I know is to use hpc and look at the pretty colored HTML output to see what code was exercised.

But wait, why do I have to look at the output? Isn't that why we have computers?

HOW?

In Haskell, you can get code coverage results while your program is running!

WHAT FEEDBACK LOOP?

The simplest feedback loop is to keep running random tests until new code coverage stops increasing.

HOW DO I MAKE IT GO?

  1. add kudzu to your test-suite depends,
  2. import the Kudzu module
  3. call the testUntil function of your choice
    1. testUntilSameQCMany or testUntilSameQC
    2. testUntilSameHHMany or testUntilSameHH
    3. testUntilSameLCMany or testUntilsameLC
  4. run with cabal test --enable-coverage

TELL ME MORE

The best write up of this idea is Random Test Generation, Coverage Based.

TODO

  • support HedgeHog
  • support QuickCheck
  • support LeanCheck
  • figure out how to use Kudzu on Kudzu without looping forever

EXAMPLE

You can see kudzu in use in the tests for takedouble