Observations $y_i$ are made at points $x_i$ according to the model $y_i = F(x_i) + e_i$, where the $e_i$ are independent normals with constant variance. In order to decide whether or not $F(x)$ is constant, a likelihood ratio test is constructed, comparing $F(x) \equiv \mu$ with $F(x) = \mu + Z(x)$, where $Z(x)$ is a Brownian motion. The ratio of error variance to Brownian motion variance is chosen to maximize the likelihood, and the resulting maximum likelihood statistic $B$ is used to test departures from constant mean. Its asymptotic distribution is derived and its finite sample size behavior is compared with five other tests. The $B$-statistic is comparable or superior to each of the tests on the five alternatives considered.
"An Omnibus Test for Departures from Constant Mean." Ann. Statist. 18 (3) 1340 - 1357, September, 1990. https://doi.org/10.1214/aos/1176347753