Want this course?
Testing distributed systems
Distributed systems are hard. Testing distributed systems is hard. But at least Property-based Testing gives us a way to do it.
In this lesson, we test a distributed system. We learn:
- how to use PBT to guide our model development
- how to gain introspection into failing tests
- how to generate reliable failures—test cases that fail every time so you can use them to debug
When to test: to reproduce a known bug
Property-Based Testing lets you search for a sequence of operations that reproduce a bug. Imagine you get a bug report from a user or you find an exception in your logs. You don't know where it's coming from, but you know it's in your database code. How do you find that bug?
PBT lets you do a search over possible sequences of operations. You can design a test to only fail if it finds the same exception. Once you find a failing case, you can turn it into a regular regression test so you don't need to do the search again.