Using gpower, I would like to calculate the sample size to validate a bug fix.
There is a software bug that appears in 3 out of 1000 test runs. I would like to validate a bug fix so that it doesn't appear within a degree of confidence.
My question is what kind of "test family" do I choose for that? I am a bit overwhelmed by the number of choices. Also, when trying the different test families I seem to never enter the failure rate (0.003) which is crucial to make the prediction right?
I can enter the following parameters
- power of 0.80
- alfa / err prob of 0.05
- effect size of 0.2
For fun, I also asked chatgpt for an answer and it gave back a sample size that does take into account the failure rate of 0.003
n = (Zbeta + Zalpha)^2 * (p1 * (1 - p1) + p2 * (1 - p2)) / (p1 - p2)^2
Plugging in the values, we get:
n = (0.84 + 1.96)^2 * ((0.003 * (1 - 0.003)) + (0 * (1 - 0))) / (0.003 - 0)^2
n = 1472.39
Thanks for setting up this beginner! I would like to master gpower a bit better for my daily work. If gpower isn't suited for this at all that would be an answer as well :)
Update 20230416
I think I can now zoom in on a better question. Given that a test fails 3 out of 1000, what is the chance it fails 0 out of 1000? And then, what is the chance it fails 99% of the time 0 out of 1000?
So the question is more: How do I prove that the previous failure rate has gone? Rather then to prove my bugifx is perfect since you can't prove perfection in a limited time.