## Optimum Testing Time of Software using Size-Biased Concepts

Ashis Kumar Chakraborty , Parna Chatterjee , Poulami Chakraborty , and Aleena Chanda 1 2 3 4 1,2,3 and 4. Statistical Quality Control and Operations Research Division Indian Statistical Institute Kolkata Kolkata-700108, India 1. akchakraborty123@rediffmail.com 2. parnachatterjee94@gmail.com 3. chakraborty.poulami94@gmail.com 4. aleenachanda03@gmail.com

Abstract -Optimum software release time problem has been an interesting area of research for several decades now. We introduce here a new concept of size-biased modelling to solve for the optimum software release time. Bayesian approach is used to solve the problem. We also discuss about the applicability of the model for a specific data set, though we believe that the model is applicable to all kind of software reliability data collected in a discrete framework. It has applications in other fields like oil exploration also. Finally, we compare favourably our model with another similar model published recently. We also provide in this article some future possibilities of research work.

Index Terms -Optimum software release time, size-biased sampling, Bayesian approach, predictive kernel density, real-life application.

## ACRONYMS

NB denotes Negative Binomial Distribution. Bin denotes Binomial Distribution. DU denotes Discrete Uniform Distribution. MN denotes the Multinomial Distribution.

## NOTATIONS

N j = Cumulative number of runs of the software up to the j th phase , j=1,2, · · · ,m. Note that, N &lt;N &lt; 1 2 · · ·

i.e. N j 's are not independent.

S ij = Eventual size of the i th bug identified in the j th phase , i = 1,2, · · · , n j , where n j is the number of distinct bugs identified upto the j th phase, j = 1,2, · · · ,m s ij = observed size of the i th bug identified in the j th phase ∴ F j = ∑ n j i =1 S ij ; j = 1 2 , , · · · , m i.e. F j is the total eventual size of the n j distinct bugs identified up to the j th phase.

S ( ) t ij : Eventual size of the i th bug at the j th phase in the time point t

S ′ ij : Eventual size of the i th bug at the j th phase that are either accepted or rejected in the Metropolis Hasttings Algorithm A j : ( S , S 1 2 , S 3 , · · · , S j ) , S 0 = 0 = A 0

S j : Total number of bugs detected in the system during the j th phase = ∑ n k i =1 S ij

S ij : Eventual size of the i th bug identified in the j th phase. q ij : Probability of detecting the i th bug in the j th phase. q 0 j : Probability that a bug is not being detected in the j th phase.

## I. INTRODUCTION

Software is to be tested before release in the market so that it carries minimum number of errors while using it. It is known that software testing followed by debugging generally improves the reliability of the software. But, a pertinent question raised is, "When to stop testing software?". Several authors ( Dalal and Mallows(1988)[6] , Singpurwalla(1991)[15], Chakraborty and Arthanari(1994)[4], Chakraborty et. al(2019) [1], Das et. al(2017)[8], Vasanthi et. al(2013)[16],and many others) have explored different ways of optimizing the time for software release.

On the other hand, hundreds of models have been proposed to estimate software reliability at a given point of time based on several different assumptions and circumstances. These, in fact, complicated the decision making process of a software developer for appropriately choosing a software reliability model for use. Dalal (2003) provided a selective survey of such models. It was noticed that, for large and critical software, debugging takes place in certain intervals which necessitated development of several different models (Dewanji et. al (2011) [10], Chakraborty et. al (2019) [1]). For such kind of softwares Nayak(1988) [12], Chakraborty(1996) [2] and a few other authors suggested that software testing data should be collected in a different way in order to get a good estimate of its reliability. Dewanji et. al (2011) [10] explained it as a discrete type of data where the data is logged for each input using which the software is being tested and the output is logged as a binary variable indicating whether the software run results in failure or not. Chakraborty and Arthanari (1994) [4] and Chakraborty et al (2019) [1] calls it a success when the software fails to provide the right output for an input, because the whole idea of testing the software is to find out

as many bugs as possible before it is released in the market. It is known that given an input data, the path that it would take while running the software with the input , is fixed. Whenever, the same input is used, it would traverse the same path and only if there is a bug on that particular path, the given input will be able to detect that bug. If the bug is not on that path, it is not possible to detect it using that particular input. Since testing is carried out with only a finite and relatively smaller number of inputs, it is difficult to imagine how many inputs would go through a particular bug eventually, if the bug is not fixed. The total input space for which the software would be used will never be known exactly, however, if we can get a good estimate of the cardinality of the input space, it may help us to provide a reliability estimate closer to reality.

In this article we introduce a totally new concept in software reliability field and use size-biased sampling concept of Patil and Rao (1978) [13] to provide a good estimate of potential threat to software failure. We use the newly developed methodology on a testing data collected from a commercial software developer.

The article is organized as follows: In section II, we introduce the new concept of the size of a bug for the first time and develop a Bayesian methodology to get an estimate of the original bug sizes. In Section III we briefly discuss the works of several authors who have explored different ways of optimizing the time for software release. Sections IV mainly deals with the model assumptions used in this model. Section V deals with how to find out optimal time for software testing under this new setup. In section VI we discuss about a software testing data of a commercial software developer with the application of the newly developed size-biased concepts discussed in Section V for the data set. We also compare favourably our model with a similar kind of model developed by Vasanthi and Arulmozhi(2013)([16]) in the same section. Further we conclude in Section VII with future directions for research.

## II. SIZE-BIASED CONCEPT FOR SOFTWARE RELIABILITY

The size of a bug is defined as the number of inputs that would have eventually passed through the bug, if the bug were not fixed (Chakraborty(1996) [9]). It is quite natural that a path (in the software) branches into several sub-paths at a later stage. For all these sub-paths, a part of the path is common in the beginning. Imagine that a bug is sitting on the common path and another bug is sitting on one of the several subpaths associated with the common path. It is quite obvious that the size of the bug, present in the common path is much higher compared to that of the bug in the sub-paths, since all inputs collectively going through each of the sub-paths must be traversing through the common path before entering into a sub-path. The size of a bug also thus may give an indication of how quickly a bug could be identified. If a bigger bug is not detected it would create a potential threat to the functioning of the software, even if there is only one bug. It is simple to understand that the probability of detection of a bug (and hence its fixation) depends on the size of the bug.

