{"id":404,"date":"2016-10-13T09:19:11","date_gmt":"2016-10-13T09:19:11","guid":{"rendered":"http:\/\/waynenguyen.org\/dev\/?p=404"},"modified":"2016-10-13T09:19:11","modified_gmt":"2016-10-13T09:19:11","slug":"strategies-to-debug-irreproducible-bugs-or-heisenbugs","status":"publish","type":"post","link":"https:\/\/bruceng.com\/dev\/?p=404","title":{"rendered":"Strategies to debug irreproducible bugs, or Heisenbugs"},"content":{"rendered":"<p>If the code in question involves concurrency, check if there is a potential for deadlocks which occurs infrequently and hard to track.<\/p>\n<p>Check for other factors: network conditions, equipment quality, environment, bugs originated from OSes or third party libraries.<\/p>\n<p>Add sufficient loggings to the code in case the bug appears again by detecting the bug&#8217;s behaviour, so that in the future if it appears again you will have something to track it.<\/p>\n<p>Add a notification mechanism to notify you when the bug appears again, similar to previous point.<\/p>\n<p>Forget about it for a while and work on other tasks, so that you can look at it from another angle later.<\/p>\n<p>Have another person with fresh eyes to look at the code and give new ideas on what might cause it.<\/p>\n<p>Pass many different inputs to the code with many edge cases to see if the bug can be reproduced, might be very time consuming and not effective, but can try.<\/p>\n<p>If it doesn&#8217;t appear again and you have no idea how to reproduce it, maybe it&#8217;s okay to just ignore it for the time being.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If the code in question involves concurrency, check if there is a potential for deadlocks which occurs infrequently and hard to track. Check for other factors: network conditions, equipment quality, environment, bugs originated from OSes or third party libraries. Add sufficient loggings to the code in case the bug appears again by detecting the bug&#8217;s &hellip; <a href=\"https:\/\/bruceng.com\/dev\/?p=404\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Strategies to debug irreproducible bugs, or Heisenbugs&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[38],"class_list":["post-404","post","type-post","status-publish","format-standard","hentry","category-problems","tag-debugging"],"_links":{"self":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=404"}],"version-history":[{"count":1,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/404\/revisions"}],"predecessor-version":[{"id":405,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/404\/revisions\/405"}],"wp:attachment":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}