Databases Reference
In-Depth Information
TABLE 12.2: Results Obtained on the Sample Projects Used for Evaluation
# Violations
Project
Total
Investigated
Defects
Code smells Accuracy
AspectJ 1.5.3
216
54
2
13
27%
GMyth 0.7.1
11
3
1
1
66%
Note: For both projects we ranked the violations found and
investigated top 25% of them.
list=gmyth_string_list_new();
str=g_string_new(...);
gmyth_string_list_append_string(list,str);
g_string_free(str);
g_object_unref(list);
One of the functions in GMyth violates this specification by not calling
gstringfree() , which causes both sequential constraints with this call in-
side to be missing from this function's sequential constraints abstraction. The
result of this is that the violating function contains a memory leak.
Table 12.2 summarizes the results we obtained by analyzing AspectJ 1.5.3
and GMyth 0.7.1. We ranked the violations and then investigated the top
25% of them for each project. As we can see, there were a lot more violations
detected for large AspectJ than for small GMyth. Accuracy (i.e., the percent-
age of true positives amongst the investigated violations) differs very much
between the two projects, but it is decent for both of them. Investigating 54
violations to find 15 code issues (including 2 defects) seems quite productive,
not speaking about 2 code issues (including 1 defect) found by investigat-
ing just 3 violations for GMyth 0.7.1. Overall, we can see that despite very
lightweight and programming-language-independent parsing, the approach is
still accurate enough to nd real defects, and { as the paragraphs above have
shown { some quite subtle defects, too.
12.8 Scaling to Multiple Projects
The results shown above are based on single-project analysis: Specifications
are mined from one single project, which is then investigated for violations.
One drawback of such an approach is that some APIs are used very rarely
and analyzing one project is not enough to mine any specifications for them.
However, the approach described in this chapter is not inherently limited to
one project at a time. As described in Section 12.5, specifications are found
 
Search WWH ::




Custom Search