Larger the size of the bug, larger will be the chance of detecting that bug earlier in the testing phase as has been indicated in Chakraborty and Arthanari(1994) [4]. In fact, Chakraborty and Arthanari(1994) [4] also have shown that similar concepts are applicable in discovering fields with rich hydrocarbon contents in the field of producing oil and natural gas. It is also clear that a bug which exists in a path that will hardly be traversed by any input, will remain harmless as far as the running of the software is concerned. This brings us to the conclusion that reliability of the software does not depend on just the number of bugs remaining in the software, rather it depends on the positioning of the bugs, particularly the paths on which it exist and whether that path is frequently traversed by inputs which are random in nature as per the user (Littlewood B(1979) [11]). Hence in order to have a better model for software reliability, our attention would be to find out the total size of the bugs that will remain and not just the number of remaining bugs.

In a discrete software testing framework, when an input is being tested it results in either a failure or a success (finding an error). Testing of software is carried out into many phases where in each phase a series of inputs are tested and results of each testing are recorded as either a success or a failure. After identifying the bugs at the end of testing within a phase, they are debugged at the end of the phase. This process of debugging is known as periodic debugging or interval debugging[Das et al(2016) [9]].

For testing software, we need to keep in mind certain factors like when we should stop testing, or what will be the criteria of stopping testing etc. If after sufficient testing and debugging most of the bugs remain in the software, then it may result in improper functioning of the software after release in the market. Therefore, a decision to optimize software testing and debugging time is an important part of the development process of software. Even if the number of remaining bugs is smaller, but the total size of the remaining bugs is big, then also the software may fail frequently.

The input space, consisting of all possible inputs to the software can be broadly divided into two subsets of which one consists of all the inputs which will result in a failure (we call it as a success set) and the other subset namely, failure set consists of all the inputs which give expected output. Testing and debugging of bugs consist of several phases in most situations (Dewanji et al) [10]. In real life situations, it is quite difficult to debug every time a bug is found as has been assumed by most software reliability models[1]. It may happen that two inputs have a common path at the beginning due to the presence of some common factors and then each

of the inputs branches off to complete the job.

Assume that, as in Dewanji et al. [10], the process of testing flags off as soon as a bug is found and the process is stopped culminating in recording or logging in an incidence of a success. It is easy to understand that the next bug in the path can be detected only after debugging the bug which is detected earlier. Therefore we can assume that the size of a bug which is present at the beginning of a path is much larger compared to the size of a bug present at the end of a subpath or compared to the bugs present in a path that are hardly traversed by any input.

## III. LITERATURE REVIEW

Dalal and Mallows([6])(1988) posed the problem of stopping time for software testing as a trade-off between the cost of testing and the expected loss incurred in case some faults remain in the software after testing is completed. Chao and Mark([3]) (1993) used a penalty function for the bugs that may remain after the release of the software and modified the cost function to be optimized. Nayak([12])(1988), however, suggested a totally different type of data to be collected in the software field in order to get statistically well interpretable software reliability estimates. His paper also is a prelude to the future software testing data that are in the discrete framework. Chakraborty and Arthanari([4])(1994) used the concept of discrete framework of software testing to decide optimum time for software testing. Dewanji et. al ([10])(2011) considered the ideas provided by Nayak([12])(1988), Chakraborty and Arthanari([4])(1994) and Chakraborty([2])(1996) and developed a model for stopping the testing time of a critical software in order to achieve a stringent reliability target. Chakraborty([2])(1996) also propounded a possible approach using the size of the bugs for which data are to be collected using Nayak's([12]) (1988) concepts. Zachariah([18])(2015) further used the size of the bugs concept of Chakraborty([2]) (1996) and defined failure size, at time 't' as a proportion of the cardinality of the input space for which bugs can be identified and a function of the cardinality of the total input space. The optimization with respect to time for software testing is however carried out on a continuous scale by taking a suitable cost function subject to a constraint which is also made continuous in terms of the 'failure size' at time t.

It was noted by Chakraborty and Arthanari ([4])(1994), Dewanji et. al([10])(2011) and many others that for critical software the testing data generated are discrete type and unlike most other software reliability models, the debugging takes place in intervals and not immediately after detecting a fault. This is true for large commercial software as well. Das et.al([8])(2017) considered several situations under interval debugging and found optimal testing time for software, though their cost function does not include testing cost exclusively. Dalal and Mallows(2008)([5]) considered exact confidence on the remaining number of bugs when software testing is completed. Chakraborty et. al([1]) (2019) extended the model of Chakraborty and Arthanari([4]) (1994)by dropping a very important assumption of immediate debugging after detecting a fault. The idea behind the dropping of the assumption is that most of the large commercial and critical software are debugged after some known or unknown intervals. Vasanthi and Arulmozhi([16]) (2013) considered a Bayesian approach to determine the phase till which debugging is needed, such that the probability of detecting any faults after that review is close to 0. They considered Bayesian probability theory to analyze the software reliability model with multiple types of faults. The probability that all faults are detected and corrected after a series of independent software tests and correction cycles is presented. The authors tried to find out the phase, where no class of fault remains in the software system. In this model, the different types of errors have been grouped as class(1), class(2), · · · ,class(k). In the data described in Section 7, we have classified the errors into three classes as: Simple, Complex, Medium. The faults detected in the present review or phase are corrected before starting the next phase. This model has been defined as a discrete time Markov chain model, where a Bayesian approach has been incorporated. The Bayesian approach in this model treats population model parameters as random variables following some distributions. Also, previous information is used to construct a prior model for these parameters. Vasanthi and Arulmozhi considered the prior distribution for the j th phase as P j -1 ( v A | j -1 ) , where, P j ( v A | j ) = conditional probability that after j phases v faults remain undetected given that the data A j has been observed.

The likelihood that S j bugs are detected in the j th phase is taken to be MN S ( 1 j , S 2 j , S 3 j , · · · , S n j j ; S j ; q 1 j , q 2 j , q 3 j , · · · , q mj , q 0 j ) .

The posterior probability of v given A j is :

$$\begin{smallmatrix} \mu \mu \\ \intertext { \text{ion} } & P _ { j } ( v | A _ { j } ) = \frac { P _ { j - 1 } ( S _ { j } + v | A _ { j - 1 } ) S } { \sum _ { r = 0 } ^ { \infty } P _ { j - 1 } ( r + S _ { j } | A _ { j - 1 } ) S ^ { \prime } } } \\ \text{be}, & \end{smallmatrix}$$

