Consider a heteroscedastic regression model Y = m(X) + s(X) e, where m(X) = E(Y vertical bar X) and sigma(2)(X) = Var(Y vertical bar X) are unknown, and the error e is independent of the covariate X. We propose a new type of test statistic for testing whether the regression curve m(.) belongs to some parametric family of regression functions. The proposed test statistic measures the distance between the empirical distribution function of the parametric and of the nonparametric residuals. The asymptotic theory of the proposed test is developed, and the proposed testing procedure is illustrated by means of a small simulation study and the analysis of a data set.