This paper presents a software testing method based on the improved simulated annealing algorithm. The main idea of the method is to test the variation program through the program mutation and injecting the known defects into the program under test. By discovering the known defects in programs, we tend to find unknown defects in the original program. The method mainly includes four parts: process variation, designing the initial test case set, using intelligent algorithms to generate test cases and testing adequacy criteria based on the coverage. The core of software testing is to generate test cases automatically. Therefore the simulated annealing intelligent algorithm proposed in this paper will discriminate the sufficiency basing on defect coverage and statement coverage, to ensure the efficiency of test case generation.