Phase 5 Instructions
Installation
Same as for phase 4: download phase5.tar
in "project", untar. This time there are two scripts: run1 and run2;
edit both to set the root.
Set up the test harness
Edit file phase5/myharness/config.java: change
the value of srcdir to point to your phase5 directory. Compile the harness: cd
phase5; javac myharness/*.java.
Run RTA infrastructure
Compile all java files (cd phase5; javac
*.java). Inside "run1", run RTA on the three sample components. (There is no
need to generate JIMPLE, it is already included in phase5.tar.gz.) In the
script, runRTA invokes the implementation of RTA in classes RtaMain,
RtaAnalysis, RtaWriter, etc. Right now, RtaAnalysis simply implements CHA. You
have to change it to implement RTA.
Run the current implementation on p5, p7, and p8. Examine carefully output
files rmethods.cut, edges.cut, and calls. Consider the JIMPLE for these programs
and determine by hand how the output files should look like if you were to run
RTA instead of CHA.
Implement and test RTA
Print and read the code in RtaAnalysis very
carefully. Make the necessary changes to implement RTA. Run your implementation
on p5, p7, and p8, and make sure that output files rmethods.cut, edges.cut, and
calls are correct.
Run the tests
Run the test drivers for the 4 "real" components through
runOriginal inside "run2". The output may look something like "PASS: ...." -
this shows that a test has passed. There is not need to compile the components —
the bytecode is included in phase5.tar.gz
Run RTA
Run your implementation of RTA on the 4 real components.
Examine the output files for component "sample" and make sure that they are
correct. (Note: there is no need to run genJimple before RTA, the .jimple files
are already included in phase5.tar.gz).
Insert instrumentation
Use your implementation of MyTransformer from
phase4 to create the instrumentation for the two kinds of beforeCall
invocations. (The version of MyTransformer in phase5.tar.gz only insert
instrumentation at method entries.) Generate the instrumented code for the
components in "run2" and examine the JIMPLE files in CLASSES for correctness.
Note: If you rerun addInstrumentation after you have started
making changes to RuntimeTracker, Soot may complain about "phantom classes" or
"type inference failed". This is due to a small problem in the infrastructure
that I haven't had the time to fix. If this happens, run addInstrumentation with
the original RuntimeTracker downloaded from the web site, not with your own
modified version of RuntimeTracker. Of course, when you do runInstrumented, you
will use your own RuntimeTracker.
Run tests
Run runInstrumented to observe the effects of the
instrumentation on the 4 components from "run2". Right now, only some printing
is done. Use your own version of RuntimeTracker from phase4 to create files
nmethods and nedges, similarly to what was done in phase4.
Submit the results
- tar the phase5 directory and email the tar file to me.
- The only files I really need are the .java files
and nmethods/nedges.
Create a table
Use latex, MS Word, etc. to create a table with the
results, and turn it in on April 27. The table should have the following
format:
| Component |
CUT Classes |
CUT Methods |
UnreachCM |
CovReachCM |
NcovReachCM |
CUT Edges |
NcovCE |
| sample |
|
|
|
|
|
|
|
| gzip |
|
|
|
|
|
|
|
| zip |
|
|
|
|
|
|
|
| collator |
|
|
|
|
|
|
|
The table contains
- Number of CUT classes
- Number of all methods in CUT classes
- Number of RTA-unreachable CUT methods (UnreachCM), as absolute value and
as percentage of the total number of CUT methods
- Number of RTA-reachable test-covered CUT methods (CovReachCM), as absolute
value and as percentage of the total number of CUT methods.
- Number of RTA-reachable test-not-covered CUT methods (NcovReachCM), as
absolute value and as percentage of the total number of CUT methods. (Note:
UnreachCM + CovReachCM + NcovReachCM = 100%)
- Number of CUT edges (as computed by RTA)
- Number of test-not-covered CUT edges (NcovCE), as absolute value and as
percentage of the total number of CUT edges.
Additional Resources