Property-based testing is an expressive complement to traditional unit tests, facilitating concise and declarative testing specifications that simplify the writing and maintenance of test suites. Haskell for Mac playgrounds take that to the next level.

When bundling QuickCheck properties with the code they test, playgrounds enable the continuous testing of code while it is being implemented or refactored — just as Haskell for Mac continuously type checks code while it is being edited. This facilitates rapid feedback and test-driven development.

In case of a mistake, we notice immediately and get a counter example to help us track down the bug.

To get you started, have look at this sample project: Testing.hsproj

While this article focused on property-based testing, you can, of course, also use unit testing frameworks, such as HUnit in playgrounds.