With the development of computer application, reliability plays an important role. In this paper, an optimal testing strategy is put forward. At first, a Markov usage model is built up. Second, the testing strategy is described concretely, which includes input data classification, generation of test case and testing strategy. At last, a new method of software reliability estimation is studied, which based on path probability. In order to verify the method effectivity, the emulation experiment is done.