pqc: Parallel batch driver for QuickCheck

[ bsd3, library, testing ] [ Propose Tags ]

Parallel batch driver for QuickCheck

[Skip to Readme]
Versions 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.4.2, 0.5, 0.5.1,, 0.6, 0.7,, 0.7.1,,, 0.8
Dependencies base, QuickCheck (<2), random [details]
License BSD-3-Clause
Author Don Stewart
Maintainer dons@cse.unsw.edu.au
Category Testing
Home page http://code.haskell.org/~dons/code/pqc
Uploaded by DonaldStewart at Tue Nov 6 01:00:54 UTC 2007
Distributions NixOS:0.8
Downloads 5569 total (32 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI





Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

For package maintainers and hackage trustees

Readme for pqc-0.2

[back to package description]
PQC: QuickCheck in the Age of Concurrency

An SMP parallel QuickCheck driver

Quick start:

Parallel batch driver for QuickCheck

Run your properties in chunks over multiple cpus.

Building (usual Cabal instructions):

    $ runhaskell Setup.lhs configure 
    $ runhaskell Setup.lhs build
    $ runhaskell Setup.lhs install

Example use in: examples/Example.hs

Long story

Do you:

    * Have (or want) lots of QuickCheck properties? 
    * Run them often (maybe on every darcs commit)? 
    * Tired of waiting for the testsuite to finish? 
    * Got a multi-core box with cpus sitting idle...? 
Yes? You need Parallel QuickCheck! 

PQC provides a single module: Test.QuickCheck.Parallel.  This is a
QuickCheck driver that runs property lists as jobs in parallel, and will
utilise as many cores as you wish, with the SMP parallel GHC 6.6
runtime. It is simple, scalable replacement for Test.QuickCheck.Batch.

An example, on a 4 cpu linux server, running 20 quickcheck properties.

    With 1 thread only:
        $ time ./a.out 1
        1: sort1                    : OK, 1000 tests.
        1: sort2                    : OK, 1000 tests.
        1: sort3                    : OK, 1000 tests.
        1: sort4                    : OK, 1000 tests.
        ./a.out 1 > x  18.94s user 0.01s system 99% cpu 18.963 total

    18 seconds, 99% cpu. But I've got another 3 2.80GHz processors sitting
    idle! Let's use them, to run the testsuite faster. No recompilation required.

    4 OS threads, 4 Haskell threads:
        $ time ./a.out 4 +RTS -N4 > /dev/null
        ./a.out 4 +RTS -N4 > /dev/null  20.65s user 0.22s system 283% cpu 7.349 total

    283% cpu, not bad. We're getting close to being limited by the
    length of the longest running test.

Or on a dual core macbook, thanks to Spencer Janssen for macbook data
and testing:

    1 thread:
        ./Example 1 

    2 thread:
        ./Example 2 +RTS -N2 

Get it!

    Homepage: http://www.cse.unsw.edu.au/~dons/pqc.html
    Haddocks: http://www.cse.unsw.edu.au/~dons/pqc/
    Example : http://www.cse.unsw.edu.au/~dons/code/pqc/examples/Example.hs

    darcs get http://www.cse.unsw.edu.au/~dons/code/pqc