← Back to context

Comment by jamesponddotco

7 hours ago

Never heard of “property-based testing” before. Coming from Go, I mostly use table and fuzzy tests.

Is this approach something that makes sense in Go as well? I see at least one package[1][2] for Go, but I wonder if the approach itself makes sense for the language.

[1]: https://github.com/flyingmutant/rapid

[2]: Oh, I just found out about testing/quick.

Rapid is excellent. It also integrates with the standard library's fuzz testing, which is handy to persist a high-priority corpus of inputs that have caused bugs in the past.

Testing/quick is adequate for small things and doesn't introduce new dependencies, but it's also frozen. Many years ago, the Go team decided that PBT is complex enough that it shouldn't be in stdlib.

Here's a small example of a classic PBT technique used in a very practical Go project: https://github.com/connectrpc/connect-go/blob/cb2e11fb88c9a6...