Exception handling mechanisms were conceived as a means to help managing the complexity of fault-tolerant software. They promote an explicit textual separation between normal code and the code that deals with abnormal situations, in order to support the construction of programs that are more concise, evolvable, and reliable. Several mainstream programming languages and most of the existing component models implement exception handling mechanisms.In spite of its many benefits, exception handling can be a source of many design faults if used in an ad hoc fashion. Recent studies show that developers of large-scale software systems based on component infrastructures have habits concerning the use of exception handling that make applications vulnerable to faults and hard to maintain. Software components introduce new challenges which are not addressed by traditional exception handling mechanisms and increase the chances of problems occurring. Examples include unavailability of source code and architectural mismatches.In this work, we propose two complementary techniques centered on exception handling for the construction of fault-tolerant component-based systems. Both of them emphasize system structure as a means to reduce the impact of fault tolerance mechanisms on the overall complexity of a software system and the number of design faults that stem from complexity. The first one is an approach for the architectural design of a system's error handling capabilities. It addresses the problem of verifying whether a software architecture satisfies certain properties of interest pertaining the flow of exceptions between architectural components, e.g., if all the exceptions signaled at the architectural level are eventually handled. The proposed approach is based on a set of existing tools that automate this process as much as possible. The second one consists in applying aspectoriented programming (AOP) to better modularize exception handling code. We have conducted a through study aimed at improving our understanding of the effects of AOP on exception handling code and identifying the situations where its use is advantageous and the ones where it is not. viii
AgradecimentosNormalmente, uma tese é o resultado do sangue, do suor, das lágrimas e dos neurônios de uma quantidade de gente muito maior do que caberia na maior das listas de agradecimentos. Esta não é exceção à regra e eu gostaria de expressar meus mui sinceros agradecimentos a todas as pessoas que contribuíram de alguma forma, mínima que seja, para a sua realização. Em especial, eu gostaria de agradecer... Em primeiro lugar à minha família, sem a qual eu não existiria e graças a quem eu cheguei até aqui: meus pais, Fernando e Maria, minha irmã, Donandréa, minha "mãe preta", Tia Zefinha, meu cunhado, Filipe, meu Avô, Nelson, e o dogo Bara. Amo vocês.À minha orientadora Cecília, pelos muitos ensinamentos, pelas várias discussões e idéias interessantes, sempre regadas a muito café, pelas diversas oportunidades que me proporcionou de evoluir como pesquisador e indiví...