background image
<< Viewing Coverage Results for a Script | The Coverage Browser >>
<< Viewing Coverage Results for a Script | The Coverage Browser >>

Viewing Code Coverage Information

Examining Pilot Run Results
Viewing Code Coverage Information for Scripts Generated for
Java Applications and Applets
The code coverage information calculated for scripts generated for Java applications
and applets differs from code coverage information for scripts generated for C++
and Visual Basic applications. If the AUT is written in Java, TestFactory builds the
coverage dictionary during the testing process rather than during instrumentation.
Java .class files reveal themselves to TestFactory only after a script touches the code
contained in the .class file.
If the AUT is a C++ or Visual Basic application, the code coverage value for a best
script represents the percentage of all source code in the AUT that the script touched.
TestFactory "knows" the total amount of source code in the AUT before you run a
Pilot. If the AUT is a Java application or applet, TestFactory finds out about the total
amount of source code incrementally, through testing. As a result, the code coverage
values for best scripts run against an AUT written inJava are calculated relative to the
.class files exposed so far. This means that code coverage values can be artificially
high, especially for the first few Pilots you run. As you run more Pilots to test
different functional areas of a Java AUT, the coverage dictionary becomes more
complete, and code coverage values for scripts become more realistic.
Instrumenting a new build of a Java AUT deletes the current coverage dictionary. To
rebuild the coverage dictionary, you must rerun the scripts that expose the Java
.class files.
The Coverage Browser (C++ and Visual Basic Applications)
If the AUT is written in Visual Basic or C++ and you instrumented it before you
ran a Pilot (or you have a coverage dictionary and access to the instrumented Visual
Basic source files), then you can open the Coverage Browser and view the source
code that a script exercised.
NOTE: TestFactory does not open Java .class files in the Coverage Browser.