We introduce an algorithm for wavefront fitting of interfero- grams with Zernike polynomials. The algorithm is based on a singular value decomposition (SVD). SVD is superior to other reconstruction algorithms to some extent. We also introduce the optimum Zernike mode number. With the optimum number of modes, wavefronts can be expressed more exactly. The F-test has been widely used in many fields, and we introduce it to optical wavefront analyzing. We also do computer simulations of this algorithm.