Shotgun debugging

related topics
{math, number, function}
{system, computer, user}
{theory, work, human}
{car, race, vehicle}
{disease, patient, cell}
{ship, engine, design}
{math, energy, light}

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. These undirected, random changes can, however, cause more symptoms to occur, which assists in locating (and therefore fixing) problems.

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. 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.

Full article ▸

related documents
Object-oriented programming language
Facade pattern
Structure and Interpretation of Computer Programs
Wikipedia:Free On-line Dictionary of Computing/X - Z
Unix billennium
Super-Poulet number
Inductive logic programming
Ninety-ninety rule
Numbering plan
Classical logic
Gauss–Markov process
Cypherpunk anonymous remailer
Wilhelm Ackermann
August Ferdinand Möbius
Mathematical constants (sorted by continued fraction representation)
Type 1 encryption
Principle of least astonishment
Vladimir Voevodsky
Code word
Spaced repetition
National Center for Biotechnology Information