TestU01 is a
software library
In computing, a library is a collection of resources that can be leveraged during software development to implement a computer program. Commonly, a library consists of executable code such as compiled functions and classes, or a library can ...
, implemented in the
ANSI C
ANSI C, ISO C, and Standard C are successive standards for the C programming language published by the American National Standards Institute (ANSI) and ISO/IEC JTC 1/SC 22/WG 14 of the International Organization for Standardization (ISO) and the ...
language, that offers a collection of utilities for the
empirical
Empirical evidence is evidence obtained through sense experience or experimental procedure. It is of central importance to the sciences and plays a role in various other fields, like epistemology and law.
There is no general agreement on how t ...
randomness testing of
random number generator
Random number generation is a process by which, often by means of a random number generator (RNG), a sequence of numbers or symbols is generated that cannot be reasonably predicted better than by random chance. This means that the particular ou ...
s (RNGs).
[The TestU01 web site](_blank)
The library was first introduced in 2007 by Pierre L’Ecuyer and Richard Simard of the
Université de Montréal
The Université de Montréal (; UdeM; ) is a French-language public research university in Montreal, Quebec, Canada. The university's main campus is located in the Côte-des-Neiges neighborhood of Côte-des-Neiges–Notre-Dame-de-Grâce on M ...
.
[Pierre L’Ecuyer & Richard Simard (2007),]
TestU01: A Software Library in ANSI C for Empirical Testing of Random Number Generators
, ''ACM Transactions on Mathematical Software
''ACM Transactions on Mathematical Software'' (''TOMS'') is a quarterly scientific journal that aims to disseminate the latest findings of note in the field of numeric, symbolic, algebraic, and geometric computing applications.
The journal publish ...
'', 33: 22.
The library implements several types of random number generators, including some proposed in the literature and some found in widely used software. It provides general implementations of the classical statistical tests for random number generators, as well as several others proposed in the literature, and some original ones. These tests can be applied to the generators predefined in the library, user-defined generators, and streams of random numbers stored in files. Specific tests suites for either sequences of
uniform
A uniform is a variety of costume worn by members of an organization while usually participating in that organization's activity. Modern uniforms are most often worn by armed forces and paramilitary organizations such as police, emergency serv ...
random numbers in
,1or bit sequences are also available. Basic tools for plotting vectors of points produced by generators are provided as well.
History
An initial battery of randomness tests for RNGs was suggested in the 1969 first edition of ''
The Art of Computer Programming
''The Art of Computer Programming'' (''TAOCP'') is a comprehensive multi-volume monograph written by the computer scientist Donald Knuth presenting programming algorithms and their analysis. it consists of published volumes 1, 2, 3, 4A, and 4 ...
'' by
Donald Knuth
Donald Ervin Knuth ( ; born January 10, 1938) is an American computer scientist and mathematician. He is a professor emeritus at Stanford University. He is the 1974 recipient of the ACM Turing Award, informally considered the Nobel Prize of comp ...
. Knuth's tests were then supplanted by
George Marsaglia's
Diehard tests (1996) consisting of fifteen different tests. The inability to modify the test parameters or add new tests led to the development of the TestU01 library.
Features
TestU01 offers four groups of modules for analyzing RNGs:
# Implementing (pre-programmed) RNGs;
# Implementing specific statistical tests;
# Implementing batteries of statistical tests;
# Applying tests to entire families of RNGs.
When a specific test is applied to a sample of size ''n'' produced by an RNG, the
''p''-value of the test usually will remain reasonable as the sample size increases until the sample size hits ''n''
0, say. After that, the ''p''-value diverges to 0 or 1 with exponential speed. Module 4 allows the researcher to study the interaction between a specific test and the structure of the point sets produced by a given family of RNGs. This technique can be used to determine how large the sample size should be, as a function of the generator's period length, before the generator starts to fail the test systematically.
TESTU01 offers several batteries of tests including "Small Crush" (which consists of 10 tests), "Crush" (96 tests), and "Big Crush" (106 tests). The specific tests applied by each battery are detailed in the user's guide.
[TestU01 User's Guide](_blank)
On a 1.7 GHz
Pentium 4
Pentium 4 is a series of single-core central processing unit, CPUs for Desktop computer, desktops, laptops and entry-level Server (computing), servers manufactured by Intel. The processors were shipped from November 20, 2000 until August 8, 20 ...
running
Red Hat Linux
Red Hat Linux was a widely used commercial open-source Linux distribution created by Red Hat until its discontinuation in 2004.
Early releases of Red Hat Linux were called Red Hat Commercial Linux. Red Hat published the first non-beta release ...
9.0, for a simple RNG, Small Crush takes about 2 minutes. Crush takes about 1.7 hours. Big Crush takes about 4 hours. For a more complex RNG, all these times
increase by a factor of two or more. For comparison, the Diehard tests take about 15 seconds to run.
Limitations
TestU01 only accepts 32-bit inputs, and interprets them as values in the range
, 1 This causes it to be more sensitive to flaws in the most-significant bits than the least significant bits. It is important to test general-purpose generators in bit-reversed form, to verify their suitability for applications which use the low-order bits.
[
]
Generators which produce 64 bits of output additionally require separate tests for their high and low halves.
See also
*
Randomness tests
*
Diehard tests
*
PractRand
References
{{reflist
Computer libraries
Random number generation
Statistical software