TestU01
TestU01 is a software library, implemented in the ANSI C programming language, designed for empirical testing of random number generators (RNGs). Developed by Pierre L'Ecuyer and Richard Simard at the Université de Montréal, it provides a comprehensive suite of statistical tests intended to detect various kinds of non-random behavior in sequences of numbers generated by RNGs.
The library offers different batteries of tests, each designed to target specific weaknesses. These batteries range from simple, fast tests suitable for basic assessment to more complex and computationally intensive tests designed to reveal subtle correlations and patterns. The main batteries include:
- SmallCrush: A set of relatively quick and simple tests designed to identify obvious defects in RNGs.
- Crush: A more extensive battery of tests than SmallCrush, designed to detect a wider range of common weaknesses.
- BigCrush: The most comprehensive battery of tests in TestU01, intended for thorough evaluation of RNGs and capable of detecting subtle and complex issues. BigCrush is very computationally expensive and can take considerable time to complete.
- Rabbit: A battery focused on detecting biases and correlations.
- Alphabit: A battery tailored to binary sequences produced by RNGs.
TestU01 allows users to analyze the output of a given RNG against the expected statistical properties of a truly random sequence. It provides a flexible framework for incorporating new tests and custom RNGs. The library's output typically consists of p-values, which indicate the probability of observing a test statistic as extreme as or more extreme than the one obtained, assuming the RNG is truly random. Low p-values (typically below a pre-defined significance level, such as 0.01 or 0.001) suggest that the RNG's output deviates significantly from true randomness and may indicate a flaw in the generator.
TestU01 is widely used in research and development to assess the quality of RNGs used in simulations, cryptography, and other applications where randomness is critical.