Abstract
This work aims to build a semantic framework for automated debugging. A debugging process consists of tracing, locating, and fixing processes consecutively. The first two processes are accomplished by a tracing procedure and a locating procedure, respectively. The tracing procedure reproduces the execution of the failed test case with well-designed data structures and saves necessary information for locating bugs. The locating procedure will use the information obtained from the tracing procedure to locate ill-designed statements and to generate a system of fix-equations, whose solution will be used to fix the bugs. A structural operational semantics is given to define the functions of the tracing and locating procedures. Both of them are proved to terminate. The main task of fixing process is to solve the fix-equations. It turns out that for a given failed test case, there exist four types of fix-equations and three different solutions: 1) The bug is solvable, i.e., there exists a solution of the system of fix-equations, and the program can be repaired. 2) There exists a structural design error in the program, i.e., the system of fix-equations generated at each round of the locating procedure is solvable, but a new bug will arise when the old bug is being fixed. 3) There exists a logical design error, and the system of fix-equations is not solvable.
Similar content being viewed by others
References
Myers G J. The Art of Software Testing. 2nd ed. New York: John Wiley & Sons, Inc., 2004
Hailpern B, Santhanam P. Software debugging, testing and verification. IBM Syst J, 2002, 41: 4–12
Zeller A. Why Programs Fail. 2nd ed. Oxford: Elsevier Inc., 2009
Zhang Y K. Software Debugging. Beijing: Publishing House of Electronics Industry, 2009
Lewis B. Debugging backward in time. In: Proceedings of the 5th International Workshop on Automated and Algorithmic Debugging, Ghent, Belgium, 2003
Weiser M. Program slicing. IEEE Trans Softw Engineer, 1984, 10: 352–357
Misherghi G, Su Z. HDD: hierarchical delta debugging. In: Proceedings of the 28th International Conference on Software Engineering, Shanghai, China, 2006
Plotkin G D. A structural approach to operational semantics. Technical Report DAIMI FN-19. 1981
Li W. R-calculus: An inference system for belief revision. Comput J, 2007, 50: 378–390
Li W. Mathematical Logic: Foundations for Information Science, PCS 25. Basel: Birkhäuser Publisher, 2010
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Li, W., Li, N. A formal semantics for program debugging. Sci. China Inf. Sci. 55, 133–148 (2012). https://doi.org/10.1007/s11432-011-4530-2
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11432-011-4530-2