Databases Reference
In-Depth Information
aspect CallTracing {
pointcut tracedCall(): call(!
**(..)) || call(
(..));
before(): tracedCall() {
CallLogger.addCall(...);
}
after() returning(Object retVal): tracedCall() {
CallLogger.addReturn(...);
}
after() throwing:tracedCall() {
CallLogger.addReturn(...);
}
}
FIGURE 4.6: Skeleton of the aspect used to instrument programs so that
they log method calls and returns.
be executed only once, making the slowdown caused by the instrumentation
negligible.
4.3.2 Specification Inference
The specification inference tool is implemented in Scala. It consists of dif-
ferent modules that roughly reflect the structure depicted in Figure 4.2. For
analyzing the static structure of classes, for instance in the collaboration trans-
former that generalizes types (Section 4.2.3.1), we use the Java reflection facil-
ities. The internal representation of FSMs is based on the dk.brics.automaton
library [27].
All inferred API usage protocols are written into a specification database.
This allows us to easily accumulate protocols from different programs over
time. Moreover, we merge protocols from different programs when they con-
tain exactly the same states and transitions by adding the weights of each
pair of matching transitions. The specification database supports different
output formats, such as DOT files [2], a textual representation of protocols,
and different summaries of the inferred protocols.
4.4 Experiments
We evaluate our analysis by applying it to several real-world Java programs
that overall produced around 280 million runtime events. This section presents
our results, which where driven by the following research questions:
 
Search WWH ::




Custom Search