Practical Exception Specifications

  • Donna Malayeri
  • Jonathan Aldrich
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4119)

Abstract

Exception specifications can aid in the tasks of writing correct exception handlers and understanding exceptional control flow, but current exception specification systems are impractical in a number of ways. In particular, they are too low-level, too heavyweight, and do not provide adequate support for describing exception policies.

We have identified the essential properties of a practical exception specification system and we present a methodology and tool that provides integrated support for specifying understanding, and evolving exception policies. The annotations required of the programmer are lightweight and easier to maintain than those of current systems; in our studies we observed a 50% to 93% reduction in annotations. By leveraging these annotations, our system provides scalable support for understanding exception flow and for modifying exception annotations.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# programming system. In: Huisman, M. (ed.) Cassis International Workshop (2004)Google Scholar
  2. 2.
    Bloch, J.: Effective Java. Addison-Wesley Professional, Reading (2001)Google Scholar
  3. 3.
    Dony, C.: A fully object-oriented exception handling system: rationale and Smalltalk implementation. In: Advances in exception handling techniques, pp. 18–38. Springer, New York (2001)CrossRefGoogle Scholar
  4. 4.
    Eckel, B.: Thinking in Java, 3rd edn. Prentice-Hall PTR, Englewood Cliffs (2002)Google Scholar
  5. 5.
    Flanagan, C., Leino, K., Lillibridge, M., Nelson, C., Saxe, J., Stata, R.: Extended static checking for Java. In: Proceedings of PLDI 2002 (2002)Google Scholar
  6. 6.
    Fu, C., Milanova, A., Ryder, B., Wonnacott, D.: Robustness testing of Java server applications. In: IEEE Transactions on Software Engineering, pp. 292–312 (April 2005)Google Scholar
  7. 7.
    Garcia, A.F., Rubira, C.M.F., Romanovsky, A.B., Xu, J.: A comparative study of exception handling mechanisms for building dependable object-oriented software. Journal of Systems and Software 59(2), 197–222 (2001)CrossRefGoogle Scholar
  8. 8.
    Gosling, J., Joy, B., Steele, G., Bracha, G.: Java(TM) Language Specification, 3rd edn. Java Series. Addison-Wesley Professional, Reading (2005)Google Scholar
  9. 9.
    Grothoff, C., Palsberg, J., Vitek, J.: Encapsulating objects with confined types. In: Proceedings of the 16th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2001), pp. 241–255. ACM Press, New York (2001)CrossRefGoogle Scholar
  10. 10.
    Horton, A.: Why doesn’t C# have exception specifications? Available at: http://msdn.microsoft.com/vcsharp/team/language/ask/exceptionspecs
  11. 11.
    Jo, J., Byeong-Mo, C., Yi, K., Kwang-Moo, C.: An uncaught exception analysis for Java. Journal of Systems and Software (2004)Google Scholar
  12. 12.
    Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–353. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  13. 13.
    Kiniry, J.R.: Exceptions in Java and Eiffel: Two extremes in exception design and application. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743. Springer, Heidelberg (2003)Google Scholar
  14. 14.
    Knudsen, J.L.: Fault tolerance and exception handling in BETA. In: Advances in exception handling techniques, pp. 1–17. Springer, New York (2001)CrossRefGoogle Scholar
  15. 15.
    Leino, K.R.M., Schulte, W.: Exception safety for C#. In: SEFM, pp. 218–227. IEEE Computer Society, Los Alamitos (2004)Google Scholar
  16. 16.
    Lippert, M., Lopes, C.V.: A study on exception detecton and handling using aspect-oriented programming. In: Proceedings of the 22nd International Conference on Software Engineering (ICSE 2000), pp. 418–427. ACM Press, New York (2000)CrossRefGoogle Scholar
  17. 17.
    Litke, J.D.: A systematic approach for implementing fault tolerant software designs in Ada. In: Proceedings of the conference on TRI-ADA 1990, pp. 403–408. ACM Press, New York (1990)CrossRefGoogle Scholar
  18. 18.
    Miller, R., Tripathi, A.R.: Issues with Exception Handling in Object-Oriented Systems. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 85–103. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  19. 19.
    Reimer, D., Srinivasan, H.: Analyzing exception usage in large Java applications. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743. Springer, Heidelberg (2003)Google Scholar
  20. 20.
    Robillard, M.P.: Personal communication (May 2005)Google Scholar
  21. 21.
    Robillard, M.P., Murphy, G.C.: Designing robust Java programs with exceptions. In: FSE 2000, pp. 2–10. ACM Press, New York (2000)Google Scholar
  22. 22.
    Robillard, M.P., Murphy, G.C.: Static analysis to support the evolution of exception structure in object-oriented systems. ACM Trans. Softw. Eng. Methodol. 12(2), 191–221 (2003)CrossRefGoogle Scholar
  23. 23.
    Sinha, S., Orso, A., Harrold, M.J.: Automated support for development, maintenance, and testing in the presence of implicit control flow. In: Proceedings of the 26th International Conference on Software Engineering (ICSE 2004), pp. 336–345. IEEE Computer Society, Los Alamitos (2004)CrossRefGoogle Scholar
  24. 24.
    Venners, B.: Interface Design: Best Practices in Object-Oriented API Design in Java (2001), Available at: http://www.artima.com/interfacedesign
  25. 25.
    Venners, B.: Failure and exceptions: a conversation with James Gosling, Part II (September 2003), Available at: http://www.artima.com/intv/solid.html
  26. 26.
    Venners, B., Eckel, B.: The trouble with checked exceptions: A conversation with Anders Hejlsberg, Part II (August 2003), Available at: http://www.artima.com/intv/handcuffs.html

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Donna Malayeri
    • 1
  • Jonathan Aldrich
    • 1
  1. 1.Carnegie Mellon UniversityPittsburghUSA

Personalised recommendations