Optimal software release policies, which decide when to stop testing a software system and transfer it to the user, are discussed for a software reliability growth model with nonhomogeneous error detection rate. Two evaluation criteria, i.e. total expected software cost and software reliability, are introduced. The optimal software release policies respectively derived for each criterion and those simultaneously evaluating both criteria are discussed. Numerical examples on those optimal software release policies are presented for illustration.