S= MN S ( 1 j , S 2 j , S 3 j , ...

..., S

n j

j

;

S

j

;

q

1

j

, q

2

j

, q

3

j

, ..., q

S

′

=

MN S

..., S

(

1

n j

j

, r

j

, S

2

j

, S

;

S

j

+ ;

r

3

j

q

1

j

,

· · ·

, q

2

j

mj

, q

, q

0

j

j

3

)

, ..., q

k

+1

j

, q

0

j

)

P

0

(

v A

|

0

)

= P(m).

The authors have taken the prior probability that after j phases, v faults remain undetected as Binomial Distribution. By inductive hypothesis, it follows that:

$$\text{a where}, & \text{a} p _ { j - 1 } = \frac { p _ { j - 2 } \times q _ { 0 } j - 1 } { 1 - p _ { j - 2 } \sum _ { i = 1 } ^ { n _ { k } } q _ { i j - 1 } }, \\ \text{a} q _ { j - 1 } = \frac { \sum _ { i = 1 } ^ { n _ { k } } q _ { i j - 1 } } { 1 - p _ { j - 2 } \sum _ { i = 1 } ^ { n _ { k } } q _ { i j - 1 } }, \\ \text{b} n = \sum _ { j = 1 } ^ { n _ { j } } n _ { j } \\ \text{and} \ p _ { 1 } + q _ { 1 } = 1. & \text{a}$$

$$\text{type and\quad } & \text{By inductive hypothesis, it follows that:} \\ \text{bugging} \quad & P _ { j - 1 } ( v \, | \, A _ { j - 1 } ) \quad = \quad \binom { n - S _ { 1 } - \dots S _ { j - 1 } } { v } p _ { j - 1 } ^ { v } q _ { j - 1 } ^ { n - S _ { 1 } - \dots S _ { j - 1 } - v }, \\ \text{ecting a\quad where,} \\ \text{ell. Das\quad } & p _ { j - 1 } = \frac { p _ { j - 2 } \times q _ { 0 } \, j - 1 } { \cup ^ { n } _ { k } \, _ { j } },$$

Therefore, for the j th review, assuming the prior probability as P j -1 ( v A | j -1 ) :

-

S

-

...S

j

n

-

S

1

-

S

2

-

...S

j

-

v

j

P j ( v A | j ) = ( n -S 1 -S 2 -...S j v ) ( p j -1 q 0 j 1 -p j -1 ∑ n k i =1 q ij ) v × ( q j -1 1 -p j -1 ∑ n k i =1 q ij ) n -S 1 -S 2 -...S j -v with, p j = p j -1 q 0 j 1 -p j -1 ∑ n k i =1 q ij , q j = q j -1 1 -p j -1 ∑ n k i =1 q ij . P j ( v A | j ) = ( n -S 1 v ) The problem is to find the j th phase for which P j ( v A | j ) → 1 , ∀ j=1,2,...,m. All the aforementioned works as well as other existing works have not taken into consideration the fact that the probability of detection of a bug depends on the size of the bug. To address this issue we introduce the concept of size- biased sampling in our paper. Despite all these attempts, the optimum time for testing software remains an interesting problem to the researchers. In this article we provide a completely new way of modeling the phenomena by taking recourse to size-biased sampling indicated by Chakraborty ([2])(1996).

p q

v

2

j

.

## IV. MODEL ASSUMPTIONS

It is assumed that whenever an input finds out a bug in the first instance, it signals a success indicating that a bug is found. The testing group will then possibly try out with a different input. It is to be noted that the software industry spends about 50-60% of its development cost for testing alone. The aim of the testing group is to find out as many bugs as possible during testing itself, so that the released software will have high reliability.

In a path when a bug is identified by an input for the first time it can be defined as level 1 bug. It is reasonable to assume that in a path level 1 bugs will be identified first, if that path is traversed by an input selected for testing. After debugging in each phase the level 1 bugs identified during that phase would be debugged. In a subsequent phase, if another input is chosen which traverses the same path and identifies another bug in the path, then that bug is called as level 2 bug and so on. Our objective is to find out optimally when to stop testing the software using interval debugging and the concepts of size of a bug.

We assume that, if we continue testing till all the bugs are identified and debugged, we need m phases of testing where in each phase N i , i=1,2, · · · ,m inputs will be used. We also assume that all the bugs that are identified in a particular phase are debugged before the start of a new phase. Let us suppose that, the software company has testing data up to the k th phase. This means the bugs are detected and debugged only up to the k phases. In general, it is expected that the number of distinct bugs identified in the k th phase shall be greater than that in the ( k +1) th phase. Further, it is also expected that, the total size of the bugs should decrease as debugging is carried through the phases provided that the group of testers is efficient. The problem now boils down to, given some /epsilon1 , however small, stop testing after l phases, where l satisfies the condition that the total eventual size of the bugs after l phases of testing and debugging is less than /epsilon1 . This, in a way would ensure that after l th phase of testing, the software has achieved certain reliability as prescribed by the customer.

## V. THE MODEL

Our main objective is to estimate the total eventual size of the remaining bugs after each phase in order to determine the optimal time for testing. If the predicted value of the total eventual size of the bugs in the j + 1 th phase becomes less than /epsilon1 , fixed earlier, then we should stop at the j th phase itself.

Now estimating the remaining size of bugs is a difficult proposition. It is next to impossible to get exact value of the total eventual size of the bugs up to the final (eventual) phase. So, we will try to find an estimate of the total eventual size of the bugs for each phase and stop at that phase when the total predicted eventual size of the bugs for the very next phase is very small.

