I'm chasing a bug in the RNG for a well-known programming language under certain pathological inputs. There is an obvious pattern in this pathological case, apparent with very small n (~ 10000), and the input fails the dieharder tests (of course).
I am writing a unit test to catch this bug. I need to implement a statistical test to demonstrate this bug exists, but the test needs to be quick and ideally easy to implement in my target language. Unfortunately, I'm not familiar with the dieharder tests, specifically or with any statistical tests for RNG, generally.
Is there a quick test for randomness that can catch obviously non-random sequences of small sets?
PS: The problem is not in the RNG implementation (Mersenne Twister). The problem lay in the formula applied to the random number to fit it into a user-specified range. I don't have access to the formula from user-land, so I can't just unit test that formula (which is what I want to do). The only exposed interface is that of a RNG, so I figure I will test it as a RNG.
Using NIST Standard 800-22, "A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications", I can use Hamming Weight as the basis for a spectral test. That is good enough to expose the bug.