Your programming software should verify the programmed code BEFORE burning the Configuration Fuses (which is the final step in the chip programming cycle).