$$\log \text{ in the } \begin{array} { c } \text{$\text{Let us assume that $N_{j}|N_{1},N_{2},\cdots,N_{j-1},F_{1},F_{2},\cdots,F_{j-1} \sim$} \\ \text{$g_{N_{j}|N_{1},N_{2},\cdots,N_{j-1},F_{1},F_{2},\cdots,F_{j-1} (N_{j}).$} \\ \text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text	$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text
$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text  $\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{	$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\font$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text}$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text#$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text`$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text<$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text'$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text.$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text1$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text51$\text$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{\text{
$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\$$$

It is to be noted, as discussed in Section II, that the bugs situated at the beginning of the path are expected to have higher probability of detection compared to the bugs that are towards the end of a path. Hence, the mass function h will be modified according to the size of the bug.

h Sij ( s ij ) = f S ij ( s ij ) × s ij E f ( S ij ) , where f Sij ( s ij ) is the original distribution of the size of bug.

The likelihood function of S ij is given by

L S

(

1

j

, S

2

j

,

· · ·

, S

nj

|

N , N , N ,

1

2

3

· · ·

, N

m

)

, N

j = ∏ m j =1 g N j | N , N , 1 2 · · · The posterior distribution of S ij ; i=1,2,.., n j ;j=1,2,...,m is given by: π S 1 j ,S 2 j ,...,S nj j ( S 1 j , S 2 j , ..., S nj j | N , N , ..., N 1 2 m )

j

-

1

, F

1

, F

2

,

· · ·

, F

j

-

1

(

N

j

)

which is proportional to

L S ( 1 j , S 2 j , ....., S nj j | N , N , N , .., N 1 2 3 m ) ∏ n j i =1 h Sij ( s ij ) . If the posterior distribution has a closed form, then the estimate for total eventual size of the bugs in a phase can be obtained from the posterior distributions using Gibbs Sampling, But if the posterior distribution does not have a closed form, then Metropolis Hastings algorithm has to be used in order to obtain the estimates. We now consider various distributional choices for N j and S ij .

## A. Distributional Choices

N j is the cumulative number of runs that would lead to F j , i.e. the total eventual size of n j distinct bugs identified up to the j th phase.

Let N 1 ∼ NB F , p ( 1 1 )

$$N _ { 2 } | N _ { 1 }, F _ { 1 } \sim N B ( F _ { 2 } - F _ { 1 }, p _ { 2 } ) & \quad B. \text{cho} \\ \text{In} \ \text{general}, \ N _ { k } | N _ { 1 }, N _ { 2 }, \cdots, N _ { k - 1 }, F _ { 1 }, F _ { 2 }, \cdots, F _ { k - 1 } \quad & \sim \ \text{The c} \\ N B ( F _ { k } - \sum _ { i = 1 } ^ { k - 1 } F _ { i }, p _ { k } ) \\ \text{and} \quad N _ { m } | N _ { 1 }, N _ { 2 }, \dots, N _ { m - 1 }, F _ { 1 }, F _ { 2 }, \cdots, F _ { m - 1 } \quad & \sim \ \text{argument} \\ N B ( F _ { m } - \sum _ { i = 1 } ^ { m - 1 } F _ { i }, p _ { m } ) & \quad & \ \text{rich enc} \\ \text{necessary} \ \text{use} \ \text{Hie} \\ \ \text{The likelihood function} \ ( S _ { 1 i }, S _ { 2 i }, \cdots, S _ { n _ { i } }, p _ { 1 }, p _ { 2 }, \cdots, p _ { m } ) & \text{robustne}$$

The likelihood function ( S 1 j , S 2 j , · · · , S n j j , p 1 , p 2 , · · · , p m ) is of given by:

$$& \text{is of given by: } & \text{ bugs.} \\ & L ( S _ { 1 j }, S _ { 2 j },.., S _ { n j j }, p _ { 1 }, p _ { 2 }, p _ { 3 },.., p _ { m } | N _ { 1 }, N _ { 2 }, N _ { 3 },.., N _ { m } ) \\ & \quad = \binom { N _ { 1 } + F _ { 1 } - 1 } { N _ { 1 } } p _ { 1 } ^ { N _ { 1 } } ( 1 - p _ { 1 } ) ^ { F _ { 1 } } \times \binom { t _ { i j } } { p _ { j } } \sim B \\ & \binom { N _ { 2 } + F _ { 2 } - F _ { 1 } - 1 } { N _ { 2 } } p _ { 2 } ^ { N _ { 2 } } ( 1 - p _ { 2 } ) ^ { F _ { 2 } } \times \text{ Now } \alpha _ { j } \\ & \quad \left ( N _ { 3 } + F _ { 3 } - F _ { 2 } - F _ { 1 } - 1 \right ) p _ { 3 } ^ { N _ { 3 } } ( 1 - p _ { 3 } ) ^ { F _ { 3 } } \times \dots \times \\ & \left ( N _ { m } + F _ { m } - \sum _ { i = 1 } ^ { m - 1 } F _ { i } - 1 \right ) p _ { m } ^ { N _ { m } } ( 1 - p _ { m } ) ^ { F _ { m } - \sum _ { i = 1 } ^ { m - 1 } F _ { i } } \quad \text{ and } \\ & \quad \text{(1)} \quad V a r ( 1 } \\ & \text{Our objective is to find out that phase for which the total}$$

Our objective is to find out that phase for which the total size of the bugs is less than a very small given quantity /epsilon1 . In other words, our objective is to determine k-1 for which ∑ n k i =1 S ik &lt; ε , i= 1,2, · · · where ε &gt; 0 is a very small quantity. Since the likelihood function is of complex form estimating S ij becomes difficult in general. Hence, for simplicity we consider three different distributions for the size of the bugs and use Bayesian technique to estimate the total eventual size of the bugs in different phases. These three distributions have been mainly chosen on the basis that size of the bugs always takes non negative integer values. Consideration of the Binomial distribution as the distribution of the size of the bugs is justifiable based on the fact that the appearance of a bug may be termed as a success in a sequence of independent trials and not detecting a bug in a trial maybe considered as a failure(Chakraborty and Arthanari)(1994)([4]). Further, since the size of the bugs can be theoretically large and they are non-negative integers, the distributional choices for the size of bugs can also be taken to follow Negative Binomial or Poisson distribution.

With each one of the target distributions given above, we consider three choices of proposal distributions where the support of each of these distributions is (0, ∞ ) which covers the support of S ij . The three choices of proposal distributions are as follows : 1. Geometric Distribution, 2. Negative Binomial Distribution, 3. Poisson Distribution. As a result, altogether nine combinations of distributions can be formed. However, in this article we describe the combination where the distributional choice of the size of bugs is taken as Binomial and the proposal distribution is taken as Poisson, since this combination gives highest rate of convergence compared to the others.

## B. Choice of Prior

The choice of prior should always be justifiable based on arguments. On the other hand, the prior information is rarely rich enough to define a prior distribution exactly. So, it is necessary to include this uncertainty in the model. We will use Hierarchical Bayes' Analysis in order to improve the robustness of the estimates of the total eventual size of the bugs.

$$S _ { i j } \sim \text{Bin} ( n _ { i j } \,, \, t _ { i j } ) \ ; \, i = 1, 2, \cdots, \, n _ { j } \ ; \, j = 1, 2, \cdots \, \text{m.}$$

Let us assume,

t

ij

∼

Beta a

(

ij

, b ij

)

,

where a ij

and b ij

are known

.

p

j

∼

Beta α

(

j

,

β

j

)

,

j

= 1 2

,

,

· · ·

, m.

Now α j and β j are unknown, so we estimate them as follows. We know,

$$E \left ( p _ { j } | \alpha _ { j } \,, \, \beta _ { j } \right ) \, = \, \frac { \alpha _ { j } } { \alpha _ { j } + \beta _ { j } } \, = \, \mu _ { j }, \, s a y \, \quad ( 2 )$$

and

$$( 1 ) \quad V a r ( p _ { j } | \alpha _ { j }, \, \beta _ { j } ) \, = \, \frac { \alpha _ { j } \beta _ { j } } { ( \alpha _ { j } + \beta _ { j } ) ^ { 2 } ( \alpha _ { j } + \beta _ { j } + 1 ) } \, = \, \sigma _ { j } ^ { 2 } \ \ ( 3 )$$

where, µ j ∼ U(0 , 1) and σ 2 j | µ j ∼ U(0 , µ j (1µ j ) ).

The estimates of α j and β j are obtained by solving Equations (2) and (3), i.e.

F j = ∑ n i =1 S ij ; j = 1,2, · · · , m. Here n is unknown, so we assume,

$$\text{entity}. \begin{array} { c } ( 2 ) \text{ and } ( 3 ), i. e. \\ \text{a} _ { j } = \mu _ { j } [ \frac { \mu _ { j } ( 1 - \mu _ { j } ) } { \sigma _ { j } ^ { 2 } } - 1 ] \text{ and } \widehat { \beta } _ { j } = \frac { \widehat { \alpha } _ { j } } { \mu _ { j } } ( 1 - \mu _ { j } ). \\ \text{ly we} \\ \colon \text{bugs} \\ \text{there} \, n \text{ is unknown, so we assume}, \end{array}$$

n ∼ DU(1, 2, · · · , k), where k is fixed.

The mass function of

n

ij is

defined as ,

n

ij

=

m

ij

,

with probability

∑

m

ij

m

j

=1

m

ij

.

## C. Posterior Distributions

The joint posterior distribution under the above setup is

$$\text{pemac} \quad \text{The joint posterior distribution under the above setup is} \\ \text{ered as a} \\ \text{ery, since} \\ \text{they are} \quad \begin{pmatrix} \pi ( A | B ) \in \begin{pmatrix} N _ { 1 } + F _ { 1 } - 1 \\ N _ { 1 } \end{pmatrix} p _ { 1 ^ { N _ { 1 } } } ^ { N _ { 1 } } ( 1 - p _ { 1 } ) ^ { 1 - F _ { 1 } } \times \\ \text{$\text{Paisson} \quad \begin{pmatrix} N _ { 2 } + F _ { 2 } - F _ { 1 } - 1 \\ N _ { 2 } \end{pmatrix} p _ { 2 ^ { N _ { 2 } } } ^ { N _ { 2 } } ( 1 - p _ { 2 } ) ^ { F _ { 2 } - F _ { 1 } } \times \cdots \times \\ \text{bove, we} \quad \begin{pmatrix} N _ { m } + F _ { m } - \sum _ { i = 1 } ^ { m - 1 } F _ { i } - 1 \\ N _ { m } \end{pmatrix} p _ { m } ^ { N _ { m } } ( 1 - p _ { m } ) ^ { F _ { m } - \sum _ { i = 1 } ^ { m - 1 } F _ { i } \times \\ \text{there the} \quad \begin{pmatrix} m \\ \prod _ { i = 1 } ^ { m } p _ { i } ^ { \alpha _ { i - 1 } } ( 1 - p _ { i } ) ^ { \beta _ { i - 1 } } \prod _ { i = 1 } ^ { n } s _ { i j } \begin{pmatrix} n _ { i j } \\ s _ { i j } \end{pmatrix} t _ { i j } ^ { s _ { i j } } ( 1 - t _ { i j } ) ^ { n _ { i j } - s _ { i j } } ( 4 ) \\ \text{distrib-} \\ \text{Negative} \quad \text{where} \\ \text{a result,} \quad A = S _ { 1 j }, S _ { 2 j }, \cdots, S _ { n _ { i j } }, p _ { 1 }, p _ { 2 },.., p _ { m }, t _ { 1 j }, t _ { 2 j }, \cdots, t _ { n j }, n _ { 1 j }, n _ { 2 j }, \cdots, n _ { n j } \end{pmatrix}$$

where

A= S 1 j , S 2 j , · · · , S n j j , p 1 , p 2 , .., p m , t 1 j , t 2 j , · · · , t nj , n 1 j , n 2 j , · · · , n nj B= N , N , 1 2 · · · , N m , α 1 , α 2 , · · · , α m , β 1 , β 2 , · · · , β m The posterior of p i is given by :

$$\text{omial} \quad \pi _ { p _ { i } } ( p _ { i } | S _ { 1 j }, S _ { 2 j }, \cdots, S _ { n _ { j } j } N _ { 1 }, N _ { 2 }, \cdots, N _ { m }, \alpha _ { 1 }, \alpha _ { 2 },.. \\ \text{ed to} \quad \dots, \alpha _ { m }, \beta _ { 1 }, \beta _ { 2 }, \cdots, \beta _ { m } ) \\ \quad \in p _ { i } ^ { N _ { i } + \widehat { \alpha _ { i } } - 1 } ( 1 - p _ { i } ) ^ { F _ { i } - \sum _ { j = 1 } ^ { i - 1 } F _ { j } + \widehat { \beta _ { i } } - 1 } \quad ( 5 )$$

The posterior of t ij is given by :

$$\pi _ { t _ { i j } } ( t _ { i j } | N _ { 1 }, N _ { 2 }, \dots, N _ { m }, a _ { i j }, b _ { i j }, s _ { i j }, n _ { i j } ) \\ \in \, t _ { i j } ^ { s _ { i j } + a _ { i j } - 1 } ( 1 - t _ { i j } ) ^ { n _ { i j } - s _ { i j } + b _ { i j } - 1 } \quad \quad ( 6 ) \quad \text{the} \,.$$

The posterior of S ij is given by :

where C= S 1 j , S 2 j , · · · , S n j j D= N , N , 1 2 · · · , N m , α 1 , α 2 , · · · , α m , β 1 , β 2 , · · · · · · , β m , t 1 j , t 2 j , · · · , t nj , n 1 j , n 2 j , · · · , n nj · · ·

$$\begin{array} { l } \text{The posterior of $S_{ij}$ is given by $\colon$} & \text{Our $ot$} \\ \pi _ { S _ { 1 j }, S _ { 2 j }, \cdots, S _ { n j } ( C | D ) \ominus \binom { N _ { 1 } + F _ { 1 } - 1 } { N _ { 1 } } \times \sum _ { i = 1 } ^ { n _ { k } } S _ { i j } } \\ \left ( N _ { 2 } + F _ { 2 } - F _ { 1 } - 1 \right ) \times \cdots \binom { N _ { m } + F _ { m } - \sum _ { i = 1 } ^ { m - 1 } F _ { i } - 1 \right ) } { N _ { m } } & \text{phase, esti becomes $\c$} \\ \times ( 1 - t _ { i j } ) ^ { n _ { i j } - s _ { i j } } ( 1 - p _ { 1 } ) ^ { F _ { 1 } } ( 1 - p _ { 2 } ) ^ { F _ { 2 } - F _ { 1 } } ( 1 - p _ { 3 } ) ^ { F _ { 3 } - F _ { 2 } } } & \text{called Pred} \\ \times \cdots ( 1 - p _ { m } ) ^ { F _ { m } - \sum _ { i = 1 } ^ { m - 1 } F _ { i } } \times \prod _ { i = 1 } ^ { n } s _ { i j } \binom { n _ { i j } } { s _ { i j } } t _ { i j } ^ { s _ { i j } } & ( 7 ) \\ \end{array} \right ) \\ \text{where} \, C = S _ { 1 j }, S _ { 2 j }, \cdots, S _ { n _ { j j } } & \text{D. Predicti} \\ D = N _ { 1 }, N _ { 2 }, \cdots, N _ { m }, \alpha _ { 1 }, \alpha _ { 2 }, \cdots, \alpha _ { m }, \beta _ { 1 }, \beta _ { 2 }, \cdots }$$

