Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is there some kind of generalization to the effect called Heisenbug? Because I would like to describe in my documentation how instrumenting a program changes the execution no matter what.

In The New Hacker's Dictionary it is defined as following:

heisenbug /hi:'zen-buhg/ /n./ [from Heisenberg's Uncertainty Principle in quantum physics]

A bug that disappears or alters its behavior when one attempts to probe or isolate it. (This usage is not even particularly fanciful; the use of a debugger sometimes alters a program's operating environment significantly enough that buggy code, such as that which relies on the values of uninitialized memory, behaves quite differently.) Antonym of Bohr bug; see also mandelbug, schroedinbug. In C, nine out of ten heisenbugs result from uninitialized auto variables, fandango on core phenomena (esp. lossage related to corruption of the malloc arena) or errors that smash the stack.

Actually this is a general problem, when trying to observe the programs state by instrumentatation (tracing, debugging, etc.) the program execution is changed no matter what. But the definition for Heisenbug clearly says, it is a bug which is masked due to debugging and which disappears. What about bugs, which appear due to debugging - there is no word for that.

Is there some kind of generalization, like Heisenbug principle?

share|improve this question
1  
Are you familiar with the Heisen_berg_ uncertainty principle? –  user1249 Jul 16 '11 at 11:17
    
Yes, Heisenbug is defined on behalf of this definition. You are right, actually this one can be used as generalization. It just seems wrong to use a term from physics. –  platzhirsch Jul 16 '11 at 11:28
4  
What problem are you trying to solve here? If there's not a specific problem then the question is not constructive. –  ChrisF Jul 16 '11 at 14:55
    
I've added the problem I want to solve to my original question. I need the term distinction for documentation purposes. –  platzhirsch Jul 16 '11 at 15:59
1  
If you need it for debugging, how about "this bug only appears when debugging"? Coin a term if you like, but that's overcomplicating it. –  Jonathan Hobbs Jul 17 '11 at 0:50
show 1 more comment

2 Answers

up vote 2 down vote accepted

The term Heisenbug is already a generalization - of some special kinds of bugs which are mentioned in the cited article. The opposite case where an error only occurs during debugging and disappears in normal operation could also be considered a Heisenbug, if we define:

  • A software contains a Heisenbug iff the software produces different results in normal operation and during debugging and one of these results is unintended.
share|improve this answer
add comment

>What about bugs, which appear due to debugging - there is no word for that.

That's an 'artifact'.

(Example: I was debugging some code containing a (known-good) iterator using Microsoft VC++, and I defined in the Watch window n = it.next(), which then caused the iterator to go empty and start throwing weird exceptions. What I didn't realize was that the Watch code was not intelligently called only when I needed to inspect the value, but every debug step, and it didn't cache values and pass them through to the program, so it was depleting my iterator at double-speed.)

>Is there some kind of generalization, like Heisenbug principle?

Not that I'm aware of. Non-determinism, artifacts, sensitivity to external conditions describe this general behavior.

You might like to retitle your question Terminology question: Generalize Heisenbug

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.