TEM studies of the strain relaxation driven by lattice mismatch between a film and substrate has been carried out on GaAsN and GaP films grown on (100) GaAs by molecular beam epitaxy. The nature of the defects produced was shown to be directly related to the nature of the surface developed during growth of these compounds. In general, when the surface of the film is smooth, strain relaxation occurred by cracking, while in films with a rough surface relaxation occurred by twinning or by formation of perfect dislocations. The results are discussed in the context of available models for strain relaxation in epitaxial films.