In software testing, the key to a successful test is a fast and efficient testing-case generation. Genetic algorithm is an algorithm to search for the optimal solution by simulating the natural process of evolution. The algorithm guides the of search direction through the selection, crossover and mutation operations. to reach the global optimal solution step by step. Traditional genetic algorithm is widely used in the test case generation by many scientific researchers due to its better global search ability. But the genetic algorithm can easily lead to convergence to a local optimal solution because of its inherent defects "premature convergence". In order to solve this problem, the author proposed an adaptive genetic algorithm in this paper. The crossover operator and mutation operator of the proposed algoritym can be adjusted automatically according to the change of the program. The improved algorithm is then applied in the test case generation process. The test results show that this algorithm is better than the traditional search algorithm and common improved algorithm in efficiency and effectiveness of testing-case generation.