Reliability of a software application, its failure intensity and the residual number of faults are three important metrics that provide a quantitative assessment of the failure characteristics of an application. Ultimately, it is also necessary, based on these metrics, to determine an optimal release time at which costs justify the stop test decision. Typically, one of the many stochastic models known as software reliability growth models (SRGMs) is used to characterize the failure behavior of an application to provide estimates of the failure intensity, residual number of faults, reliability, and optimal release time and cost. To ensure analytical tractability, SRGMs assume instantaneous repair and thus the estimates of these metrics obtained using SRGMs tend to be optimistic. In practice, repair activity consumes a non trivial amount of time and resources. Also, repair may be conducted according to many policies which reflect the schedule and budget constraints of a project. A few efforts which incorporate repair into SRGMs are restrictive, since they consider only some SRGMs, model the repair process using a constant repair rate, and provide an estimate of only the residual number of faults. These efforts do not address the issue of estimating the failure intensity, reliability and optimal release time and cost in the presence of repair. In this paper we present a generic framework based on the rate-based simulation technique to incorporate repair policies into finite failure non homogeneous Poisson process (NHPP) class of SRGMs. We describe a methodology to compute the failure intensity and reliability in the presence of repair, and apply it to four popular finite failure NHPP models. We also present an economic cost model which considers explicit repair in providing estimates of optimal release time and cost. We illustrate the potential of the framework to quantify the impact of the parameters of the repair policies on the above metrics using examples. Through these examples we discuss how the framework could be used to guide the allocation of resources to achieve the desired reliability target in a cost-effective manner.