skip to main content
10.1145/2901739.2901757acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Understanding the exception handling strategies of Java libraries: an empirical study

Authors Info & Claims
Published:14 May 2016Publication History

ABSTRACT

This paper presents an empirical study whose goal was to investigate the exception handling strategies adopted by Java libraries and their potential impact on the client applications. In this study, exception flow analysis was used in combination with manual inspections in order: (i) to characterize the exception handling strategies of existing Java libraries from the perspective of their users; and (ii) to identify exception handling anti-patterns. We extended an existing static analysis tool to reason about exception flows and handler actions of 656 Java libraries selected from 145 categories in the Maven Central Repository. The study findings suggest a current trend of a high number of undocumented API runtime exceptions (i.e., @throws in Javadoc) and Unintended Handler problem. Moreover, we could also identify a considerable number of occurrences of exception handling anti-patterns (e.g. Catch and Ignore). Finally, we have also analyzed 647 bug issues of the 7 most popular libraries and identified that 20.71% of the reports are defects related to the problems of the exception strategies and anti-patterns identified in our study. The results of this study point to the need of tools to better understand and document the exception handling behavior of libraries.

References

  1. B. Cabral and P. Marques. "Exception Handling: A Field Study in Java and .NET". ECOOP 2007 -- Object-Oriented Programming, pp. 151--175, 1 January 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. B. Klatt, Z. Durdik, H. Koziolek, K. Krogmann, J. Stammel and R. Weiss. "Identify Impacts of Evolving Third Party Components on Long-living Software Systems". Software Maintenance and Reengineering (CSMR), 2012 16th European Conference on, pp. 461--464, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. B.-M. Chang, J.-W. Jo and H. S. Her. "Visualization of Exception Propagation for Java using Static Analysis". Proceedings Second IEEE Internation Workshop on Source Code Analysis and Manipulation, pp. 173--182, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. C. Fan, M. Muller and I. Rezucha. "Development of Sampling Plans by Using Sequential (Item by Item) Selection Techniques and Digital Computers". Journal of the American Statistical Association, pp. 387--402, 1962.Google ScholarGoogle ScholarCross RefCross Ref
  5. C. Fu and B. G. Ryder. "Exception-chain Analysis: Revealing Exception Handling Architecture in Java Server Applications". 29th International Conference on Software Engineering (ICSE'07), pp. 230--239, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. A. Thomas. "The Deplorable State of Class Libraries". Journal of Object Technology, pp. 21--27, 2002.Google ScholarGoogle Scholar
  7. D. S. Sena, R. Coelho, U. Kulesza and R. Bonifacio. "Understanding the Exception Handling Strategies of Java Libraries: An Empirical Study". 2016. {Online}. Available: https://github.com/demost/pleamsr2016/wiki.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. E. A. Barbosa, A. Garcia and M. Mezini. "Heuristic Strategies for Recommendation of Exception Handling Code". 26th Brazilian Symposium on Software Engineering, pp. 171--180, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. F. Ebert, F. Castor and A. Serebrenik. "An Exploratory Study on Exception Handling Bugs in Java Programs". The Journal of Systems and Software, pp. 82--101, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. G. Pinto, W. Torres, B. Fernandes, F. Castor and M. B. Roberto S. "A Large-Scale Study on The Usage of Java's Concurrent Programming Constructs". Journal of Systems and Software, pp. 59--81, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. H. Melo, R. Coelho, U. Kulesza and D. Sena. "In-depth Characterization of Exception Flows in Software Product Lines: An Empirical Study". Journal of Software Engineering Research and Development, 2013.Google ScholarGoogle Scholar
  12. H. Shah, C. Gorg and M. J. Harrold. "Visualization of Exception Handling Constructs to Support Program Understanding". Proceedings of the 4th ACM Symposium on Software Visualization, pp. 19--28, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. Bloch. "Effective Java". Person Education India, 2008.Google ScholarGoogle Scholar
  14. J. Gosling. "The Java Language Specification". Addison-Wesley Professional, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Kechagia and S. Diomidis. "Undocumented and Unchecked: Exceptions That Spell Trouble". Proceedings of the 11th Working Conference on Mining Software Repositories, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. M. Rahman and C. K. Roy. "On the Use of Context in Recommending Exception Handling Code Examples". IEEE 14th International Working Conference on Source Code Analysis and Manipulation, pp. 285--294, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. P. Robillard and G. C. Murphy. "Designing Robust Java Programs with Exceptions". International Conference on the Foundations of Software Engineering (FSE), pp. 2--10, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. O. Shivers. "Control-Flow Analysis of High-Order Languages". PhD thesis, Carnegie-Mellon University, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Clements and L. M. Northrop. "Software Product Lines: Practices and Patterns". Addison Wesley, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Sawadpong, B. E. Allen and J. B. Willians. "Exception Handling Defects: An Empirical Study". 14th International Symposium on High-Assurance Systems Engineering, pp. 90--97, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. R. Binder. "Testing Object-Oriented Systems: Models, Patterns and Tools". Addison-Wesley Professional, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. R. Coelho, A. G. A. Rashid, F. Ferrari, N. Cacho, U. Kulesza, A. Staa and C. Lucena. "Assessing the Impact of Aspects on Exception Flows: An Exploratory Study". Proceedings of the 22nd European Conference on Object-Oriented, pp. 207--234, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. R. J. Wirfs-Brock. "Towards Exception-Handling Best Practices and Patterns". IEEE Software, V 23 (5), IEEE Computer Society, pp. 11--13, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. R. Miller and A. Tripathi. "Issues with Exception Handling in Object-Oriented Systems". ECOOP'97 - Object-Oriented Programming, pp. 85--103, 1997.Google ScholarGoogle ScholarCross RefCross Ref
  25. S. Gulwani and G. C. Necula. "Precise Interprocedural Analysis using Random Interpretation". Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 324--337, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. S. Raemaekers, A. v. Deursen and J. Visser. "The Maven Repository Dataset of Metrics, Changes, and Dependencies". Proceedings of the 10th Working Conference on Mining Software Repositories, pp. 221--224, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S. Raemaekers, A. van Deursen and J. Visser. "Exploring Risks in the Usage of Third-Party Libraries". Software Improvement Group, Tech. Rep, 2011.Google ScholarGoogle Scholar
  28. S. Sinha, A. Orso and M. J. Harrold. "Automated Support for Development, Maintenance and Testing in the Presence of Implicit Control Flow". Proceedings in 26th International Conference on Software Engineering, pp. 336--345, 23 May 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. S. Thummalapenta and T. Xie. "Mining Exception-handling Rules As Sequence Association Rules". Proceedings of the 31st International Conference on Software Engineering, pp. 496--506, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. T. McCune. "Exception Handling Antipatterns". 04 06 2006. {Online}. Available: http://today.java.net/pub/a/today/2006/04/06/exception-handling-antipatterns.html.Google ScholarGoogle Scholar
  31. T. Yamane. "Statistics: An Introduction Analysis". New York, NY: Harper and Row, 1973.Google ScholarGoogle Scholar
  32. V. Bauer and L. Heinemann. "Understanding API Usage to Support Informed Decision Making". Software Maintenance and Reengineering (CSMR), 2012 16th, pp. 435--440, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. WALA, T. J. "Watson Libraries for Analysis". Janeiro 2016. {Online}. Available: http://wala.sourceforge.net/.Google ScholarGoogle Scholar

Index Terms

  1. Understanding the exception handling strategies of Java libraries: an empirical study

    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
      MSR '16: Proceedings of the 13th International Conference on Mining Software Repositories
      May 2016
      544 pages
      ISBN:9781450341868
      DOI:10.1145/2901739

      Copyright © 2016 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: 14 May 2016

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Upcoming Conference

      ICSE 2025

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader