Databases Reference
In-Depth Information
of related objects, two calls are considered to be related if they share at
least one related object.
Second, the analysis extracts subsets of calls so that within each subset,
all calls are directly or indirectly related to each other. The relations bet-
ween calls can be thought of as a graph, where calls are nodes and edges
denote a dataflow relation between them. To extract dataflow-related
subsequences of calls, our analysis computes connected subgraphs of
this graph.
For the example in Figure 4.5, the highlighted calls are dataflow-related
as they all share the same callee. As a result, the analysis will put them into
a separate collaboration. Dataflow filtering transforms one collaboration into
one or more collaborations.
This concludes the description of four collaboration transformers that our
analysis employs to focus on method call sequences that expose typical API
usage. The order in which transformers are applied to collaborations can influ-
ence the result. For instance, generalizing types may change the callee package
of certain calls, which again influences the package-based filtering. Our anal-
ysis repeatedly applies transformers in the order of their description in this
chapter until the set of transformed collaborations stabilizes.
4.2.4 Extracting Collaboration Patterns
The preceding parts of our analysis yield a set of object collaborations, of
which each contains several API method calls. In the following, we explain
how to identify recurring API usage patterns, called collaboration patterns,
within this set of collaborations. Extracting collaboration patterns proceeds
in two steps. At first, the analysis summarizes collaborations into patterns
by comparing the roles that objects play. Afterward, the analysis removes
infrequent patterns to ignore incidental call sequences and uncommon API
usage patterns.
4.2.4.1
Summarizing Frequent Collaborations
To learn common API usage protocols, we need to identify call sequences
that are similar but may expose different orders of calls. Comparing conceptu-
ally similar collaborations, we observe that the involved objects often require
the same methods. Exploiting this observation, we map collaborations into
patterns as follows:
Definition 3. Collaboration pattern. Two collaborations belong to the same
collaboration pattern if their objects play the same roles and have the same
types. That is, given two collaborations with object sets O 1 and O 2 , they belong
 
Search WWH ::




Custom Search