skip to main content
10.1145/1390630.1390664acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Automatic documentation inference for exceptions

Published:20 July 2008Publication History

ABSTRACT

Exception handling is a powerful and widely-used programming language abstraction for constructing robust software systems. Unfortunately, it introduces an inter-procedural flow of control that can be difficult to reason about. Failure to do so correctly can lead to security vulnerabilities, breaches of API encapsulation, and any number of safety policy violations.

We present a fully automated tool that statically infers and characterizes exception-causing conditions in Java programs. Our tool is based on an inter-procedural, context-sensitive analysis. The output of this tool is well-suited for use as human-readable documentation of exceptional conditions.

We evaluate the output of our tool by comparing it to over 900 instances of existing exception documentation in almost two million lines of code. We find that the output of our tool is at least as good as existing documentation 85% of the time and is better 25% of the time.

References

  1. G. Alonso, C. Hagen, D. Agrawal, A. E. Abbadi, and C. Mohan. Enhancing the fault tolerance of work flow management systems. IEEE Concurrency, 8(3):74--81, July 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. T. Ball and J. R. Larus. Efficient path profiling. In International Symposium on Microarchitecture, pages 46--57, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Bruntink, A. van Deursen, and T. Tourwé. Discovering faults in idiom-based exception handling. In ICSE '06: Proceeding of the 28th international conference on Software engineering, pages 242--251, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. T. Cargill. Exception handling: a false sense of security. C++ Report, 6(9), 1994.]]Google ScholarGoogle Scholar
  5. L. Carter, B. Simon, B. Calder, L. Carter, and J. Ferrante. Path analysis and renaming for predicated instruction scheduling. International Journal of Parallel Programming, 28(6):563--588, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. B.-M. Chang, J.-W. Jo, K. Yi, and K.-M. Choe. Interprocedural exception analysis for java. In SAC '01: Proceedings of the 2001 ACM symposium on Applied computing, pages 620--625, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. Chatterjee, B. G. Ryder, and W. Landi. Complexity of points-to analysis of java in the presence of exceptions. IEEE Trans. Software Eng., 27(6):481--512, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J.-D. Choi, D. Grove, M. Hind, and V. Sarkar. Efficient and precise modeling of exceptions for the analysis of java programs. In Workshop on Program Analysis for Software Tools and Engineering, pages 21--31, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Das, S. Lerner, and M. Seigle. ESP: path-sensitive program verification in polynomial time. SIGPLAN Notices, 37(5):57--68, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. C. B. de Souza, N. Anquetil, and K. M. de Oliveira. A study of the documentation essential to software maintenance. In International Conference on Design of Communication, pages 68--75, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. R. Engler, D. Y. Chen, and A. Chou. Bugs as inconsistent behavior: A general approach to inferring errors in systems code. In Symposium on Operating Systems Principles, pages 57--72, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. V.-R. et. al. Soot -- a java optimization framework. In Proceedings of CASCON 1999, pages 125--135, 1999.]]Google ScholarGoogle Scholar
  13. C. Flanagan, K. R. M. Leino, M. Lillibridge, G. Nelson, J. B. Saxe, and R. Stata. Extended static checking for java. In Programming Language Design and Implementation PLDI), pages 234--245, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. Forward and T. C. Lethbridge. The relevance of software documentation, tools and technologies: a survey. In DocEng '02: Proceedings of the 2002 ACM symposium on Document engineering, pages 26--33, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C. Fu and B. G. Ryder. Exception-chain analysis: Revealing exception handling architecture in java server applications. Software Engineering, 2007. ICSE 2007. 29th International Conference on, pages 230--239, 20--26 May 2007.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. J. B. Goodenough. Exception handling: issues and a proposed notation. Communications of the ACM, 18(12):683--696, 1975.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Hind. Pointer analysis: haven't we solved this problem yet? In Workshop on Program Analysis for Software Tools and Engineering, pages 54--61, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. Huang and S. Tilley. Towards a documentation maturity model. In International Conference on Documentation, pages 93--99, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. R. Jhala and R. Majumdar. Path slicing. In Programming Language Design and Implementation (PLDI), pages 38--47, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. D. Kramer. Api documentation from source code comments: a case study of javadoc. In International Conference on Computer Documentation, pages 147--153, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. Malayeri and J. Aldrich. Practical exception specifications. In Advanced Topics in Exception Handling Techniques, pages 200--220, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. K. L. McMillan. Applications of craig interpolants in model checking. In Tools and Algorithms for the Construction and Analysis of Systems, pages 1--12, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. R. Miller and A. Tripathi. Issues with exception handling in object-oriented systems. In European Conference on Object-Oriented Programming, pages 85--103, 1997.]]Google ScholarGoogle ScholarCross RefCross Ref
  24. D. G. Novick and K. Ward. What users say they want in documentation. In Conference on Design of Communication, pages 84--91, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. L. Pfleeger. Software Engineering: Theory and Practice. Prentice Hall PTR, Upper Saddle River, NJ, USA, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. T. M. Pigoski. Practical Software Maintenance: Best Practices for Managing Your Software Investment. John Wiley & Sons, Inc., 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. P. Robillard and G. C. Murphy. Regaining control of exception handling. Technical Report TR--99--14, Dept. of Computer Science, University of British Columbia, 1, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. P. Robillard and G. C. Murphy. Static analysis to support the evolution of exception structure in object-oriented systems. ACM Trans. Softw. Eng. Methodol., 12(2):191--221, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. T. Robschink and G. Snelting. Efficient path conditions in dependence graphs. In International Conference on Software Engineering (ICSE), pages 478--488, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. B. G. Ryder, D. Smith, U. Kremer, M. Gordon, and N. Shah. A static study of java exceptions using jesp. In International Conference on Compiler Construction, pages 67--81, London, UK, 2000. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. R. C. Seacord, D. Plakosh, and G. A. Lewis. Modernizing Legacy Systems: Software Technologies, Engineering Process and Business Practices. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. I. Seltzer, Y. Endo, C. Small, and K. A. Smith. Dealing with disaster: Surviving misbehaved kernel extensions. In Symposium on Operating Systems Design and Implementation, pages 213--227, Seattle, Washington, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. S. Sinha and M. J. Harrold. Criteria for testing exception-handling constructs in java programs. In ICSM, 265, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. S. Sinha, A. Orso, and M. J. Harrold. Automated support for development, maintenance, and testing in the presence of implicit control flow. icse, 0:336--345, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. B. Thomas and S. Tilley. Documentation for software engineers: what is needed to aid system understanding? In International Conference on Computer Documentation, pages 235--236, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. S. Tilley and H. Müller. Info: a simple document annotation facility. In International Conference on Systems Documentation, pages 30--36, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. W. Weimer and G. C. Necula. Finding and preventing run-time error handling mistakes. In Conference on Object-oriented programming, systems, languages, and applications, pages 419--431, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. S. Yemini and D. Berry. A modular verifiable exception handling mechanism. ACM Transactions on Programming Languages and Systems, 7(2), Apr. 1985.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. M. Gupta, J.-D. Choi, and M. Hind. Optimizing java programs in the presence of exceptions. In European Conference on Object-Oriented Programming, pages 422--446, London, UK, 2000. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. O. Lhoták and L. Hendren. Scaling Java points--to analysis using Spark. In G. Hedin, editor, Compiler Construction, 12th International Conference, volume 2622 of LNCS, pages 153--169, Warsaw, Poland, April 2003. Springer.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Automatic documentation inference for exceptions

      Recommendations

      Comments

      Login options

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

      Sign in
      • Published in

        cover image ACM Conferences
        ISSTA '08: Proceedings of the 2008 international symposium on Software testing and analysis
        July 2008
        324 pages
        ISBN:9781605580500
        DOI:10.1145/1390630

        Copyright © 2008 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 20 July 2008

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate58of213submissions,27%

        Upcoming Conference

        ISSTA '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader