Modular reasoning in aspect-oriented languages from a substitution perspective
Faculty of Sciences. Mathematics and Computer Science
Berlin :Springer-verlag berlin
TRANSACTIONS ON ASPECT-ORIENTED SOFTWARE DEVELOPMENT XII
13th International Conference on Modularity (Modularity), APR 22-25, 2014, Lugano, SWITZERLAND
, p. 3-59
University of Antwerp
In object-oriented languages, a notion of behavioural subtyping is needed to enable modular reasoning. This is no longer sufficient when such languages are extended with aspects. In general, all aspects need to be inspected in order to understand the behaviour of a single method or proceed call, which complicates reasoning about aspect-oriented programs. In this paper, we present an approach to modular reasoning that consists of two parts. First, the advice substitution principle, based on behavioural subtyping, identifies when it is possible to remain unaware of an advice while preserving modular reasoning. Second, in cases where it is undesired or impossible to be unaware of an advice, a simple specification clause can be used to restore modular reasoning and to become aware of this advice. We show that our approach effectively enables modular reasoning about pre- and postconditions in a minimal aspect-oriented language called ContractAJ. To ensure the approach is used correctly, we also provide a runtime contract enforcement algorithm that is specified in ContractAJ, and implemented in AspectJ.