
Video time: 24m45s
Want this course?
When to test: to reproduce a known bug
Course: Advanced Property-Based Testing with test.check
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.