AOP Metrics

Measuring Aspect-Oriented Software In Practice

View the Project on GitHub ozlerhakan/aop-metrics

Master Thesis: Measuring Aspect-Oriented Software In Practice

Analytics


Abstract. Aspect-oriented programming (AOP) is a way of modularizing a software system by means of new kind of modules called aspects in software development. To this end AOP helps in alleviating crosscutting concerns of system modules by separating into several aspect modules, thereby aiming to improve separation of concerns. On the other hand, aspects can bring unexpected behaviour to a system while attempting to alter the system’s concerns. They can modify the behaviour of the base system without warning. Following to this, such impact can limit to achieve modular reasoning in an aspect-oriented system properly.

Obtaining the valuable data, we try to get an idea of how difficult it is to achieve modular reasoning. In this thesis, we analyse the existing ten AspectJ systems by answering six research questions. These six questions were derived from our general question: "how AspectJ is used in practice?". In order to answer each one of them, we have implemented a metrics suite including both aspect-oriented and object-oriented features using Ekeko. Next to modular reasoning, we also acquire other usefulness about AOP constructs and coupling between classes and aspects. These results can then be used to influence the design of existing or new AOP languages, or to improve existing analysis tools of AOP.

Hierarchy of the research questions


  1. How large is the system?
  2. How often are AOP constructs used compared to OOP features?
  3. Which AOP constructs are typically used?
    • Inherited Aspects (InA)
    • Singleton Aspects (SA)
    • Non-Singleton Aspects (nSA)
    • Advice-Advanced Pointcut Dependence (AAP)
    • Advice-Basic Pointcut Dependence (ABP)
    • Number of Around Advice (NOAr)
    • Number of Before/After Advice (NOBA)
    • Number of After Throwing/Returning Advice (NOTR)
    • Number of Call (NOC)
    • Number of Execution (NOE)
    • Adviceexecution-Advice Dependence (AE)
    • Number of Wildcards (NOW)
    • Number of non-Wildcards (NOnW)
    • Argument size of Args-Advice (AAd)
    • Argument size of Args-Advice-args (AAda)
  4. How many types and members of a system are advised by AOP?
    • Percentage of Advised Classes (AdC)
    • Percentage of non-Advised Classes (nAdC)
    • Number of Advised Methods (AdM)
    • Number of non-Advised Methods (nAdM)
    • Classes and Subclasses (CsC)
    • Average of Subclasses of Classes (ScC)
  5. Is there a connection between the amount of coupling in an aspect, and how many shadows it advises?
    • Advice-Join Point Shadow Dependence (AJ)
    • Number of thisJoinPoint/Static (tJPS)
    • Number of Modified Args (MoA)
    • Number of Accessed Args (AcA)
    • Around Advice - non-Proceed Call Dependence (AnP)
  6. How many dependencies are there between classes and aspects?
    • Attribute-Class Dependence (AtC)
    • Advice-Class Dependence (AC)
    • Intertype-Class Dependence (IC)
    • Method-Class Dependence (MC)
    • Pointcut-Class Dependence (PC)
    • Advice-Method Dependence (AM)
    • IntertypeMethod-Method Dependence (IM)
    • Method-Method Dependence (MM)
    • Pointcut-Method Dependence (PM)

Have a look at an example


One of the questions we examine is: how many aspects extend to an abstract aspect in a given aspect-oriented project?

The Metric representation of the question is: the number of inherited aspects in a given aspect-oriented project.

 (defn NOInheritedAspects [?aspectname ?abstractname]
         (l/fresh [?aspect ?source ?super]
                   (NOAspects ?aspect ?source)
                   (w/aspect-declaredsuper ?aspect ?super)
                   (equals ?aspectname (str "Aspect {"(.getSimpleName ?aspect)"}"))
                   (equals ?abstractname (str "From Abstract Aspect -> "(.getSimpleName ?super)))
                   (succeeds (.isAbstract ?super))))

Selected aspect-oriented systems


  1. HealthWatcher
  2. HyperCast
  3. AJHotDraw
  4. AJHSQLDB
  5. Contract4J5
  6. MobileMedia
  7. iBatis
  8. Telestrada
  9. SpaceWar
    • Comes bundled with the AJDT
  10. TetrisAJ

Some charts mentioned in this thesis


All the related charts are available in Thesis Text/diagrams.

How the metrics work


First of all, make sure that you have all the dependencies about the Ekeko plug-in in your Eclipse Luna 4.4 IDE, if not, you first need to download the dependencies:

Downloading the dependencies, you are now ready to install the prebuilt Ekeko plug-in:

:pushpin:Note: The AcA and MoA metrics need different soot arguments to obtain the exact data. Thus, you need to change the current arguments with the following one: -no-bodies-for-excluded -src-prec c -f jimple -keep-line-number -app -w -p jb use-original-names:true -p cg.cha and run again Ekeko Soot Analyses.

:exclamation:One Potential Issue: There was an encountered issue about soot analysis. If you get the same problem called RuntimeException : tried to get nonexistent method, while attempting to run the metrics especially for the AM, IM, and MM metrics. You can find more information on it from https://github.com/ozlerhakan/aop-metrics/issues/1

License

Copyright © 2014 Hakan Özler.