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.
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- D. A. Thomas. "The Deplorable State of Class Libraries". Journal of Object Technology, pp. 21--27, 2002.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- J. Bloch. "Effective Java". Person Education India, 2008.Google Scholar
- J. Gosling. "The Java Language Specification". Addison-Wesley Professional, 2000. Google ScholarDigital Library
- M. Kechagia and S. Diomidis. "Undocumented and Unchecked: Exceptions That Spell Trouble". Proceedings of the 11th Working Conference on Mining Software Repositories, 2014. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- O. Shivers. "Control-Flow Analysis of High-Order Languages". PhD thesis, Carnegie-Mellon University, 1991. Google ScholarDigital Library
- P. Clements and L. M. Northrop. "Software Product Lines: Practices and Patterns". Addison Wesley, 2001. Google ScholarDigital Library
- 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 ScholarDigital Library
- R. Binder. "Testing Object-Oriented Systems: Models, Patterns and Tools". Addison-Wesley Professional, 2000. Google ScholarDigital Library
- 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 ScholarDigital Library
- R. J. Wirfs-Brock. "Towards Exception-Handling Best Practices and Patterns". IEEE Software, V 23 (5), IEEE Computer Society, pp. 11--13, 2006. Google ScholarDigital Library
- R. Miller and A. Tripathi. "Issues with Exception Handling in Object-Oriented Systems". ECOOP'97 - Object-Oriented Programming, pp. 85--103, 1997.Google ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- S. Raemaekers, A. van Deursen and J. Visser. "Exploring Risks in the Usage of Third-Party Libraries". Software Improvement Group, Tech. Rep, 2011.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- T. Yamane. "Statistics: An Introduction Analysis". New York, NY: Harper and Row, 1973.Google Scholar
- 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 ScholarDigital Library
- WALA, T. J. "Watson Libraries for Analysis". Janeiro 2016. {Online}. Available: http://wala.sourceforge.net/.Google Scholar
Index Terms
- Understanding the exception handling strategies of Java libraries: an empirical study
Recommendations
Efficient Java exception handling in just-in-time compilation
Research ArticlesJava uses exceptions to provide elegant error handling capabilities during program execution. However, the presence of exception handlers complicates the job of the just-in-time (JIT) compiler, while exceptions are rarely used in most programs. This ...
Constructing exception handling chains for testing Java virtual machine implementations
AbstractThe Java virtual machine (JVM) is the cornerstone of the Java platforms. A JVM's exception handling implementation interrupts, when the objective application encounters an exception (or an error), the normal execution of the application and ...
image image
Exception evolution in long-lived Java systems
MSR '17: Proceedings of the 14th International Conference on Mining Software RepositoriesException handling allows developers to deal with abnormal situations that disrupt the execution flow of a program. There are mainly three types of exceptions: standard exceptions provided by the programming language itself, custom exceptions defined by ...
Comments