Shotgun debugging
It is proposed that this article be deleted because of the following concern:
If you can address this concern by improving, copyediting, sourcing, renaming, or merging the page, please edit this page and do so. You may remove this message if you improve the article or otherwise object to deletion for any reason. Although not required, you are encouraged to explain why you object to the deletion, either in your edit summary or on the talk page. If this template is removed, do not replace it. This message has remained in place for seven days, so the article may be deleted without further notice. Find sources: "Shotgun debugging" – news · newspapers · books · scholar · JSTOR Nominator: Please consider notifying the author/project: {{subst:proposed deletion notify|Shotgun debugging|concern=Term is a neologism with no clear definition and no sources apart from the Jargon File}} ~~~~ Timestamp: 20130815222623 22:26, 15 August 2013 (UTC) Administrators: delete |
Shotgun debugging is a process of making relatively undirected changes to software in the hope that a bug will be perturbed out of existence. This almost never works except in very simple programs, or when used as an attempt to work around programming language features that one may be using improperly; it usually introduces more bugs[citation needed]. These undirected, random changes can, however, cause more symptoms to occur, which assists in locating (and therefore fixing) problems.
Examples
Shotgun debugging can occur when working with multi-threaded applications. Attempting to debug a race condition by adding debugging code to the application is likely to change the speed of one thread in relation to another and could cause the problem to disappear. This is known as a Heisenbug. Although apparently a solution to the problem, it is a fix by pure chance and anything else that changes the behaviour of the threads could cause it to resurface — for example on a computer with a different scheduler. Code added to any part of the program could easily revert the effect of the "fix".
This article is based in part on the Jargon File, which is in the public domain.