Another test philosophy introduced by QuickCheck

Property based testing has become quite famous in the functional world. Mainly introduced by QuickCheck framework in Haskell, it suggests another way to test software. It targets all the scope covered by example based testing: from unit tests to integration tests.

In order to introduce property based testing, this article will use fast-check — a property based testing framework for JavaScript — but examples can easily be adapted to other frameworks and languages.

Logo of “fast-check”

It is good to notice that this test framework helped me to discover bugs in famous npm packages with only a few lines of code — checkout fast-check readme for more details.