Since, the posterior distribution of S ij , i=1,2, · · · , n j ; j=1,2, · · · ,m does not have a closed from, we apply Metropolis Hastings Algorithm to get estimates of S ij .

The algorithm is as follows:

Step 1 ©

Initialize the starting state S ( ) t ij at t = 0.

Step 2 ©

$$\underset { \mu } { \overset { \bullet } { \underset { \mu } { \sim } } } \, \underset { \mu } { \overset { \bullet } { \text{Draw a sample $S^{\prime}_{ij}$ from the proposal $q(S^{\prime}_{ij}|S^{\left(t)}_{ij}$)} } }$$

Step 3 ©

Decide whether we should accept the new state by computing α which is given by,

$$\alpha & \text{ with is given } \nu, \\ \alpha & = \frac { \pi _ { s ^ { \prime } _ { i j } } ( s ^ { ^ { \prime } _ { i j } } ( s ^ { ^ { \prime } _ { i j } } _ { i j } | s ^ { ^ { \prime } _ { i j } } ) } { \pi _ { s ^ { ( t ) } _ { i j } } ( s ^ { ^ { \prime } _ { i j } } ) \, q ( s ^ { ^ { \prime } _ { i j } } | s ^ { ^ { \prime } _ { i j } } ) } \\ \text{Accent the new state with } \colon$$

Accept the new state with a probability of:

A S

(

′

( )

t

ij

|

S

ij

) =

min

(1

, α

)

,

i.e.

- a © Generate a uniform random number u /epsilon1 (0,1)

$$\begin{array} { l } \mathfrak { C } \circ \text{max a uniform random number} \, \infty \, \infty, \infty \\ \mathfrak { C } \, \text{If } u \leqslant A ( S ^ { ^ { \prime } } _ { i j } | S ^ { ( t ) } _ { i j } ), \, t h e n \, S ^ { ( t + 1 ) } _ { i j } = S ^ { ^ { \prime } } _ { i j } \\ \mathfrak { C } \, \text{If } u > A ( S ^ { ^ { \prime } } _ { i j } | S ^ { ( t ) } _ { i j } ), \, t h e n \, S ^ { ( t + 1 ) } _ { i j } = S ^ { ( t ) } _ { i j } \\ \mathfrak { C } \, \text{Sched } \mathfrak { C } \, \dots \, \mathfrak { C } \, \infty \, \dots \, \infty \, \dots \, \end{array}$$

Repeat Steps b © and c © until convergence.

Since the support of Poisson distribution is (0 , ∞ ) which covers the support of S ij , we take Poisson to be our proposal distribution, i.e. q S ( ij ) = e -λ ij λ s ij ij s ij !

Here,

$$\nu ^ { \prime } \quad & s _ { i j } \quad & \sin \\ \alpha = \left ( \frac { G } { H } \right ) \quad & \quad & \quad ( 8 ) \quad & \sin \\ \quad & \quad & \text{inc} \\ \text{bas} \quad & \text{$\quad$}$$

where, G= λ s ( t ) ij s ′ ij ! ( N 1 + F ′ 1 -1 N 1 ) (1 -p 1 ) F ′ 1 ( N 2 + F ′ 2 -F ′ 1 -1 N 2 ) × (1 -p 2 ) F ′ 2 -F ′ 1 .... ( N m + F ′ m -∑ m -1 i =1 F ′ i -1 N m ) (1 -p m F ) ′ m -∑ m -1 i =1 F ′ i × ∏ n i =1 s ′ ij ( n ij s ′ ij ) t s ′ ij ij (1 -t ij ) n ij -s ′ ij H = λ s ′ ij s ( ) t ij ! ( N 1 + F ( t ) 1 -1 N 1 ) (1 -p 1 ) F ( t ) 1 ( N 2 + F ( t ) 2 -F ( t ) 1 -1 N 2 ) × (1 -p 2 ) F ( t ) 2 -F ( t ) 1 .... ( N m + F ( t ) m -∑ m -1 i =1 F ( t ) i -1 N m ) ×

$$( 1 - p _ { m } ) ^ { F _ { m } ^ { ( t ) } - \sum _ { i = 1 } ^ { m - 1 } F _ { i } ^ { ( t ) } } \prod _ { i = 1 } ^ { n } s _ { i j } ^ { ( t ) } \binom { n _ { i j } } { s _ { i j } ^ { ( t ) } } t _ { i j } ^ { s _ { i j } ^ { ( t ) } } \left ( 1 - t _ { i j } \right ) ^ { n _ { i j } - s _ { i j } ^ { ( t ) } } \\ \quad \text{The estimates of the total eventual size of the bugs in each}$$

The estimates of the total eventual size of the bugs in each phase obtained are given in Table II in section VI.

Our objective is to determine k-1 for which ∑ n k i =1 S ij &lt; ε,i = 1 2 , , ....n k where ε &gt; 0 is a very small quantity.If information is not available for a particular phase, estimates of the size of the bugs for that phase becomes complicated. We employ here a predictive method called Predictive Kernel Density Estimation Method, in order to obtain the estimates of the size of the bugs at later phases.

## D. Predictive KDE

In order to estimate the total size of the bugs for the phase for which no information is available, we consider temporally weighted kernel density models (Porter and Reich(2012))([14]). The temporally weighted kernel is given by :

̂ 1) Choice of Kernel: Since the total size of the bugs cannot be negative and can take any value between (0, ∞ ) we choose K(u;h) as the isotropic 2D Gaussian Kernel, i.e.

