Abstract. We introduce a theoretical test, named weight discrepancy test, on pseudorandom number generators. This test measures the χ 2 -discrepancy between the distribution of the number of ones in some specified bits in the generated sequence and the binomial distribution, under the assumption that the initial value is randomly selected.This test can be performed for most generators based on a linear recursion over the two-element field 2, and predicts with high precision for which sample size the generator will be rejected by a classical statistical test called the weight distribution test.This test may be considered as a theoretical version of a one-dimensional random walk test. Differently from the empirical tests which can reject only very bad generators, this test assigns a ranking to generators. Thus it is useful to select good generators, similarly to the spectral tests and the k-distribution tests. This test rejects practically all generators linear over 2 that are known to fail in some physical tests although they pass k-distribution tests.