I have a function that (more or less) is supposed to select a small number m of random number from the range [1,n] (for some n >> m) and I need to test that it work. Is there an easy to implement test that will give good confidence that it is working correctly? (For reference the full on chi squared test is not simple enough.)
- m in [5,500], n is small enough I can use normal int/float types for most math.
- I can get as many set as I'm willing to wait for (>100s per second)
The reason I'm looking for something simple is that the code I'm checking isn't that complicated. If the test code is more complex than the code under test, then the potential for the test being wrong becomes a real problem.
I took another look at Chi-squared and it's not as bad as I remembered... as long as I have a fixed number of buckets and a fixed significance threshold. (Or a canned CDF, and I don't think I do.)