skip to main content
article

Static analysis to support the evolution of exception structure in object-oriented systems

Published:01 April 2003Publication History
Skip Abstract Section

Abstract

Exception-handling mechanisms in modern programming languages provide a means to help software developers build robust applications by separating the normal control flow of a program from the control flow of the program under exceptional situations. Separating the exceptional structure from the code associated with normal operations bears some consequences. One consequence is that developers wishing to improve the robustness of a program must figure out which exceptions, if any, can flow to a point in the program. Unfortunately, in large programs, this exceptional control flow can be difficult, if not impossible, to determine.In this article, we present a model that encapsulates the minimal concepts necessary for a developer to determine exception flow for object-oriented languages that define exceptions as objects. Using these concepts, we describe why exception-flow information is needed to build and evolve robust programs. We then describe Jex, a static analysis tool we have developed to provide exception-flow information for Java systems based on this model. The Jex tool provides a view of the actual exception types that might arise at different program points and of the handlers that are present. Use of this tool on a collection of Java library and application source code demonstrates that the approach can be helpful to support both local and global improvements to the exception-handling structure of a system.

References

  1. Abadi, M. and Cardelli, L. 1996. A Theory of Objects. Monographs in Computer Science, Springer-Verlag, New York, NY.]] Google ScholarGoogle Scholar
  2. Bacon, D. F. 1998. Fast and effective optimization of statically typed object-oriented languages. Ph.D. Thesis CSD-98-1017, (Oct.), University of California, Berkeley.]] Google ScholarGoogle Scholar
  3. Brennan, P. T. 1993. Observations on program-wide Ada exception propagation. In Proceedings of the Conference on TRI-Ada '93 (Sept.). ACM, 189--195.]] Google ScholarGoogle Scholar
  4. Buhr, P. A. and Mok, W. R. 2000. Advanced exception handling mechanisms. IEEE Trans. Softw. Eng. 26, 9 (Sept.), 820--836.]] Google ScholarGoogle Scholar
  5. Callahan, D., Cooper, K. D., Kennedy, K., and Torczon, L. 1986. Interprocedural constant propagation. In Proceedings of the 1986 SIGPLAN Symposium on Compiler Construction (June). ACM, 152--161.]] Google ScholarGoogle Scholar
  6. Chang, B.-M., Jo, J.-W., and Her, S. H. 2002. Visualization of exception propagation for Java using static analysis. In Proceedings of the Second International Workshop on Source Code Analysis and Manipulation (Oct.). IEEE, CA, 173--182.]] Google ScholarGoogle Scholar
  7. Chang, B.-M., Jo, J.-W., Yi, K., and Choe, K.-M. 2001. Interprocedural exception analysis for Java. In Proceedings of the 2001 ACM Symposium on Applied Computing (March). ACM, 620--625.]] Google ScholarGoogle Scholar
  8. Choi, J.-D., Grove, D., Hind, M., and Sarkar, V. 1999. Efficient and precise modeling of exceptions for the analysis of Java programs. In Proceedings of the ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (Sept.). ACM, 21--31.]] Google ScholarGoogle Scholar
  9. Cousot, P. and Cousot, R. 1977. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of the Fourth Annual ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (Jan.). ACM, 238--252.]] Google ScholarGoogle Scholar
  10. Dean, J., Grove, D., and Chambers, C. 1995. Optimization of object-oriented programs using static class hierarchy analysis. In Proceedings of the Ninth European Conference on Object-oriented Programming. Lecture Notes in Computer Science (Aug.), vol. 952. Springer-Verlag, 77--101.]] Google ScholarGoogle Scholar
  11. Dony, C. 1990. Exception handling and object-oriented programming: towards a synthesis. In Proceedings of the Conference on Object-oriented Programming Systems, Languages, and Applications, and of the European Conference on Object-oriented programming (Oct.). ACM, 322--330.]] Google ScholarGoogle Scholar
  12. Fahndrich, M., Foster, J., Cu, J., and Aiken, A. 1998. Tracking down exceptions in standard ML programs. Tech. Rep. CSD-98-996, Feb. University of California, Berkeley.]] Google ScholarGoogle Scholar
  13. Gamma, E., Helm, R., Johnson, R., and Vlissides, J. 1995. Design Patterns---Elements of Reusable Object-Oriented Software. Addison Wesley Longman, Inc., Reading, MA.]] Google ScholarGoogle Scholar
  14. Gauthier, M. 1995. Exception handling in Ada-94: Initial users' requests and final features. ACM Ada Letters, XV, 1 (Jan./Feb.), 70--82.]] Google ScholarGoogle Scholar
  15. Goodenough, J. B. 1975. Exception handling: Issues and proposed notation. Commun. ACM, 18, 12 (Dec.), 683--696.]] Google ScholarGoogle Scholar
  16. Gosling, J., Joy, B., and Steele, G. 1996. The Java Language Specification. Addison Wesley. Longman, Inc., Reading, MA.]] Google ScholarGoogle Scholar
  17. Guzmán, J. C. and Suárez, A. 1994. A type system for exceptions. In Proceedings of the 1994 ACM SIGPLAN Workshop on ML and Its Applications (June). ACM, 127--135.]]Google ScholarGoogle Scholar
  18. Halbert, D. C. and O'Brien, P. D. 1987. Using types and inheritance in object-oriented programming. IEEE Softw. 4, 5 (Sep.), 71--79.]]Google ScholarGoogle Scholar
  19. Heintze, N. 1992. Set-based program analysis. Ph.D. Thesis (Oct.), Carnegie-Mellon University, Pittsburgh, PA.]] Google ScholarGoogle Scholar
  20. Lang, J. and Stewart, D. B. 1998. A study of the applicability of existing exception-handling techniques to component-based real-time software technology. ACM Trans. Program. Lang. Syst. 20, 2 (Mar.), 274--301.]] Google ScholarGoogle Scholar
  21. Liskov, B. H. and Snyder, A. 1979. Exception handling in CLU. IEEE Trans. Softw. Eng. 5, 6 (Nov.), 546--558.]]Google ScholarGoogle Scholar
  22. Liskov, B. H. and Wing, J. M. 1994. A behavioral notion of subtyping. ACM Trans. Program. Lang. Syst. 16, 6 (Nov.), 1811--1841.]] Google ScholarGoogle Scholar
  23. Litke, J. D. 1990. A systematic approach for implementing fault tolerant software designs in Ada. In Proceedings of the Conference on TRI-ADA '90 (Dec.). ACM, 403--408.]] Google ScholarGoogle Scholar
  24. Maddison, W. and Maddison, D. 2001. Mesquite: A modular system for evolutionary analysis. http://mesquiteproject.org.]]Google ScholarGoogle Scholar
  25. Miller, R. and Tripathi, A. 1997. Issues with exception handling in object-oriented systems. In Proceedings of the 11th European Conference on Object-Oriented Programming. Lecture Notes in Computer Science (June), vol. 1241. Springer-Verlag, New York, NY, 85--103.]]Google ScholarGoogle Scholar
  26. Milner, R., Tofte, M., and Harper, R. W. 1990. The Definition of Standard ML. MIT Press, Cambridge, MA.]] Google ScholarGoogle Scholar
  27. Ogasawara, T., Komatsu, H., and Nakatani, T. 2001. A study of exception handling and its dynamic optimization in Java. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (Oct.). ACM, 83--95.]] Google ScholarGoogle Scholar
  28. Palsberg, J. and Schwartzbach, M. I. 1991. Object-oriented type inference. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (Oct.). ACM, 146--161.]] Google ScholarGoogle Scholar
  29. Pessaux, F. and Leroy, X. 1999. Type-based analysis of uncaught exceptions. In Proceedings of the 26th Symposium on the Principles of Programming Languages (Jan.). ACM, 276--290.]] Google ScholarGoogle Scholar
  30. Plevyak, J. and Chien, A. A. 1994. Precise concrete type inference for object-oriented languages. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (Oct.). ACM, 324--340.]] Google ScholarGoogle Scholar
  31. Robillard, M. P. and Murphy, G. C. 1999. Analyzing exception flow in Java programs. In Proceedings of the Seventh European Software Engineering Conference and Seventh ACM SIGSOFT Symposium on the Foundations of Software Engineering. Lecture Notes in Computer Science (Sept.) vol. 1687. Springer-Verlag, New York, NY, 322--337.]] Google ScholarGoogle Scholar
  32. Robillard, M. P. and Murphy, G. C. 2000. Designing robust Java programs with exceptions. In Proceedings of the 8th ACM SIGSOFT International Symposium on the Foundations of Software Engineering (Nov.). ACM Press, New York, NY, 2--10.]] Google ScholarGoogle Scholar
  33. Romanovsky, A. and Sandén, B. 2001. Except for exception handling. Ada Letters 21, 3 (Sept.), 19--25 (Proceedings of the Workshop on Exception Handling for a 21st Century Programming Language).]] Google ScholarGoogle Scholar
  34. Ryder, B. G., Smith, D., Kremer, U., Gordon, M., and Shah, N. 1999. A static study of Java exceptions using JESP. Tech. Rep. DSC-TR-406 (Oct.). Department of Computer Science, Rutgers University.]]Google ScholarGoogle Scholar
  35. Ryu, S. and Yi, K. 2001. Exception analysis for multithreaded Java programs. In Proceedings of the Second Asia-Pacific Conference on Quality Software (Dec.). IEEE Computer Society Press, Los Alamitos, CA, 23--30.]] Google ScholarGoogle Scholar
  36. Schaefer, C. F. and Bundy, G. N. 1993. Static analysis of exception handling in Ada. Softw. Pract. Exper. 23, 10 (Oct.), 1157--1174.]] Google ScholarGoogle Scholar
  37. Scott, M. L. 2000. Programming Language Pragmatics. Morgan Kaufmann Publishers, San Francisco, CA.]] Google ScholarGoogle Scholar
  38. Shelekhov, V. I. and Kuksenko, S. V. 1999. Data flow analysis of Java programs in the presence of exceptions. In Proceedings of the third International Andrei Ershov Memorial Conference on Perspectives of System Informatics. Lecture Notes in Computer Science (July), vol. 1755. Springer-Verlag, New York, NY, 389--396.]] Google ScholarGoogle Scholar
  39. Sinha, S. and Harrold, M. J. 1999. Criteria for testing exception-handling constructs in Java programs. In Proceedings of the International Conference on Software Maintenance (Sept.). IEEE Computer Society Press, Los Alamitos, CA, 265--274.]] Google ScholarGoogle Scholar
  40. Sinha, S. and Harrold, M. J. 2000. Analysis and testing of programs with exception handling constructs. IEEE Trans. on Softw. Eng. 26, 9 (Sept.), 849--871.]] Google ScholarGoogle Scholar
  41. Stroustrup, B. 1991. The C++ Programming Language, 2nd ed. Addison Wesley Longman, Inc., Reading, MA.]] Google ScholarGoogle Scholar
  42. U.S. Department of Defense 1983. Reference Manual for the Ada Programming Language, ANSI/Military Standard MIL-STD-1815A-1983. U.S. Department of Defense.]] Google ScholarGoogle Scholar
  43. Yemini, S. and Berry, D. M. 1985. A modular verifiable exception-handling mechanism. ACM Trans. Program. Lang. Syst. 7, 2 (Apr.), 214--243.]] Google ScholarGoogle Scholar
  44. Yi, K. 1998. An abstract interpretation for estimating uncaught exceptions in standard ML programs. Sci. Comp. Program. 31, 1 (May), 147--173.]] Google ScholarGoogle Scholar
  45. Yi, K. and Ryu, S. 1997. Towards a cost-effective estimation of uncaught exceptions in SML programs. In Proceedings of the 4th International Static Analysis Symposium. Lecture Notes in Computer Science (Sept.), vol. 1302. Springer-Verlag, 98--113.]] Google ScholarGoogle Scholar

