Refining the Tests
We’ve got a complete rather deterministic model, with a complete piece of code to test. What we have to do now is just run tests until they fail—if they don’t, that’s a bit scary, so we should feel free to cause a failure ourselves—and then fix the problems as they come up. That step could save us from this kind of release cycle:
- Write code.
- Test code as usual.
- Deploy or release the code.
- A customer opens a ticket.
- After scratching your head to figure out how in hell they get the problem, you finally reproduce it.
- Fix the problem.
- Go to 1.
Instead, we’re now more likely to have this release cycle:
- Write code.
- Stateful property test the code.
- Find a problem that the framework easily reproduces for you.
- Deploy or release the code.
- Wait ...
Get Property-Based Testing with PropEr, Erlang, and Elixir now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.