In this study, we analyze the uncertainty in an optical testing system using a Shack-Hartmann sensor for a wavefront measurement device. The main uncertainty sources of the optical testing system are the electrical noise of the ShackHartmann sensor and the wavefront deformation due to the image relay optics and the pinhole source. Using a homemade high-precision plane-wave source as a reference, we calibrate the optics of the system and the ShackHartmann sensor itself. It is found that that the error due to the image relay optics installed between the test lens and the Shack-Hartmann sensor is 0.030 λ (RMS). By warming up the Shack-Hartmann sensor for about 1 hour, the measurement values are stabilized to within 0.001 λ (RMS). After calibrating the optical testing system with the reference source, overall uncertainty in the optical testing system is reduced to 0.009 λ (RMS). Performance of the optical testing system is evaluated by measuring the wavefront errors of various optical components, such as a numerical aperture (NA) 0.25 aspheric lens and a digital video disc (DVD) pick up lens.