Index Terms

  1. Static analysis to support the evolution of exception structure in object-oriented systems

          Recommendations

          Reviews

          Chenglie Hu

          In object-oriented development environments, software developers have historically had difficulty determining propagated exception types and the reasons for unintended exceptions being caught. This problem may be due to type subsumption or simply to poor documentation, but it affects the developer's ability to devise recovery procedures or to report unhandled exceptions constructively. This paper, by Robillard and Murphy, considers a static analysis tool, Jex, which is used to provide exception flow information for Java programs. The exception flow analysis is presented at both the local level (caught exceptions) and global level (the propagation path). More specifically, Jex takes an input set of Java source files, and produces a human-readable file for each class that shows the formatted view of the exception flow for each method of a class. The model used by Jex is based on an earlier (1993) work on Ada. The implementation of Jex is based on an extension to the code of an open source Java compiler. The architecture of Jex is organized around four processes: parsing and type-checking source files, extracting exception flows, performing class-hierarchy analysis to determine dynamic bindings, and loading Jex files for querying. Situations that require identification of actual exception objects (such as whether an exception thrown in a handler is the same as the one that would be caught by the catch clause) are currently outside the scope of Jex. Three existing software packages were analyzed using Jex, and the results are reported. Online Computing Reviews Service

          Access critical reviews of Computing literature here

          Become a reviewer for Computing Reviews.

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader