Welcome to novaBBS (click a section below)
|mail  files  register  newsreader  login|
|Property Based Testing||AnonUser|
Title: Property Based Testing
While formal verification is the most reliable you can get, there also
property based testing which comes very close to it and it's easier and
There's a paper on how the Haskell containers library was formally
Coq (a proof assistant) by converting the Haskell code to Coq using
They verified that the containers library had _zero_ bugs in it and it is
likely due to them using property based tests for the library. I guess it
written in Haskell also has a huge part in it being bug free.
verified containers package:
talk for the paper: https://invidio.us/watch?v=9QL97E0cNk0
In short, property based testing means that you have a function and you
that it has specific properties. The most popular example is a sort
A sort function _must_ have the following properties:
* it may not change the length of the resulting list
* the resulting list must have each element the same amount of times pre
* sorting a list twice must equal sorting the list once
* each consecutive value in a list must be greater or equal to the previous
These properties are in a way formal proofs of a sort function.
QuickCheck is such a library that makes property based testing really
randomly generates input for your functions and finds the (minimal)
where your function doesn't satisfy those properties. If you need more
encouragement that property based testing is awesome, then check out the
computerphile video on "Code Checking Automation" on Youtube. John Huges
develop the Haskell language and also created QuickCheck.
It is also possible to use property based testing on state machines to
that invalid states can not be reached.
Posted on RetroBBS