|
|
|
|
|
by felixhuttmann
1899 days ago
|
|
Property-based testing is good when there is a property to assert that emerges in a non-trivial manner from the code under test. If you do not have such a problem, property-based testing provides no value over a simple, example-based test. In the case of the parsing code from the article, the emerging property is that a serialization followed by a deserialization should always yield the original result. In the case of the 'binary or not' case from the article, the non-trivial, emergent property is that the function never fails with an exception. Most modern software development is plumbing, stitching together platforms, libraries and frameworks, and there are rarely non-trivial, emergent properties where property-based testing is useful. |
|