Measuring Aspect-Oriented Software In Practice
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.
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))))
All the related charts are available in Thesis Text/diagrams.
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:
Help > Install New Software...
in your Eclipse IDE.Configure > Include in Ekeko Queries
The metrics also need soot analyses in order to run properly. To do that, we need to configure the selected AspectJ project once as follows:
Properties > Ekeko properties
.-no-bodies-for-excluded -src-prec c -f jimple -keep-line-number -app -w -p cg.cha
right-click the project > Configure > Enable Ekeko Soot Analyses
.Activate an Ekeko-hosted REPL by doing Ekeko > Start nRepl
from the main Eclipse menu. A dialog shows the port on which the nRepl server listens (e.g. nrepl://localhost:51721
)
Window > Connect to REPL
to connect to this port (i.e. nrepl://localhost:51721
). A Counterclockwise REPL view now opens.aopmetrics/metrics.clj
file and right-click somewhere on the file and choose Clojure > Load file in REPL
. After obtaining #'aopmetrics.metrics/AcA
in the REPL, follow the second step.aopmetrics/core.clj
file and right-click somewhere on the file and choose Clojure > Load file in REPL
.
nil
in the REPL which means that everything goes correctly and the metric framework has likewise been loaded in the REPL.(metrics/VSize)
, the alias name of our AOPMetrics
is metrics
that helps in reaching the implemented metrics in a short way rather than typing the totally qualified name (i.e. AOPMetrics
). metrics/Vsize
simply retrieves the vocabulary size of the project.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
.
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
Copyright © 2014 Hakan Özler.