4 ms·
It’s a bit surprising to have fuzzing as part of the standard tool chain, but not property based testing. I guess we still need to rely on something like gopte
by jiehong 5y ago
It’s a bit surprising to have fuzzing as part of the standard tool chain, but not property based testing.
I guess we still need to rely on something like gopter.
- kardianos 5y agoUse table driven tests. func TestFoo(t *testing.T) { list := []struct { want string input string expectedErr error }{ {item1}, {item2}, } runtest
- troutwine 5y agoThat’s not property testing. Yes there is a property being checked but you the user are selecting the inputs by hand which lumps in whatever biases you might bring to the test. Property testing is a property to validate, randomized search over the input space and, ideally, shrinking of inputs that fail the property. The benefit is you get to search over more of the input space that a human would normally do with an explicit table of inputs and with hopefully less bias toward inputs that don’t fail the property.
- akshayshah 5y agotesting/quick is in the standard lib, though it's a very far cry from Hypothesis or QuickCheck.
- masklinn 5y ago> It’s a bit surprising to have fuzzing as part of the standard tool chain, but not property based testing. Property testing doesn’t really benefit from (let alone need) toolchain integration, so while having better support for proptesting would be nice and give them more visibility, it’s far from critical.