We shall consider the hypothesis of randomness under which two samples $X_1, \cdots, X_n$ and $Y_1, \cdots, Y_m$ have an identical but arbitrary continuous distribution. The vector of ranks $(R_1, \cdots, R_{n+m})$ will be shown to be asymptotically sufficient in the Bahadur sense for testing randomness against a general class of two-sample alternatives, simple ones as well as composite ones. In other words, the best exact slope will be attainable by rank statistics, uniformly throughout the alternative.