I donβt think it really matters, but I canβt prove it.
Fuzz testing will try only a few inputs, in most cases a small part of the possibilities. No matter how well RNG is used, it may or may not find one of the inputs that violates your code, depending on how much of all possible inputs violates your code. If the pattern in PRNG is very simple, it seems unlikely to me that it will in any way match the pattern in the "bad" inputs you are looking for, so it will hit it no more and no less than a true random one.
In fact, if you knew how to choose an RNG to maximize the likelihood that it would find bad inputs, you could probably use this knowledge to find the error faster ...
I do not think you should use a really bad PRNG. rand , for example, is allowed to demonstrate very simple patterns, such as alternating LSBs. And if your code uses PRNG internally, you probably want to avoid using the same PRNG in the same way in the test, just to make sure that you do not accidentally check only those cases where the input matches the internal generated stream! A small risk, of course, since you hope that they will use different seeds, but still.
As a rule, in this language it is not so difficult to find cryptographic or, at least, safe hash libraries. SHA-1 is everywhere and easy to use to create a stream, or if RC4 is trivial to implement on your own. Both provide pretty good PRNGs, if not as secure as Blum Blum Shub. I would think that the main problem is speed - if, for example, Mersenne Twister can generate tests with an error 10 times faster and the code under test is fast enough, then it may have a better chance of finding bad inputs in this one regardless of the fact that, given the 624 outputs, you can infer the full state of the RNG ...
Steve jessop
source share