Phase Diversity (PD) technology estimates both the wavefrant 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 postprocessing 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 GAbased method can effectively recover wavefront phases and object.An image restoration and wavefront detection sensor by using PD technology was designed.The sensor shows that this Phase Diversity technology can improve image quality .