Localizing the cause(s) of an observable error lies at the heart of program debugging. Fault localization often proceeds by comparing the failing program run with some “successful” run (a run which does not demonstrate the error). An issue here is to generate or choose a “suitable” successful run; this task is often left to the programmer. In this paper, we present an efficient technique where the construction of the successful run as well its comparison with the failing run is automated. Our method constructs a successful program run which is close to the failing run in terms of a distance metric capturing control flow. The distance metric takes into account the sequence of statements executed in the two runs, and not just the set of statements executed. We use the distance metric to locate “similar” branch instances which appear in the failing and successful run with different outcomes. The program statements for such branches are returned as bug report. In our experim...