Lockstep-style testing with quickcheck-dynamic
Posted on September 8, 2022Recently IOG and QuviQ released a new library for testing stateful systems called quickcheck-dynamic
. In this blog post we will take a look at this library, and how it relates to quickcheck-state-machine. We will focus on the state machine testing aspect; quickcheck-dynamic also has support for dynamic logic, but we will not discuss that here.
Specifically, we will consider how we might do lockstep-style testing with quickcheck-dynamic
. This is a particular approach to testing that we described in great detail in an earlier blog post, An in-depth look at quickcheck-state-machine. We will recap the general philosophy in this new blog post, but we will focus here on the hows, not necessarily the whys; it might be helpful to be familiar with the previous blog post to understand the larger context of what we’re trying to achieve.
We have developed a library called quickcheck-lockstep
which builds on top of quickcheck-dynamic
to provide an abstraction called InLockstep
which provides support for lockstep-style testing. In this blog post we will describe this library in two parts:
In the first half we will show a test author’s perspective of how to use the abstraction. In the second half we show how we can implement the abstraction on top of quickcheck-dynamic
.