Locating faults through automated predicate switching

Abstract

Typically debugging begins when during a program execution a point is reached at which an obviously incorrect value is observed. A general and powerful approach to automated debugging can be based upon identifying modifications to the program state that will bring the execution to a successful conclusion. However, searching for arbitrary changes to the program state is difficult due to the extremely large search space. In this paper we demonstrate that by forcibly switching a predicate's outcome at runtime and altering the control flow, the program state can not only be inexpensively modified, but in addition it is often possible to bring the program execution to a successful completion (i.e., program produces the desired output). By examining the switched predicate, also called the critical predicate, the cause of the bug can then be identified. Since the outcome of a branch can only be either true or false, the number of modified states resulting by predicate switching is far less than those possible through arbitrary state changes. Thus, it is possible to automatically search through modified states to find one that leads to the correct output. We have developed an implementation based upon dynamic instrumentation to perform this search through program re-execution -- the program is executed from the beginning and a predicate's outcome is switched to produce the desired change in control flow. To evaluate our approach, we tried our technique on several reported bugs for a number of UNIX utility programs. Our technique was found to be practical (i.e., acceptable in time taken) and effective (i.e., we were able to automatically identify critical predicates). Moreover we show that bidirectional dynamic slices of critical predicates capture the faulty code.

DOI: 10.1145/1134285.1134324

Extracted Key Phrases

14 Figures and Tables

0102030'06'07'08'09'10'11'12'13'14'15'16'17
Citations per Year

233 Citations

Semantic Scholar estimates that this publication has 233 citations based on the available data.

See our FAQ for additional information.

Cite this paper

@inproceedings{Zhang2006LocatingFT, title={Locating faults through automated predicate switching}, author={Xiangyu Zhang and Neelam Gupta and Rajiv Gupta}, booktitle={ICSE}, year={2006} }