Re:Property-Based Testing for the People
by dllthomas on Monday January 06, 2025 @11:36PM
(#42619279)
Ah, 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.
Re:Property-Based Testing for the People
by jgalt212 on Tuesday January 07, 2025 @07:17AM
(#42621639)
Indeed, the world is not IID. As such, test cases should not be a uniformly distributed sample of some mathematical 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.