Extending Design by Contract for Aspect-Oriented Programming

David H. Lorenz, Northeastern University
Therapon Skotiniotis, Northeastern University

Design by Contract (DbC) and runtime enforcement of program assertions enables the construction of more robust software. It also enables the assignment of blame in error reporting. Unfortunately, there is no support for runtime contract enforcement and blame assignment for Aspect-Oriented Programming (AOP). Extending DbC to also cover aspects brings forward a plethora of issues related to the correct order of assertion validation. We show that there is no generally correct execution sequence of object assertions and aspect assertions. A further classification of aspects as agnostic, obedient, or rebellious defines the order of assertion validation that needs to be followed. We describe the application of this classification in a prototyped DbC tool for AOP named Cona, where aspects are used for implementing contracts, and contracts are used for enforcing assertions on aspects.

Technical Report NU-CCIS-04-14, College of Computer and Information Science, Northeastern University, September 2004. This research was partially supported by the National Science Foundation under award number CCR-0204432.


NU-CCIS-04-14.ps.gz ()
NU-CCIS-04-14.pdf ()


@TechReport{Lorenz:2004:EDC,
    Title       = {Extending Design by Contract for Aspect-Oriented Programming},
    Author      = {David~H. Lorenz and Therapon Skotiniotis},
    Number      = "{NU-CCIS-04-14}",
    Institution = "College of Computer and Information Science, Northeastern University",
    Address     = "Boston, MA 02115",
    Month       = sep,
    Year        = 2004,
    URL         = "\url{http://www.ccs.neu.edu/home/lorenz/papers/reports/NU-CCIS-04-14.html}",
    Note        = "{\em CoRR\/}, cs.DB/0501070, 2005",
}
@Article{Lorenz:2005:EDC,
 Author = {David~H. Lorenz and Therapon Skotiniotis},
 Title = {Extending Design by Contract for Aspect-Oriented Programming},
 Journal   = {CoRR},
 Volume    = {cs.DB/0501070},
 Year      = 2005,
}

Other papers