3 ms·
Not weighing in on any particular tech (hypothesis or otherwise), but intrigued by your example... My initial impulse is to pick a random cell which must not b
by dllthomas 2y ago
Not weighing in on any particular tech (hypothesis or otherwise), but intrigued by your example...
My initial impulse is to pick a random cell which must not be zero, generate a random number for each other cell and a random non-zerp number for that one. I'm not immediately decided on whether it's uniformly distributed.
- eslaught 2y agoI would pick the number of non-zeros first, assert that it's non-zero, then continue filling in the values themselves. And probably not with a uniform distribution. Any algorithm that cares about the number of non-zeros could have non-trivial interactions with their arrangement and count, so picking something that generates non-trivial sparsity (and doesn't just make the array look like white noise) is going to have the best chance of exposing interesting behavior. The tricky part is thinking through how to generate "interesting" patterns, which admittedly I haven't put enough thought into.
- dllthomas 2y agoAh, yeah, generating for property testing probably doesn't want a uniform distribution. What patterns are interesting will surely depend on what we're doing with the array.
- jgalt212 2y agoIndeed, the world is not IID. As such, test cases should not be a uniformly distributed sample of some mathematical distribution.
- dllthomas 2y ago> Indeed, the world is not IID. Right! And even if it were, in the sense that that's what we should expect as real world input, it wouldn't generally be the best distribution for finding bugs.