There was originally a bug in the GAlib random number generator... if I remember correctly, the guy who identified it told me this was found (or demonstrated) by making a scatter plot of generated numbers an observing there was a pattern to the data.
I don't know what NIST says, but for the tests that use Chi-square, you can look at the left tail. Basically tests that have very small Chi-square values are "too close" to the expected distribution.
This is how Fisher critiqued Mendel's experiments -- they were too perfect!
I'm not sure whether it's still the case, but the state of the art some twenty years ago when I generated a random stream and wanted to test it, was the "diehard" suite[1] which started as an implementation of the tests suggested by Knuth in TAOCP and then was expanded from there. The version I had was in C that had been autogenerated by the gnu fortran complier from a fortran original, so the source code was even more impossible than normal quant code to understand. I understand it was superceded by "dieharder", which is a native C implementation I think.
Robert Brown has a page with a bunch of info about dieharder and statistical testing of random generators in general [2]
Unfortunatly the site is sloppy when explaining the subject.
For example
> Let's say we have the following binary string.
s=00000000000000000000
It is obviously not random since there are no ones in the string. Therefore, we must check that there are roughly an equal number of zeros and ones in the string.
5 comments
[ 4.0 ms ] story [ 27.6 ms ] threadStrange.
(0110100001100101011011000110110001101111001000000111011101101111011100100110110001100100)
This is how Fisher critiqued Mendel's experiments -- they were too perfect!
Robert Brown has a page with a bunch of info about dieharder and statistical testing of random generators in general [2]
[1] https://en.wikipedia.org/wiki/Diehard_tests
[2] https://webhome.phy.duke.edu/~rgb/General/dieharder.php
For example
> Let's say we have the following binary string. s=00000000000000000000 It is obviously not random since there are no ones in the string. Therefore, we must check that there are roughly an equal number of zeros and ones in the string.