@techreport{TR-IC-06-08, number = {IC-06-08}, author = {Fernando Castor Filho and Nelio Cacho and Eduardo Figueiredo and Raquel Maranhão and Alessandro Garcia and Cec{\'{\i}}lia Mary F. Rubira}, title = {Exceptions and Aspects: The Devil is in the Details}, month = {May}, year = {2006}, institution = {Institute of Computing, University of Campinas}, note = {In English, 21 pages. \par\selectlanguage{english}\textbf{Abstract} One of the fundamental motivations for employing exception handling in the development of robust applications is to lexically separate error handling code so that it can be independently reused and modified. It is usually assumed that the implementation of exception handling can be better modularized by the use of aspect-oriented programming (AOP). However, the trade-offs involved in using AOP with this goal are not yet well-understood. This paper presents an in-depth investigation of the adequacy of the AspectJ language for modularizing exception handling code. The study consisted in refactoring existing applications so that the code responsible for implementing heterogeneous error handling strategies was moved to separate aspects. We have performed quantitative assessments of four systems - three ob ject-oriented and one aspect-oriented - based on four fundamental quality attributes, namely separation of concerns, coupling, cohesion, and conciseness. Our investigation also included a multi-perspective analysis of the refactored systems, including (i) the reusability of the aspectized error handling code, (ii) the beneficial and harmful aspectization scenarios, and (iii) the scalability of AOP to aspectize exception handling in the presence of other crosscutting concerns. } }