Let $X_1, X_2, \cdots, X_n$ be independent identically distributed random variables defined on the unit interval. The generalized $j$th orthogonal component is defined as $V_{nj} = n^{-\frac{1}{2}} \sum^n_{i = 1} d_j(X_i),$ where $\{1, d_1, d_2, \cdots\}$ is an orthonormal basis for $\mathscr{L}_2(\lbrack 0, 1\rbrack).$ These statistics are a generalization of the orthogonal components of the Cramer-von Mises statistic [2]. Linear combinations of the $V_{nj}$ are applied to the problem of testing the null hypothesis of a uniform distribution against the alternative density $p_n(x) = 1 + h(x)/n^\frac{1}{2} + k_n(x)/n$ where $h(x)$ is square integrable and $k_n(x)$ is dominated by a square integrable function. When $a_j = \int h(x) d_j(x) dx,$ tests based on $\sum^m_{j = 1} a_j V_{nj}$ are shown to be asymptotically most powerful as $\min (m, n) \rightarrow \infty.$ The asymptotic power and efficiency of these tests are computed. A procedure is developed for choosing among possible density functions when a goodness-of-fit test rejects the null hypothesis.