The random walk hypothesis, i.e., no predictability, is equivalent to the assumption that that stock (log) prices are generated by a model of the form: P_t = P_{t-1} + µ + e_t, where µ is a constant, and {e_t} are i.i.d. random variables. A key implication of this model is that the variance of (P_t - P_s) is linear in the lag between t and s (as {e_t} are i.i.d.). Therefore, the random walk hypothesis can be tested by comparing variance estimates of price increments over different observation intervals.
The Lo and MacKinlay variance-ratio test uses the fact that the variance of the increments in a random walk is linear in the sampling interval. Hence, if the natural logarithm of the stock price follows a random walk, then the return variance should be proportional to the return horizon. E.g., Chang, KP and KS Ting, 2000, A variance ratio test of the random walk hypothesis for Taiwan's stock market, Applied Financial Economics 10 (5), 525-532.