The testing and operation environment may be essentially different, thus the fault detection rate of testing is different from that of the operation phase. Software reliability growth models (SRGMs) based on the non-homogeneous Poisson process (NHPP) are quite successful tools that have been proposed to assess the reliability of software. The constant environmental factor is proposed by some authors to describe the mismatch between the testing environment and operation environment in SRGMs of NHPP. Actually, the environmental factor ought to be varying with testing time. The varying environmental factor with time can be derived from actual failure data set. The fault detection rate (FDR) of operation is transformed from that of testing phase and varying environmental factors, considering the fault remove efficiency and fault introduction rate, and then an NHPP model PTEO-SRGM is presented. Finally, the unknown parameters are estimated by the least-squares method based on two failure data sets. Experiments show that the goodness-of-fit and predictive power of PTEO-SRGM is better than those of other SRGMs on these two data sets.