Search⌘ K
AI Features

Refining the Tests

Explore how to refine property-based tests in the context of a bookstore case study. Learn to handle troublesome characters in data generators, split properties for better focus, and adjust postconditions to accurately compare UTF-8 binaries and character lists. Understand precondition enhancements to avoid invalid operations and develop strategies to debug and improve stateful property tests using PropEr in Erlang.

Order of failures:
Property tests are probabilistic. If you are following along, you may find different issues, or the same issues in a different order, than those in this text. This is normal, and rerunning the property a few times may yield different errors each time.

Code

Let’s start off with the code ...