O'Reilly logo

Clojure Applied by Alex Miller, Ben Vandgrift

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Property-Based Tests with test.check

Example-based tests rely on developers to enumerate enough examples to fully verify the behavior of the functions under test. Each additional example covers one more input and verifies its output. Property-based tests instead encourage you to look for properties of your functions that are always true. You can then use generators to produce a large number of random examples that can be fed into your code. For each generated example you can verify that the property holds true.

Property-based tests generally involve more time invested in assembling data generators and thinking carefully about the properties of our code. However, once we’ve created the generators and properties, we can produce an arbitrary number ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required