3 ms·
I implemented a tiny and simple data structure in rust, a circular buffer: https://github.com/RedBeardLab/circular-buffer-rs https://github.com/RedBeardLab/circ
by siscia 6y ago
I implemented a tiny and simple data structure in rust, a circular buffer: https://github.com/RedBeardLab/circular-buffer-rs https://github.com/RedBeardLab/circular-buffer-rs
The amount of subtle bugs and problems that proptest was able to point out to me was terrific.
Property based testing it is definitely the tool that you want to use to thoroughly test a complex library that need to maintains its invariants.
The interesting bit is that if you approach the problem with unittest, you will write mostly test that pass. If you approach the test writing as a property test, then you will write much harder test cases.
- eru 6y agoApropos hard test cases: have a look at the floats that Python's Hypothesis property testing library generates. They are truly evil.