Property-based Testing a Vending Machine

In an earlier article and video, I discussed my implementation of a Vending Machine kata. The code I wrote was dictated via TDD. I then decided to practice Property-based Testing. The following property tests were created: These tests actually caught some bugs that surprised me. Specifically, I learned that some functions may be unsafe unless …