Identifying and Analyzing Exception Handling Practices: A Developers´ Point of View
Exception handling; Java language; Qualitative study.
The exception handling mechanism is a feature present in most modern programming languages for the development of fault tolerant systems. Despite being an older feature of the Java language, developers still struggle to use exception handling for even the most basic problems. Although the exception handling of a system is essentially a design problem, few works are intended to investigate Java exception handling from the developers' point of view. In this thesis we explore the decisions made and solutions adopted by Java developers for exception handling in their projects. In total we conducted 6 studies, which consulted a total of 423 developers, including interviews and surveys, and analyzed the source code of 240 Java projects hosted on GitHub. Our results show that decisions regarding Java exception handling are not usually documented, and sometimes not even discussed verbally among the developement team; that developers believe their code follows the solutions adopted; that developers learn about exception handling solutions through informal meetings and code inspection; that the solutions adopted in the project are verified in the source code through code review. We analyzed Java source code from 240 projects to verify compliance of 7 of the 31 Java exception handling solutions we identified, and found that the code often fails to deliver what was planned. Our research reveals a weakness in the design, implementation, and verification of Java exception handling that will help researchers and the community to design tools and other solutions that help developers to apply exception handling effectively.