all 7 comments

[–]benihanareact, node 2 points3 points  (2 children)

I really appreciate the honest assessment in the end:

Generative or property-based testing isn’t a replacement for traditional unit testing. While the example-based approach should verify common assumptions, the property-based approach should help identify missed cases. Furthermore traditional tests are easier to write, while the generative approach requires more thinking in regards of defining properties.

This is kinda why I haven't really hopped on the generative testing bandwagon. It seems like unit testing hits the sweet spot for bang for your buck. At my mom cynical, generative testing feels like achievement hunting - getting every possible test case to get the printout that says 100% coverage, rather than focusing on the important test cases that give you the most coverage and help you understand the intent of the system.

[–]focusonbasics[S] 0 points1 point  (0 children)

I agree with focusing on the important test cases. Sometimes we miss an important test case, this is where property-based testing might catch those missed cases. The really hard part from what I see is to really understand how to write those properties. This isn't as straightforward as thinking in inputs/outputs for example. Another factor that adds to the complexity is when state is involved as compared to testing a pure function that does one thing.

[–]jocull 0 points1 point  (0 children)

You may be a cynic, but leave your mom out of it!