Using Class Interfaces and Mock Objects to Unit Test Aspects

  • Michael Bryan Snider

    Student thesis: Doctoral ThesisDoctor of Philosophy

    Abstract

    In object oriented programming (OOP) class objects are individual units of code that encapsulate the desired functionality of each object. AOP is an attempt to handle the cross-cutting concerns that represent functionality needed by a class, but is not specific to that class. The cross-cutting functionality is implemented in AOP by using a class-like structure, the aspect. Aspects do not have their own context and as such are dependent upon other objects for their context. By not having their own context it is difficult to test the functionality of aspects. This study investigated the effectiveness of using class interfaces and mock objects to unit test aspects. This was accomplished by having the mock object inherit from the same interface as the base code, so that the mock object could be swapped in for the aspect.
    Date of AwardOct 7 2014
    Original languageEnglish
    SupervisorFrank J. Mitropoulos (Supervisor), Sumitra Mukherjee (Advisor) & Michael J Laszlo (Advisor)

    Cite this

    '