̂ f s t ( | ) = ∑ t j =1 w j ( ) t .K ( || S -S j || ; h ) where t is the number of past phases and w j ( ) t is the weight of the the j th phase at time t. We take w j ( ) t &gt; 0; j=1,2, · · · ,m and ∑ t j =1 w i ( ) t =1 ,such that ∫ f ( s t | ) ds = 1 .

$$\mathfrak { K } ( u ; n ) & \, \text{$neqiso$+op$} \, 2 D \\ K _ { h } ( u ) & = \frac { 1 } { 2 \pi h ^ { 2 } } e ^ { - \frac { u ^ { 2 } } { 2 h ^ { 2 } } }. \\ \text{$Also. since the exact time $f$}$$

Also, since the exact time for which the j th event, namely j th phase, takes place is not known, we take a time window for the event j to be [ v , η j j ]. The weight is thus given by:

$$& \text{ne event } J \, \text{to be } [ v _ { j }, \eta _ { j } ]. \text{ ne weight is thus given by} \colon \\ & w _ { j } ( t ) \, \infty \, E [ g ( t - t _ { j } ) ] \\ & = \frac { 1 } { \eta _ { j } - v _ { j } } \int _ { v _ { j } } ^ { \eta _ { j } } g ( t - u ) d u. \\ & = & \frac { 1 } { \eta _ { j } - v _ { j } } [ G ( t - v _ { j } ) - G ( t - \eta _ { j } ) ], \, \text{where } g ( t - t _ { j } ) \, \text{ is a temporal} \\ & \text{kernel and } G ( u ) \, \text{ is the cumulative distribution function of}$$

