News for hackers. Stuff that matters.
Re:Property-Based Testing in Rust with Arbitrary by shepmaster on Thursday November 10, 2022 @06:41PM (#33555279)
Most posts about property-based testing focus on convincing the reader to do property-based tests and the mechanics of writing the tests.

Unfortunately, I'm already convinced and know how to write the tests — what I wish I could find is some resource that would hone my ability to identify worthwhile properties. The best one I know of and go back to time and time again is https://fsharpforfunandprofit.com/posts/property-based-testi..., but I really wish I could find more.

Re:Property-Based Testing in Rust with Arbitrary by chelmertz on Thursday November 10, 2022 @07:35PM (#33555844)
Here are inspirational examples from properties of a video editor: https://wickstrom.tech/programming/2019/03/24/property-based...

The author also published a tool for PBT:nif web front ends which sounds interesting.

Re:Property-Based Testing in Rust with Arbitrary by shepmaster on Thursday November 10, 2022 @09:27PM (#33556620)
Thanks! This page is familiar so I've definitely read it before, but didn't recall it when remembering examples. I like that it links to the site I provided; maybe I should try to search for other articles that also link there to find more inspiration.
Re:Property-Based Testing in Rust with Arbitrary by Jtsummers on Thursday November 10, 2022 @07:43PM (#33555921)
I really liked Hebert's Property-Based Testing with PropEr, Erlang, and Elixir. It's in Erlang and Elixir, but the concepts transfer well to other languages and property-based test systems.

https://pragprog.com/titles/fhproper/property-based-testing-...

Re:Property-Based Testing in Rust with Arbitrary by shepmaster on Thursday November 10, 2022 @09:25PM (#33556611)
Thanks; I've added that to my Christmas gift ideas!
Re:Property-Based Testing in Rust with Arbitrary by Folcon on Thursday November 10, 2022 @11:01PM (#33557185)
I've had a good experience with this[0], however it seems Eric is not currently running it, if you're interested, email me, I can dig around and see if I can find my notes.

Alternatively reach out to him in an email and see if he'll be willing to let you buy access. I personally found it a pretty good course where he had spent a reasonable amount of time coming up with both decent examples to highlight how it was going to work as well as create some nice rules of thumb as starting points to think about properties.

-[0]: https://ericnormand.podia.com/beginning-property-based-testi...

Re:Property-Based Testing in Rust with Arbitrary by travisjungroth on Friday November 11, 2022 @01:51AM (#33557994)
Explore abstract algebra[0]. It’s the study of algebraic structures, which are sets (types/classes) and operators (functions/methods) with axioms (properties). Also check out binary relations[1], part of order theory.

[0] https://en.m.wikipedia.org/wiki/Abstract_algebra [1] https://en.m.wikipedia.org/wiki/Binary_relation