Wrapping Up
Here's a summary of what we learned in this chapter.
We'll cover the following
Summary
In this chapter, we’ve walked through a realistic integration test suite written as stateful properties. All we had was a model layer for a bookstore using a PostgreSQL instance without any tests. We first started by drawing up the generators for our base data types, which helps do some broader testing to make sure the system works without throwing exceptions. That’s where we encountered and resolved our first encoding bug.
With this out of the way, we established the initial model, using a wrapper module (a shim) to allow for as much determinism as possible. As we’ve seen, this approach tends to create a bit more repetition with precondition-heavy code, but makes tests more decideable and simpler to debug. We’ve also seen this at work as we refined the model through multiple failures and learned about more tricky aspects of using SQL.
Additionally, we’ve been through a round of debugging and we’ve seen how PropEr shrinks stateful property command sequences to debug our models before doing a final check with parallel tests.
What’s next
We’ll learn how to create and operate a specialization for systems that represent finite state machines.
Get hands-on with 1400+ tech skills courses.