Information Technology Reference
In-Depth Information
Tabl e 1. Typestates properties used in our experiments
Property Name Description
FailSafeEnum do not update a vector while iterating over it
FailSafeEnumHT do not update a hash table while iterating over its elements or keys
FailSafeIter
do not update a collection while iterating over it
FailSafeIterMap
do not update a map while iterating over its keys or values
HasNextElem
always call hasMoreElements before calling nextElement on an Enu-
meration
HasNext
always call hasNext before calling next on an Iterator
Reader
do not use a Reader after its InputStream is closed
Writer
do not use a Writer after its OutputStream is closed
We conducted all the experiments on a Server with 256GB memory and four
2.13GHz XEON CPUs.
5.1 Experiment Results
To justify the effectiveness of our optimizations, we use original NSA as the
baseline for our experiments. Table 2 shows the results of our optimizations, and
the cases on which optimizations have no effect are not listed. The forth column
( Opt1 ) shows the number of remained shadows after using the first optimization,
i.e. , identifying changeless configurations generated from backward analysis. For
4 out of 23 combinations (17.4%), our optimized analysis can further identify
removable shadows after the original NSA. In one case ( FailSafeIterMap +
bloat ), the shadows removed by the optimized analysis are twice more than the
shadows removed by the original NSA.
The fifth column ( Opt2 ) of Tables 2 shows the number of the shadows that
remain after using the optimization based on local object information. For 10
out of these 23 combinations (43.5%), the optimized NSA can further remove
shadows after the original NSA. In two cases ( FailSafeEnum + fop and Fail-
SafeIter + luindex ), the optimization can remove all the shadows that remain
after the original NSA. Hence, the optimized NSA by local object information
can give the static guarantee that the program satisfies the typestate property
in each of these two cases. Furthermore, for 5 out of these 10 cases (50%), the
optimized analysis can further remove more irrelevant shadows than the original
one. Especially, in two cases ( FailSafeEnum + fop and FailSafeEnumHT +
jython ) out of these 5, the original NSA cannot remove any shadow.
The last column of Tables 2 shows the results of the combination of two
optimizations, i.e. , optimizing by local object information first and then by re-
moving changeless configurations. For 13 out of these 23 combinations (56.5%),
the combined optimized analysis can further identify “nop shadows” after the
original NSA. In one case ( FailSafeIter + bloat ), the two optimizations both
have positive effects and identify different “nop shadows” respectively. Inter-
estingly, compared to perform these two optimizations after the original NSA
 
Search WWH ::




Custom Search