In many software systems there are concerns that must inherently cut across many of the system’s other concerns. In order to separate these so-called crosscutting concerns into their own modules, aspect-oriented programming languages introduce an additional type of module called aspects. As aspects are able to implicitly modify the behaviour of multiple existing modules, these
modules may no longer have the expected behaviour.

This thesis presents an approach to modular reasoning for aspect-oriented languages, in order to prevent such unexpected behaviour. Using this approach, it is sufficient to understand the behaviour of a module by only considering that module itself and any other module it explicitly refers to. This approach consists of two parts: First, in order to remain unaware of an aspect while retaining modular reasoning, we present an advice substitution principle, similar to behavioural subtyping rules. Second, if an advice cannot satisfy this principle, a simple specification clause can be used to make the presence of aspects explicit while retaining the benefits of aspects as a quantification mechanism.

The approach is elaborated in the context of our own minimal, but representative aspect-oriented language. We show that the approach is sound within this language for specifications in the form of pre- and postconditions. We also provide both runtime and static means to ensure that developers are using the approach correctly. Finally, a frame inference analysis is introduced, which allows us to infer what may be modified by a given body of code. This analysis is then used to study existing aspect- oriented applications to find outhow often aspects modify more than they are allowed to, in the context of modular reasoning.