Automated Software Engineering

, Volume 10, Issue 1, pp 39–74 | Cite as

Dynamic Query-Based Debugging of Object-Oriented Programs

  • Raimondas Lencevicius
  • Urs Hölzle
  • Ambuj K. Singh


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.

object-oriented software development debugging query optimization run-time tools 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. Anderson, E. 1995. Dynamic visualization of object programs written in C++. Objective Software Technology Ltd., Scholar
  2. 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
  3. Brown, M.H. 1988. Exploring algorithms using Balsa-II. IEEE Computer, 21(5):14–36.Google Scholar
  4. 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
  5. Bruegge, B. and Hibbard, P. 1983. Generalized path expressions: A high level debugging mechanism. Journal of Systems and Software, 3:265–276.Google Scholar
  6. Buneman, O.P. and Clemons, E.K. 1979. Efficiently monitoring relational databases. ACM Transactions on Database Systems, 4(3):368–382.Google Scholar
  7. 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.Google Scholar
  8. 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.Google Scholar
  9. 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
  10. 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
  11. 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.Google Scholar
  12. 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.Google Scholar
  13. Duncan, A. and Hölzle, U. 1999. Load-Time Adaptation: Efficient and Non-Intrusive Language Extension for Virtual Machines, Technical Report TRCS99–09.Google Scholar
  14. Eisenstadt, M. 1997. My hairiest bug war stories. Communications of the ACM, 40(4): 30–38.Google Scholar
  15. Ferguson, H.E. and Berner, E. 1963. Debugging systems at the source language level. Communications of the ACM, 6(8):430–432.Google Scholar
  16. 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
  17. 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
  18. Gosling, J., Joy, B., and Steele, G. 1996. The Java Language Specification, Addison-Wesley.Google Scholar
  19. 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.Google Scholar
  20. 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.Google Scholar
  21. Java™ 2 SDK Production Release. 1999. Scholar
  22. Keller, R. and Hölzle, U. 1998. Binary component adaptation. In ProceedingsECOOP'98, SpringerVerlag, Lecture Notes on Computer Science, Brussels, Belgium.Google Scholar
  23. 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
  24. 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.Google Scholar
  25. Laffra, C. and Malhotra, A. 1994. HotWire: A visual debugger for C++. In Proceedings of the USENIX C++ Conference, Usenix Association, pp. 109–122.Google Scholar
  26. Laffra, C. 1997. Advanced Java: Idioms, Pitfalls, Styles and Programming Tips, Prentice Hall, pp. 229–252.Google Scholar
  27. Lange, D.B. and Nakamura, Y. 1997. Object-oriented program tracing and visualization. IEEE Computer, vol. 30, no.5, pp. 63–70.Google Scholar
  28. Lencevicius, R. 2000a. Advanced Debugging Methods, Kluwer Academic Publishers.Google Scholar
  29. 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.Google Scholar
  30. 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
  31. 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.Google Scholar
  32. 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
  33. 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
  34. Meyer, B. 1988. Object-Oriented Software Construction, Prentice-Hall, pp. 111–163.Google Scholar
  35. 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
  36. Roman, G.-C. and Cox, K.C. 1993. A taxonomy of program visualization systems. IEEE Computer, 26(12): 11–24.Google Scholar
  37. 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
  38. Standard Performance Evaluation Corporation. 1998. SPEC JVM98 Benchmarks, Scholar
  39. Stasko, J. 1990. TANGO: A framework and system for algorithm animation. IEEE Computer, 23(9):27–39.Google Scholar
  40. 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.Google Scholar
  41. 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
  42. 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
  43. Winskel, G. 1993. The Formal Semantics of Programming Languages: An Introduction, MIT Press.Google Scholar

Copyright information

© Kluwer Academic Publishers 2003

Authors and Affiliations

  • Raimondas Lencevicius
    • 1
  • Urs Hölzle
    • 2
  • Ambuj K. Singh
    • 3
  1. 1.Nokia Research CenterBurlingtonUSA
  2. 2.Google IncMountain ViewUSA
  3. 3.Department of Computer ScienceUniversity of CaliforniaSanta BarbaraUSA

Personalised recommendations