Estimating the number of bugs

How to estimate the number of bugs in a software deploy
Rstats
Gestão
Author
Published

November 2, 2022

Consider the following situation:

For a software version 3 different testers found each one a different number of bugs in the system, but a total of 10 different bugs.

Tester 1 found bugs number 1, 2, 3, 4, and 5.

Tester 2 found bugs number 3, 5, 6, and 7 (two of the same bugs of Tester1, plus two other bugs not found by Tester 1).

Tester 3 found bugs 1, 3, 5, 8, 9, and 10.

Consider each bug is equally difficult/easy to be found.

The 3 testers worked in an independent way. And they are equally efficient.

How many bugs could we estimate exist in this version of the system?


To solve this question let’s use the Mark and Capture strategy for estimation of populations as described by (Wikipedia n.d.).

library(Rcapture)

bugs <- matrix(c(1,1,1,1,1,0,0,0,0,0,
                 0,0,1,0,1,1,1,0,0,0,
                 1,0,1,0,1,0,0,1,1,1), 
               ncol = 3)

closedp(bugs)

Number of captured units: 10 

Abundance estimations and model fits:
              abundance  stderr deviance df    AIC    BIC    infoFit
M0                 13.1     3.1    6.781  5 23.614 24.219         OK
Mt                 12.9     3.0    6.128  3 26.961 28.172         OK
Mh Chao (LB)       26.3    20.9    2.472  4 21.305 22.213 warning #1
Mh Poisson2       115.9   237.3    2.472  4 21.305 22.213 warning #1
Mh Darroch        696.0  2253.0    2.472  4 21.305 22.213 warning #1
Mh Gamma3.5      4565.3 19853.4    2.472  4 21.305 22.213 warning #1
Mth Chao (LB)      25.6    20.0    1.708  2 24.541 26.053 warning #1
Mth Poisson2      113.6   232.5    1.708  2 24.541 26.053 warning #1
Mth Darroch       699.7  2266.0    1.708  2 24.541 26.053 warning #1
Mth Gamma3.5     4714.8 20515.0    1.708  2 24.541 26.053 warning #1
Mb                 16.7    13.7    6.526  4 25.359 26.267         OK
Mbh                 1.0    13.6    5.751  3 26.584 27.795 warning #1

We can estimate a number of 13 + 3 * stderr bugs, which is approximately 22 bugs.

Reference

Wikipedia. n.d. “Mark and Recapture.” Accessed November 2, 2022. https://en.wikipedia.org/wiki/Mark\_and\_recapture.

Citation

BibTeX citation:
@misc{abreu2022,
  author = {Abreu, Marcos},
  title = {Estimating the Number of Bugs},
  date = {2022-11-02},
  url = {https://abreums.github.io/posts/2022-11-02-estimating-number-of-bugs/},
  langid = {en}
}
For attribution, please cite this work as:
Abreu, Marcos. 2022. “Estimating the Number of Bugs.” November 2, 2022. https://abreums.github.io/posts/2022-11-02-estimating-number-of-bugs/.