Shotgun debugging
Encyclopedia
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
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 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
Race condition
A race condition or race hazard is a flaw in an electronic system or process whereby the output or result of the process is unexpectedly and critically dependent on the sequence or timing of other events...

 by adding debugging code to the application is likely to change the speed of one thread
Thread (computer science)
In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

 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
Scheduling (computing)
In computer science, a scheduling is the method by which threads, processes or data flows are given access to system resources . This is usually done to load balance a system effectively or achieve a target quality of service...

. Code added to any part of the program could easily revert the effect of the "fix".
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK