Sinusoidal gratings made by either the spatial filtering method or holography are used in a Ronchi setup to test lenses and mirrors. The interference between the strong zero-order and two weak first-order wavefronts gives a three-beam Ronchigram in which elliptically shaped moire fringes appear. The ellipses may be used to determine quantitatively the primary aberration, such as the coefficient of spherical aberration, coma, or astigmatism.