Algorithmic debugging for imperative languages with side-effects
Algorithmic debugging is a technique for semi-automatic localization of program errors. So far, this technique has been limited to programs without side-effects, and has only been applied to Prolog programs. In this paper, we generalize the algorithmic debugging method to programs written in imperative languages, e.g. Pascal, which may contain side-effects.
Our method combines program transformation techniques with data flow analysis techniques to achieve this goal. Programs which contain side-effects are transformed or mapped to programs without side-effects. These transformations are guided by data flow analysis results. The conventional procedure level algorithmic debugging technique is used on the transformed or mapped program, but the debugging process is presented to the user in terms of the original program. The model can be extended to statement level debugging. A prototype for a subset of Pascal has been implemented. A larger prototype including transformations is being implemented within the DICE system — a programming environment based on incremental compilation. Currently we restrict ourselves to bug localization for terminating programs. Also, side-effects related to pointers are currently not considered.
- [Drabent, et al-88]Drabent W., Nadjm-Tehrani S. and Maluszynski J., The Use of Assertions in Algorithmic Debugging. Proceeding of the FGCS Conference, Tokyo. 1988, pp.573–581.Google Scholar
- [Fritzson-83]Fritzson P., Symbolic Debugging Through Incremental Compilation in an Integrated Environment. The Journal of Systems and Software 3, 1983, pp.285–294.Google Scholar
- [Kamkar, et al-90]Kamkar M., Shahmehri N. and Fritzson P., Bug Localization by Algorithmic Debugging and Program Slicing. Proceeding of the PLILP'90, Linköping, Sweden. LNCS, Vol 456, pp.60–74.Google Scholar
- [Shahmehri, Fritzson-89]Shahmehri N., Fritzson P., Algorithmic debugging for Imperative Languages with Side-effects, Research Report LiTH-IDA-R-89-49, Linköping University, Sweden, 1989.Google Scholar
- [Shapiro-83]Shapiro E. Y., Algorithmic Program Debugging. MIT press, 1983.Google Scholar