Databases Reference
In-Depth Information
the call site of FC a and terminates either at the end of the enclosing method
body or at a node in EFG whose outgoing edges are all normal edges. We
generate such traces from code examples and input application for each FC a
2 FCS. We next identify method calls in FC 1 c ...FC n c or FC 1 e ...FC m e that are
not related to FC a through data-dependency, and remove such method calls
from each trace. Failing to remove such unrelated method calls can result in
many false positives due to frequent occurrences of unrelated method calls.
For example, in the trace shown in Figure 10.5(b), method calls in the normal
method-call sequence related to Nodes 4 and 5 are unrelated to the FC a
of Node 7. Similarly, Node 17 in the exception method-call sequence is also
unrelated to FC a .
Figure 10.5(c) shows an example of our data-dependency analysis. Ini-
tially, we generate two kinds of relationships: var dependency of a variable
and method association of a method call. The var dependency of a variable
represents the set of variables on which a given variable is dependent upon.
Similarly, a method association of a method call represents the set of variables
with which a method call is associated. First, we compute the var-dependency
relationship information from assignment statements. For example, in Scenario
2, we identify that the variable res is dependent on the variable stmt from
Line 2.8 and is transitively dependent on conn as stmt is dependent on conn
from Line 2.7. We compute the method-association relationship based on the
var-dependency relationship. In particular, we identify that a method call is
associated with all its variables including the receiver, arguments, and the
return variable, and their transitively dependent variables. For example, ap-
plying the preceding analysis to the method call of Node 7, we identify that
the associated variables are conn and stmt . We use variables associated with
each method call to identify method calls in the normal method-call sequence
FC 1 c ...FC n c or the exception method-call sequence FC 1 e ...FC m e that are not
related to FC a . Starting from FC a , we perform a backward traversal of the
trace to filter out method calls in FC 1 c ...FC n c and a forward traversal to filter
out method calls in FC 1 e ...FC m e . Assume that variables associated with FC a
are fV 1 a , V 2 a ,:::, V s a g. Assume that variables associated with a method call, say
FC k ce , in the normal or exception method-call sequence are fV 1 ce , V 2 ce ,:::, V t ce g.
In each traversal, we compute an intersection of associated variable sets of
FC a and FC k ce . If the intersection fV 1 a , V 2 a ,:::, V s a g\fV 1 ce , V 2 ce ,:::, V t ce g6= ,
we keep the FC k ce method call (either in the normal or exception method-call
sequence) in the trace; otherwise, we filter out the FC k ce method call from the
trace. The rationale behind our analysis is that if the intersection is a non-
empty set, it indicates that the FC a is directly or indirectly related to the FC k ce
method call. For example, the intersection of associated variables for Nodes
6 and 7 is non-empty. In contrast, the intersection of associated variables for
Nodes 5 and 7 is empty. Therefore, we keep Node 6 in the trace and filter
out Node 5 during backward traversal. Similarly, during forward traversal, we
ignore Node 17 since the intersection is an empty set. The resulting trace of
\4,5,6,7,15,16,17" is \6,7,15,16," where
 
Search WWH ::




Custom Search