Can bugs be there and not there at the same time? The analogy to Heisenberg's uncertainty principle admittedly falls a bit short; #Heisenbugs are more like bedbugs - you notice the symptoms, but it's hard to locate the actual bug. We're providing a formal framework for reasoning about causes of Heisenbugs, which hopefully will make this task easier in the future.

A formalization of Heisenbugs and their causes in terms of hyperproperties - Software and Systems Modeling
The already challenging task of identifying the cause of a bug becomes even more cumbersome if those bugs disappear or change their behavior under observation. Such bugs occur in a range of contexts including elusive concurrency bugs as well as unintended system alterations during debugging and—as a pun on the name of Werner Heisenberg—are often referred to as Heisenbugs. Heisenbugs can be caused by various sources of nondeterminism on different system levels, many of which developers and testers might not even be aware of. This paper provides formal foundations for rigorously reasoning about causes of Heisenbugs. It provides a formal definition of Heisenbugs in terms of a hyperproperty and introduces a framework for determining the causality of Heisenbugs in presence of multiple candidate causes based on said hyperproperty. We analyze the properties of causes and the implications on practical causal analyses. We provide two small case studies and a taxonomy of potential causes of Heisenbugs.
