Skip to main content
Log in

Dynamic Query-Based Debugging of Object-Oriented Programs

  • Published:
Automated Software Engineering Aims and scope Submit manuscript

Abstract

Program errors are hard to find because of the cause-effect gap between the instant when an error occurs and when the error becomes apparent to the programmer. Although debugging techniques such as conditional and data breakpoints help in finding errors in simple cases, they fail to effectively bridge the cause-effect gap in many situations. This paper proposes two debuggers that provide programmers with an instant error alert by continuously checking inter-object relationships while the debugged program is running. We call such tool a dynamic query-based debugger. To speed up dynamic query evaluation, our debugger implemented in portable Java uses a combination of program instrumentation, load-time code generation, query optimization, and incremental reevaluation. Experiments and a query cost model show that selection queries are efficient in most cases, while more costly join queries are practical when query evaluations are infrequent or query domains are small. To enable query-based debugging in the middle of program execution in a portable way, our debugger performs efficient Java class file instrumentation. We call such debugger an on-the-fly debugger. Though the on-the-fly debugger has a higher overhead than a dynamic query-based debugger, it offers additional interactive power and flexibility while maintaining complete portability.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  • Anderson, E. 1995. Dynamic visualization of object programs written in C++. Objective Software Technology Ltd., http://www.objectivesoft.com.

  • Blakeley, J.A., Larson, P.-A., and Tompa, F. Wm. 1986. Efficiently updating materialized views. In Proceedings of the ACM SIGMOD Conference on Management of Data, Washington, DC, USA, May 1986. Published as SIGMOD Record 15(2):61–71.

    Google Scholar 

  • Brown, M.H. 1988. Exploring algorithms using Balsa-II. IEEE Computer, 21(5):14–36.

    Google Scholar 

  • Brown, M.H. 1991. Zeus: A system for algorithm animation and multi-view editing. In Proceedings of IEEE Workshop Visual Languages, IEEE CS Press, Los Alamitos, CA, pp. 4–9.

    Google Scholar 

  • Bruegge, B. and Hibbard, P. 1983. Generalized path expressions: A high level debugging mechanism. Journal of Systems and Software, 3:265–276.

    Google Scholar 

  • Buneman, O.P. and Clemons, E.K. 1979. Efficiently monitoring relational databases. ACM Transactions on Database Systems, 4(3):368–382.

    Google Scholar 

  • Consens, M.P., Hasan, M.Z., and Mendelzon, A.O. 1994. Debugging distributed programs by visualizing and querying event traces. Applications of Databases, First International Conference, ADB-94, Vadstena, Sweden, In Proceedings in Lecture Notes in Computer Science, vol. 819, Springer.

  • Consens, M., Mendelzon, A., and Ryman, A. 1992. Visualizing and querying software structures. In International Conference on Software Engineering, Melbourne, Australia, ACM Press, IEEE Computer Science, pp. 138–156.

  • Coplien, J.O. 1994. Supporting truly object-oriented debugging of C++ programs. In Proceedings of the 1994 USENIX C++ Conference, Cambridge, MA, USA, Berkley, CA, USA: USENIX Assoc, pp. 99–108.

    Google Scholar 

  • De Pauw, W., Helm, R., Kimelman, D., and Vlissides, J. 1993. Visualizing the behavior of object-oriented systems. In Proceedings of the 8th Annual ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 1993, Washington, DC, USA, SIGPLAN Notices, 28(10):326–337.

    Google Scholar 

  • De Pauw, W., Lorenz, D., Vlissides, J., and Wegman, M. 1998. Execution patterns in object-oriented visualization. In Proceedings of the Fourth USENIX Conference on Object-Oriented Technologies and Systems, Sante Fe, NM, USA, USENIX Association, pp. 219–234.

  • Ducassé, M. 1999. Coca: An automated debugger for C. In Proceedings of the 21st International Conference on Software Engineering (ICSE), Los Angeles, CA, pp. 504–513.

  • Duncan, A. and Hölzle, U. 1999. Load-Time Adaptation: Efficient and Non-Intrusive Language Extension for Virtual Machines, Technical Report TRCS99–09.

  • Eisenstadt, M. 1997. My hairiest bug war stories. Communications of the ACM, 40(4): 30–38.

    Google Scholar 

  • Ferguson, H.E. and Berner, E. 1963. Debugging systems at the source language level. Communications of the ACM, 6(8):430–432.

    Google Scholar 

  • Gamma, E., Weinand, A., and Marty, R. 1989. Integration of a programming environment into ET++-A case study. In Proceedings ECOOP'89 (Nottingham, UK), pp. 283–297, S. Cook, editor, Cambridge University Press: Cambridge.

    Google Scholar 

  • Golan, M. and Hanson, D.R. 1993. Duel-A very high-level debugging language. In USENIX Association. Proceedings of the Winter 1993 USENIX Conference, San Diego, CA, Berkley, CA, USA: USENIX Assoc, pp. 107–117.

    Google Scholar 

  • Gosling, J., Joy, B., and Steele, G. 1996. The Java Language Specification, Addison-Wesley.

  • Hao, M.C., Karp, A.H., Waheed, A., and Jazayeri, M. 1995. VIZIR: An integrated environment for distributed program visualization. In Proceedings of the Third International Workshop on Modeling, Analysis, and Simulation of Computer and Telecommunication Systems, MASCOTS'95, Durham, NC, USA, pp. 288–292.

  • Hart, D., Kraemer, E., and Roman, G.-C. 1997. Interactive visual exploration of distributed computations. In Proceedings of the 11th International Parallel Processing Symposium, Geneva, Switzerland, pp. 121–127.

  • Java™ 2 SDK Production Release. 1999. http://www.sun.com/solaris/.

  • Keller, R. and Hölzle, U. 1998. Binary component adaptation. In ProceedingsECOOP'98, SpringerVerlag, Lecture Notes on Computer Science, Brussels, Belgium.

  • Kessler, P. 1990. Fast breakpoints: Design and implementation. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation 1990, Published as SIGPLAN Notices, 25(6):78–84, ACM Press.

    Google Scholar 

  • Kimelman, D., Rosenburg, B., and Roth, T. 1994. Strata-various: Multi-layer visualization of dynamics in software system behavior. In Proceedings of Visualization'94, IEEE, pp. 172–178.

  • Laffra, C. and Malhotra, A. 1994. HotWire: A visual debugger for C++. In Proceedings of the USENIX C++ Conference, Usenix Association, pp. 109–122.

  • Laffra, C. 1997. Advanced Java: Idioms, Pitfalls, Styles and Programming Tips, Prentice Hall, pp. 229–252.

  • Lange, D.B. and Nakamura, Y. 1997. Object-oriented program tracing and visualization. IEEE Computer, vol. 30, no.5, pp. 63–70.

    Google Scholar 

  • Lencevicius, R. 2000a. Advanced Debugging Methods, Kluwer Academic Publishers.

  • Lencevicius, R. 2000b. On-the-fly query-based debugging with examples. In Proceedings of the Fourth International Workshop on Automated Debugging (AADEBUG 2000), pp. 55–68.

  • Lencevicius, R., Hölzle, U., and Singh, A.K. 1997. Query-based debugging of object-oriented programs. In Proceedings of OOPSLA'97, Atlanta, GA, Published as SIGPLAN Notices, 32(10):304–317.

    Google Scholar 

  • Lencevicius, R., Hölzle, U., and Singh, A.K. 1999. Dynamic query-based debugging. In Proceedings of the 13th European Conference on Object-Oriented Programming'99, (ECOOP'99), Lisbon, Portugal, Published as Lecture Notes on Computer Science 1628, Springer-Verlag.

  • Liang, S. and Bracha, G. 1998. Dynamic class loading in the JavaTM virtual machine. In Proceedings of OOPSLA'98, Vancouver, Published as SIGPLAN Notices, 33(10):36–44.

    Google Scholar 

  • Litman, D., Mishra, A., and Patel-Schneider, P.F. 1997. Modeling dynamic collections of interdependent objects using path-based rules. In Proceedings of OOPSLA'97, Atlanta, GA, Published as SIGPLAN Notices, 32(10):77–92.

    Google Scholar 

  • Meyer, B. 1988. Object-Oriented Software Construction, Prentice-Hall, pp. 111–163.

  • Roman, G.-C. et al. 1992. Pavane: A system for declarative visualization of concurrent computations. Journal of Visual Languages and Computing, 3(2):161–193.

    Google Scholar 

  • Roman, G.-C. and Cox, K.C. 1993. A taxonomy of program visualization systems. IEEE Computer, 26(12): 11–24.

    Google Scholar 

  • Sefika, M., Sane, A., and Campbell, R.H. 1996. Architecture-oriented visualization. In Proceedings ofOOPSLA'96, San Jose, CA. Published as SIGPLAN Notices, 31(10):389–405.

    Google Scholar 

  • Standard Performance Evaluation Corporation. 1998. SPEC JVM98 Benchmarks, http://www.spec.org/osg/jvm98/.

  • Stasko, J. 1990. TANGO: A framework and system for algorithm animation. IEEE Computer, 23(9):27–39.

    Google Scholar 

  • Wahbe, R., Lucco, S., and Graham, S.L. 1993. Practical data breakpoints: Design and implementation. In Proceedings of ACMSIGPLAN Conference on Programming Language Design and Implementation, Albuquerque, ACM Press.

  • Walker, R.J., Murphy, G.C., Freeman-Benson, B., Wright, D., Swanson, D., and Isaak, J. 1998. Visualizing dynamic software system information through high-level models. In Proceedings of OOPSLA'98, Vancouver, Published as SIGPLAN Notices, 33(10):271–283.

    Google Scholar 

  • Weinand, A. and Gamma, E. 1994. ET++-A portable, homogenous class library and application framework. In Computer Science Research at UBILAB, Strategy and Projects. Proceedings of the UBILAB Conference'94, Zurich, Switzerland, W.R. Bischofberger and H.-P. Frei, editors, Konstanz, Switzerland: Universitätsverlag Konstanz, pp. 66–92.

    Google Scholar 

  • Winskel, G. 1993. The Formal Semantics of Programming Languages: An Introduction, MIT Press.

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Lencevicius, R., Hölzle, U. & Singh, A.K. Dynamic Query-Based Debugging of Object-Oriented Programs. Automated Software Engineering 10, 39–74 (2003). https://doi.org/10.1023/A:1021816917888

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1021816917888

Navigation