i

=1

∑ 2) Bandwidth Selection: A distance measure considered between ˆ f and f and termed as Integrated Squared Error (ISE) is given by, j j kernel and G(u) is the cumulative distribution function of g(u).Here v j is the the earliest possible time and η j is the latest possible time for the event j. Thus, S j falls within the time interval [ v , η j j ] ; j=1,2, · · · ,m. We choose the exponential distribution as the temporal weighting function due to its simplicity and familiarity and to emphasize that it is a onesided (predictive) Kernel since the phase numbers are always increasing and cannot be negative. The j th event is predicted based on the estimates of the previous j-1 events. Hence, for a given bandwidth h ,the prospective kernel estimate of the conditional density for the total eventual bug size for the j th phase is estimated on the basis of the following criterion: S k -1 &gt; S k where S k = n k S ij .

## d 1 ( h ) = ∫ ( ˆ f h -f ) 2 ( x dx )

= ∫ ˆ f h 2 ( x dx ) -2 ∫ ( ˆ f h f )( x dx ) + ∫ f 2 ( x dx ) Note that, f 2 ( x ) does not depend on h.Further, we observe that ∫ ( ˆ f h f )( x dx ) = E X [ ˆ ( f h X )] , where the expectation is understood to be computed with respect to an additional and independent observation X. For estimation of this term define the leave one out estimate,

E X [ ˆ ( f h X )] = n -1 n ˆ f h,i ( X i ) ,

/negationslash where f h,i ( X i ) is an estimate based on the subset { X j } j = i Using this estimate we determine a bandwidth h minimizing, CV h ( ) = ∫ ˆ f h 2 ( x dx ) -2 n n -1 ∑ n i =1 ˆ f h,i ( X i )

∑ i =1 ˆ

## VI. APPLICATION

A. Data

The data set consists of 8757 test inputs detailed with build number , case id, severity, cycle, result of test, defect id etc. In this data, the severity of a path is broadly divided into three categories namely, simple, medium and complex depending on the effect of the bug if it is not debugged before marketing the software. The data has four cycles namely Cycle 1, Cycle 2, Cycle 3 and Cycle 4, which is equivalent to the different phases of testing we have referred to section III. After each cycle, the bugs that are identified during the cycle are debugged as mentioned in the section III. If during testing of a software no bug is found then the results are stated as 'executed successfully', but if there is a bug identified during testing then the results are divided into several categories viz. functionality, blocked, deferred, fail, no run and not in scope. Functionality means the bug, if not corrected would affect some functions in the software, whereas blocked, deferred etc. are characteristics of a bug which indicates the possible actions to be taken by the software developers in that particular cycle. If the defect header of two bugs are same it means that those two bugs are generated from the same source with different Id. However, we are interested only with the observed size of the bugs that has gone through a particular defect Id in a particular cycle. Hence, the original data is summarized in a form of the cycle number , defect header, defect Id along with the number of inputs. A sample of the data thus collected is given in table 1. From these data the estimates of the population size for each identified bug is calculated using the methodology developed in section V.

TABLE I A SAMPLE FROM THE DATA

|   Cycle |   Defect Header |   Defect id |   Size |
|---------|-----------------|-------------|--------|
|       1 |               2 |           3 |      1 |
|       1 |               5 |           6 |      3 |
|       1 |               5 |           7 |     13 |
|       2 |              13 |          31 |      2 |
|       2 |              15 |          31 |     16 |
|       3 |              14 |          10 |      1 |
|       3 |              23 |           4 |      8 |
|       3 |              25 |           2 |      1 |
|       4 |               5 |          13 |      4 |
|       4 |              42 |           4 |      2 |

B. Results

TABLE II ESTIMATESOF THE TOTAL EVENTUAL SIZE OF THE BUGS

## IN EACH PHASE

