Phase Diversity (PD) technology estimates both the wave frant phase and object by two focused and defocused images with known phase .The basic principles of wavefront sensing based on phase diversity method are expatiated, and the genetic algorithm is proposed in the data post processing of phase diversity testing aiming at dealing with the multi variables, the highly nonlinearity, the Unconstrained condition and large amounts of calculation of merit function.Computer simulations are used to validate the algorithms and techniques, as the results show that this GA based method can effectively recover wavefront phases and object.An image restoration and wave front detection sensor by using PD technology was designed.The sensor shows that this Phase Diversity technology can improve image quality .