## 2 Modeling Fault Detection and Fault Correction Processes
### A New Model with Imperfect Debugging and Testing Coverage  
Here we incorporate testing coverage and fault introduction rate into software reliability model. Suppose \(c(t)\) denotes the proportion of the code covered by time \(t\) against the whole code. Obviously, \(c(t)\) increases with testing time \(t\). Firstly, when testing starts, \(c(t)\) grows at a quick rate as more test cases are executed to examine the software; after a certain point in time, the software becomes stable and less testing coverage take place to realize the residual fault detection, and function \(c(t)\) becomes flat when the testing comes to the end. Thus, a concave or S-shaped function can be suitable to model the testing coverage function. Obviously, \((1-c(t))\) is the percentage of the software code which has not yet been covered by test cases up to time \(t\). The derivative of the testing coverage function, \(c^{\prime}(t)\), represents the coverage rate. Therefore, \(c^{\prime}(t)/(1-c(t))\) could be used to measure the fault detection rate \(b(t)\), which is shown in Equation (3). Figure 1: The number of cumulative detected faults and corrected faults for DS-1. Figure 2: The ratio of the number of corrected faults to the number of detected faults for DS-1. To build a model incorporating fault-detection process and fault-correction process as well as fault introduction rate and testing coverage, the following assumptions are proposed for this model:  
1. The software failures' occurrence follows an NHPP process. 2. The software failure rate at any time depends on both the fault detection rate and the number of remaining faults in the software at that time. 3. The fault detection rate can be expressed by \(\frac{c^{\prime}(t)}{1-c(t)};c(t)\) is the percentage of the code that has been examined up to time \(t\), \(c^{\prime}(t)\) is the derivative of the testing coverage function and represents the coverage rate. 4. Faults can be introduced during the debugging phase with a constant fault introduction rate and the overall fault content function is linear time-dependent. 5. \(m_{c}(t)\) denotes the mean value of corrected faults by time \(t\), which is proportional to the mean number of detected but not yet corrected faults remaining in the software system, and \(r(t)\) represents the relationship between \(m(t)\) and \(m_{c}(t)\) expressed by \(r(t)=\frac{m_{c}(t)}{m(t)};m(t)\) is the cumulative detected faults. From Assumption 4, the total fault number function \(a(t)\), is a linear function of the expected fault number detected up to time \(t\). That is,  
\[a(t)=a+\alpha m(t) \tag{5}\]  
where \(a\) denotes the initial fault number presented in the software system before testing starts and \(\alpha>0\). Substituting \(a(t)\) from Equation (5) into Equation (3), and solving it in terms of the initial condition that at \(t=0\), \(m(t)=0\), we can obtain  
\[m(t)=\frac{a}{p-\alpha}\left[1-\left(\frac{1-c(0)}{1-c(t)}\right)^{(\alpha-p) \beta}\right] \tag{6}\]  
where \(c(0)\) refers to the testing coverage function when \(t=0\). From Assumption 5, once \(m(t)\) is determined, \(m_{c}(t)\) can be achieved. That is,  
\[m_{c}(t)=\frac{a}{p-\alpha}\left[1-\left(\frac{1-c(0)}{1-c(t)}\right)^{(\alpha -p)\beta}\right]\cdot r(t) \tag{7}\]  
Substituting different types of testing coverage functions for \(c(t)\) and ratio functions of corrected faults number to detected faults number for \(r(t)\) in Equation (7), we can obtain different MVFs corresponding to them. As mentioned above, the testing coverage function should be a non-negative and non-decreasing function of testing time \(t\). So the following function can be used to model the testing coverage function, that is:  
\[c(t)=\frac{A(1-e^{-rt})}{1+c\mathrm{e}^{-rt}} \tag{8}\]  
where \(A\) denotes the maximum percentage of testing coverage, \(r\) is the shape parameter and \(c\) is the scale parameter. Clearly, when \(t=0\), \(c(0)=0\).