Exception Handling: A Field Study in Java and .NET

  • Bruno Cabral
  • Paulo Marques
Conference paper

DOI: 10.1007/978-3-540-73589-2_8

Volume 4609 of the book series Lecture Notes in Computer Science (LNCS)
Cite this paper as:
Cabral B., Marques P. (2007) Exception Handling: A Field Study in Java and .NET. In: Ernst E. (eds) ECOOP 2007 – Object-Oriented Programming. ECOOP 2007. Lecture Notes in Computer Science, vol 4609. Springer, Berlin, Heidelberg

Abstract

Most modern programming languages rely on exceptions for dealing with abnormal situations. Although exception handling was a significant improvement over other mechanisms like checking return codes, it is far from perfect. In fact, it can be argued that this mechanism is seriously limited, if not, flawed. This paper aims to contribute to the discussion by providing quantitative measures on how programmers are currently using exception handling. We examined 32 different applications, both for Java and .NET. The major conclusion for this work is that exceptions are not being correctly used as an error recovery mechanism. Exception handlers are not specialized enough for allowing recovery and, typically, programmers just do one of the following actions: logging, user notification and application termination. To our knowledge, this is the most comprehensive study done on exception handling to date, providing a quantitative measure useful for guiding the development of new error handling mechanisms.

Keywords

Exception Handling Mechanisms Programming Languages 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Bruno Cabral
    • 1
  • Paulo Marques
    • 1
  1. 1.CISUC, Department of Informatics Engineering, University of CoimbraPortugal