|   PHASE | TOTAL EVENTUAL SIZE   |
|---------|-----------------------|
|       1 | 34007                 |
|       2 | 36157                 |
|       3 | 57738                 |
|       4 | 11409                 |
|       5 | 6 . 9 × 10 - 10       |

Using the Predictive Kernel density Estimation technique the total eventual size of the bugs in the fifth phase has been estimated to be 6 9 . × 10 -10 which is approximately equal to 0. Hence, according to the data one can consider the fourth phase to be the optimal testing time of software,that is one can stop the process of debugging in the fourth phase itself. It can also be noticed that there is an increase in the total eventual size of the bugs from the first to the second phase as well as from the second to the third phase. This goes against our assumption. Another noticeable thing is that, this increase in size from the second to the third phase is very high . It is not guaranteed that whenever an input passes through the path a bug will always be detected (Success). Hence, though the number of inputs provided in the second phase is more than that in the third phase , it may so happen that the inputs in the third phase may have passed through the paths on which the bugs were present, whereas in the second phase the inputs may have traversed through the paths where bugs were not present. Thus, the estimate of total eventual size of the bugs have increased sharply from the second to the third phase, even though the number of inputs were less.

This possibly shows that the testing group is getting more and more experienced as the number of phase increases as is expected. Further, on comparing the proposed model with the model proposed by Vasanthi and Arulmozhi(2013),

using Bayes' Factor it has been found out that our model is approximately 67% times better.

## VII. CONCLUSION

In this article, we propose a completely new approach for solving the problem of determining optimal time for software release. The approach of size-biased sampling seems to be more realistic and is based on the concepts of Patil and Rao(1978). Since, the theoretical solution for the estimates of S ij does not have a closed form, we propose to take recourse to some specific distributions of the parameters and solve the problem using Bayes' Method.

The proposed approach is applied to a software testing data of a large commercial software. Our approach is also compared with a similar approach proposed by Vasanthi and Arulmozhi(2013). It is shown that our proposed model works better 67% times out of a trial run of 10,000 and the Relative MSE also is comparatively less (0.61 % ) for our proposed model. Thus, it can be said that the proposed size-biased model is quite efficient.

Finding out reliability of the software when it is ready for release under the present set up is an interesting work that we are looking into.

## REFERENCES

- [1] A.K. Chakraborty, G.K. Basak, and S. Das, "Bayesian optimum stopping rule for software release", DOI no : 10.1007/s12597-018-00353-0,2019.
- [2] A.K. Chakraborty, "Software Quality Testing and Remedies", PhD thesis, 1996.
- [3] A. Chao and C.K. Mark, "Stopping Rules and Estimation for Recapturing Debugging with Unequal Failure Rates". Biometrika , vol. 80, no. 1, pp. 193-201, 1993.
- [4] A.K. Chakraborty and T.S. Arthanari, "Optimum testing time for software under an exploration model", Opsearch,vol. 31, pp. 202-214, 1994.
- [5] S.R. Dalal and C.L. Mallows, "Optimal Stopping With Exact Confidence on Remaining Defects",Technometrics,vol. 50, no. 3, pp. 397-408, 2008.
- [6] S.R. Dalal and C.L. Mallows, "When should one stop testing software?", Journal of the American Statistical Association, vol. 83, no. 403, pp. 872-879, 1988.
- [7] S.R. Dalal, "Software reliability models: A selective survey and new directions", in Handbook of Reliability Engineering, ed. H. Pham, London: Springer, pp. 201-2011, 2003.
- [8] S. Das, D. Sengupta, and A. Dewanji, "Optimum release time of a software under periodic debugging schedule", Communications in StatisticsSimulation and Computation, pp. 1-19, 2017.
- [9] S. Das, A. Dewanji, and A.K. Chakraborty, "Software Reliability Modeling with Periodic Debugging Shedule". IEEE Transactions On Reliability, vol. 65, no. 3, pp. 1449-1456, 2016.
- [10] A. Dewanji, D. Sengupta, and A.K. Chakraborty, " A discrete time model for software reliability with application to a flight control software", Applied Stochastic Models in Business and Industry, vol. 27, pp. 723731, 2011.
- [11] B. Littlewood,"Software Reliability Model for modular program structure", IEEE Transactions on Reliability, vol. 28, no. 3, pp. 241-246, 1979.
- [12] T.K. Nayak, "Estimation of Population Size by recapture sampling", Biometrika, vol. 75, no. 1, pp. 113-120, 1988.
- [13] G.P. Patil and C.R. Rao, "Weighted Distributions and Size-Biased Sampling with Applications to Wildlife Populations and Human Families", Biometrics vol. 34, no. 2, pp. 179-189, 1978.
- [14] M.D. Porter, and B.J. Reich, "Evaluating temporally weighted kernel density methods for predicting the next event location in a series", Annals of GIS,vol. 18, no. 3, pp. 225-240, 2012.
- [15] N.D. Singpurwalla, "Determining an optimal time interval for testing and debugging software", IEEE Transactions on Software Engineering,vol. 17, no. 4, pp. 313-319, 1991.
- [16] T. Vasanthi and G. Arulmozhi, "Software reliability estimation using Bayesian approach",International Journal of Quality &amp; Reliability Management, vol. 30, no. 1,pp. 97-107, 2013.
- [17] B. Zachariah, "Analysis of Software Testing Strategies Through Attained Failure Size",IEEE Transactions On Reliability, vol. 61, no. 2, pp.569579, 2012.
- [18] B. Zachariah,"Optimal stoping time in software tetsing based on failures size approach",Ann Oper Res, vol. 235, pp. 771-784, 2007.
- [19] B. Zachariah and R.N. Rattihalli,"Failure Size Proportional Models and an Analysis of Failure Detection Abilities of software Testing Strategies, IEEE Transactions On Reliability, vol. 56, no. 2, pp.246-253, 2007.
Ashis Kumar Chakraborty Parna Chatterjee Poulami Chakraborty Aleena Chanda
Optimum Testing Time of Software using Size-Biased Concepts
Optimum software release time problem has been an interesting area of
research for several decades now. We introduce here a new concept of
size-biased modelling to solve for the optimum software release time. Bayesian
approach is used to solve the problem. We also discuss about the applicability
of the model for a specific data set, though we believe that the model is
applicable to all kind of software reliability data collected in a discrete
framework. It has applications in other fields like oil exploration also.
Finally, we compare favourably our model with another similar model published
recently. We also provide in this article some future possibilities of research
work.