{"id":1545,"date":"2018-11-16T15:49:01","date_gmt":"2018-11-16T15:49:01","guid":{"rendered":"http:\/\/demensdeum.com\/blog\/?p=1545"},"modified":"2024-12-16T22:32:41","modified_gmt":"2024-12-16T19:32:41","slug":"bugs-count-estimation","status":"publish","type":"post","link":"https:\/\/demensdeum.com\/blog\/hi\/2018\/11\/16\/bugs-count-estimation\/","title":{"rendered":"How many mistakes do you have there?"},"content":{"rendered":"<p>On <a href=\"https:\/\/news.ycombinator.com\/\" target=\"_blank\" rel=\"noopener\">Hacker News<\/a> I found a very interesting article in which the author suggests using the Petersen-Lincoln method, which is used by biologists to count the population of birds, monkeys and other animals, to *drumroll* <strong>count bugs<\/strong> in an application.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1550\" src=\"https:\/\/demensdeum.com\/blog\/wp-content\/uploads\/2018\/11\/bigfoot.jpg\" alt=\"\" width=\"554\" height=\"369\" srcset=\"https:\/\/demensdeum.com\/blog\/wp-content\/uploads\/2018\/11\/bigfoot.jpg 1024w, https:\/\/demensdeum.com\/blog\/wp-content\/uploads\/2018\/11\/bigfoot-300x200.jpg 300w, https:\/\/demensdeum.com\/blog\/wp-content\/uploads\/2018\/11\/bigfoot-768x512.jpg 768w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/p>\n<p>A Bug in the Wild &#8211; <a href=\"https:\/\/www.flickr.com\/photos\/loimere\/4667972182\/in\/photostream\/\" target=\"_blank\" rel=\"noopener\">Bigfoot Sighting<\/a> by <a href=\"https:\/\/www.flickr.com\/photos\/loimere\/\" target=\"_blank\" rel=\"noopener\">Derek Hatfield<\/a><\/p>\n<p>The method is very simple, we take two <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9E%D1%80%D0%BD%D0%B8%D1%82%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%8F\" target=\"_blank\" rel=\"noopener\">ornithologists<\/a>, they find birds of a certain species, their task is to determine the population size of these birds. The found birds are marked by both ornithologists, then the number of common ones is calculated, substituted into the Lincoln index formula and we get the approximate population size.<br \/>Now for applications &#8211; the method is also very simple, we take two QA and they find bugs in the application. Let&#8217;s say one tester found 10 bugs (<strong>E1<\/strong>), and the second 20 bugs (<strong>E2<\/strong>), now we take the number of common bugs &#8211; 3 (<strong>S<\/strong>), then according to the formula we get the <strong>Lincoln index<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1552\" src=\"https:\/\/demensdeum.com\/blog\/wp-content\/uploads\/2018\/11\/Screenshot_20181116_191540.png\" alt=\"\" width=\"318\" height=\"79\" srcset=\"https:\/\/demensdeum.com\/blog\/wp-content\/uploads\/2018\/11\/Screenshot_20181116_191540.png 318w, https:\/\/demensdeum.com\/blog\/wp-content\/uploads\/2018\/11\/Screenshot_20181116_191540-300x75.png 300w\" sizes=\"auto, (max-width: 318px) 100vw, 318px\" \/><\/p>\n<p>This is the forecast for the number of bugs in the entire application, in the given example ~66 bugs.<\/p>\n<h3>Swift Example<\/h3>\n<p>I have implemented a test stand to check the method, you can see it here:<br \/><a href=\"https:\/\/paiza.io\/projects\/AY_9T3oaN9a-xICAx_H4qw?language=swift\" target=\"_blank\" rel=\"noopener\">https:\/\/paiza.io\/projects\/AY_9T3oaN9a-xICAx_H4qw?language=swift<\/a><\/p>\n<p>Parameters that can be changed:<\/p>\n<p>let aliceErrorFindProbability = 20 &#8211; percentage of bugs found by QA Alice (20%)<br \/>let bobErrorFindProbability = 60 &#8211; percentage of bugs found by QA Bob (60%)<br \/>let actualBugsCount = 200 &#8211; how many bugs the app actually has<\/p>\n<p>In the last run I got the following data:<br \/>Estimation bugs count: 213<br \/>Actual bugs count: 200<\/p>\n<p>That is, there are 200 bugs in the application, the Lincoln index gives a forecast of -213:<br \/>&#8220;Alice found 36 bugs&#8221;<br \/>&#8220;Bob found 89 bugs&#8221;<br \/>&#8220;Common bugs count: 15&#8221;<br \/>&#8212;<br \/>Estimation bugs count: 213<br \/>Actual bugs count: 200<\/p>\n<h3>Weaknesses<\/h3>\n<p>This method can be used to estimate the number of errors in an application, at all stages of development, <em>ideally, the number of bugs should decrease. <\/em>I can attribute the human factor to the weak points of the method, since the number of bugs found by two testers should be different and <strong><em>different bugs<\/em><\/strong> should be found, however <strong><em>common<\/em><\/strong> should also be found, otherwise the method will not work (zero common bugs &#8211; <em><strong>division by zero<\/strong><\/em>)<br \/>Also, such a concept as <em><strong>common bugs<\/strong><\/em> requires the presence of an expert to understand their <em><strong>commonality.<\/strong><\/em><\/p>\n<h3>Sources<\/h3>\n<p><a href=\"https:\/\/www.johndcook.com\/blog\/2010\/07\/13\/lincoln-index\/\" target=\"_blank\" rel=\"noopener\">How many errors are left to find? &#8211; John D. Cook, PhD, President<\/a><br \/><a href=\"http:\/\/bit-player.org\/2010\/the-thrill-of-the-chase\" target=\"_blank\" rel=\"noopener\">The thrill of the chase &#8211; Brian Hayes<\/a><\/p>\n<h3>Source code<\/h3>\n<p><a href=\"https:\/\/paiza.io\/projects\/AY_9T3oaN9a-xICAx_H4qw?language=swift\" target=\"_blank\" rel=\"noopener\">https:\/\/paiza.io\/projects\/AY_9T3oaN9a-xICAx_H4qw ?language=swift<\/a><br \/><a href=\"https:\/\/gitlab.com\/demensdeum\/statistics\/tree\/master\/1_BugsCountEstimation\/src\" target=\"_blank\" rel=\"noopener\">https:\/\/gitlab.com\/demensdeum\/statistics\/tree\/master\/1_BugsCountEstimation\/src<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On Hacker News I found a very interesting article in which the author suggests using the Petersen-Lincoln method, which is used by biologists to count the population of birds, monkeys and other animals, to *drumroll* count bugs in an application. A Bug in the Wild &#8211; Bigfoot Sighting by Derek Hatfield The method is very<a class=\"more-link\" href=\"https:\/\/demensdeum.com\/blog\/hi\/2018\/11\/16\/bugs-count-estimation\/\">Continue reading <span class=\"screen-reader-text\">&#8220;How many mistakes do you have there?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[61],"tags":[],"class_list":["post-1545","post","type-post","status-publish","format-standard","hentry","category-techie","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"hi","enabled_languages":["en","ru","zh","de","fr","ja","pt","hi"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"ru":{"title":true,"content":true,"excerpt":false},"zh":{"title":true,"content":true,"excerpt":false},"de":{"title":true,"content":true,"excerpt":false},"fr":{"title":true,"content":true,"excerpt":false},"ja":{"title":true,"content":true,"excerpt":false},"pt":{"title":true,"content":true,"excerpt":false},"hi":{"title":false,"content":false,"excerpt":false}}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/demensdeum.com\/blog\/hi\/wp-json\/wp\/v2\/posts\/1545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demensdeum.com\/blog\/hi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demensdeum.com\/blog\/hi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/hi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/hi\/wp-json\/wp\/v2\/comments?post=1545"}],"version-history":[{"count":22,"href":"https:\/\/demensdeum.com\/blog\/hi\/wp-json\/wp\/v2\/posts\/1545\/revisions"}],"predecessor-version":[{"id":3969,"href":"https:\/\/demensdeum.com\/blog\/hi\/wp-json\/wp\/v2\/posts\/1545\/revisions\/3969"}],"wp:attachment":[{"href":"https:\/\/demensdeum.com\/blog\/hi\/wp-json\/wp\/v2\/media?parent=1545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/hi\/wp-json\/wp\/v2\/categories?post=1545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/hi\/wp-json\/wp\/v2\/tags?post=1545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}