arrow
Return

An exploratory study on exception handling bugs in Java programs

delete2015-08-01
delete56
delete
OA
AI
F
Felipe Ebert *
F
Fernando Castor
Alexander Serebrenik cover
Alexander Serebrenik (Alexander Serebrenik)
DOI:10.1016/j.jss.2015.04.066delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
Most mainstream programming languages provide constructs to throw and to handle exceptions. However, several studies argue that exception handling code is usually of poor quality and that it is commonly neglected by developers. Moreover, it is said to be the least understood, documented, and tested part of the implementation of a system. Nevertheless, there are very few studies that analyze the actual exception handling bugs that occur in real software systems or that attempt to understand developers' perceptions of these bugs. In this work we present an exploratory study on exception handling bugs that employs two complementary approaches: a survey of 154 developers and an analysis of 220 exception handling bugs from the repositories of Eclipse and Tomcat. Only 27% of the respondents claimed that policies and standards for the implementation of error handling are part of the culture of their organizations. Moreover, in 70% of the organizations there are no specific tests for the exception handling code. Also, 61% of the respondents stated that no to little importance is given to the documentation of exception handling in the design phase of the projects with which they are involved. In addition, about 40% of the respondents consider the quality of exception handling code to be either good or very good and only 14% of the respondents consider it to be bad or very bad. Furthermore, the repository analysis has shown (with statistical significance) that exception handling bugs are ignored by developers less often than other bugs. We have also observed that while overly general catch blocks are a well-known bad smell related to exceptions, bugs stemming from these catch blocks are rare, even though many overly general catch blocks occur in the code. Furthermore, while developers often mention empty catch blocks as causes of bugs they have fixed in the past, we found very few bug reports caused by them. On top of that, empty catch blocks are frequently used as part of bug fixes, including fixes for exception handling bugs. Based on our findings, we propose a classification of exception handling bugs and their causes. The proposed classification can be used to assist in the design and implementation of test suites, to guide code inspections, or as a basis for static analysis tools. (C) 2015 Elsevier Inc. All rights reserved.
Keywords:
Exception handling
Bugs
Repository mining
Exception handling bug hazards in Android
err2016-08-13
err26
errOAAI
errCoelho, Roberta; Almeida, Lucas; Gousios, Georgios; van Deursen, Arie; Treude, Christoph
errShare
errSave
Towards automatic labeling of exception handling bugs: A case study of 10 years bug-fixing in Apache Hadoop
err2024-06-05
err0
PREAI
errda Silva, Antonio Jose A.; Vieira, Renan G.; Mesquita, Diego P. P.; Gomes, Joao Paulo P.; Rocha, Lincoln S.
errShare
errSave
Exception handling bugs in Python: An empirical study of root causes, fix patterns, and anti-patterns
err2026-07-01
err0
errOAAI
errSouza, Jairo; Coelho, Eric; Correia, Joao; Lima, Rodrigo; Teixeira, Leopoldo; Fonseca, Baldoino
errShare
errSave
Exception handling refactorings: Directed by goals and driven by bug fixing
err2009-02-01
err21
PREAI
errChen, Chien-Tsun; Cheng, Yu Chin; Hsieh, Chin-Yun; Wu, I-Lang
errShare
errSave
errShare
errSave

Journal

Journal of Systems and Software cover
Journal of Systems and Software
IF:
4.1
Papers:
5.5K
Citations:
1.0W

Organization

E
Eindhoven University of Technology
Scholars:
1.1K
Papers: 415
Citations: 1.4W
U
universidade federal de pernambuco
Scholars:
470
Papers: 152
Citations: 2.4K
Cited Papers

Cited Papers

errShare
errSave
The 2.6 Angstrom Crystal Structure of a Human A2AAdenosine Receptor Bound to an Antagonist
err2008-11-21
err0
errOAAI
errVeli-Pekka Jaakola; Mark T. Griffith; Michael A. Hanson; Vadim Cherezov; Ellen Y. T. Chien; J. Robert Lane; Adriaan P. IJzerman; Raymond C. Stevens
errShare
errSave
errShare
errSave
Global energy transfer during a magnetospheric field line resonance
err2011-06-18
err0
errOAAI
errMichael Hartinger; Vassilis Angelopoulos; Mark B. Moldwin; Karl-Heinz Glassmeier; Yukitoshi Nishimura
errShare
errSave
researcher View more