Tool Mentor: Measuring and Evaluating Code-based Test Coverage on Rational RobotTM Scripts Using Rational TestFactoryTMPurposeThis tool mentor describes how to use Rational TestFactory to measure and evaluate code-based test coverage for Robot scripts that test an application written in C++, Java, or Visual Basic, or that test a Java applet. Related Rational Unified Process activities:
OverviewYou can use Rational Robot to implement test procedures, and then execute the resulting test scripts. Code-base test coverage data is not available, however, when you execute the test scripts in Robot. Rational TestFactory has the capability of calculating code-based coverage metrics for Robot test scripts. This Tool Mentor is applicable when running Windows 95/98/2000/NT 4.0. To use TestFactory to evaluate code-based test coverage for Robot scripts:
1. Record or program test
scripts in Robot
To record or program test scripts in Robot, see Tool Mentor: Creating Test Scripts Using Rational Robot. Note: For TestFactory to calculate code-based coverage data successfully for Robot scripts, each script must start and stop the application-under-test (AUT).
2. Execute the Robot scripts in
TestFactory
To measure code-based coverage of an executed script, the code of the application-under-test (AUT) must contain instrumentation points. The instrumentation points are counters that tally the parts of the code that a script executes. In TestFactory, you can instrument either the object code or the source code of the AUT. Regardless of the instrumentation method you use, TestFactory maintains the integrity of your original source files or executable file. When you execute test scripts in TestFactory, two actions occur:
3. Review code-based
coverage data for each script
After you execute Robot scripts in TestFactory, the code-based coverage data is available for you to review. For each script, TestFactory displays an overall code-based coverage valueùfor both the application (or applet) and all the additional instrumented files that the application (or applet) calls. TestFactory also displays coverage information for each file and subroutine in the application. TestFactory calculates the code-based test coverage value as the percent of the source code that a test script touches, relative to all the source code in the application-under-test. If you have access to the source files for the application-under-test, you can use the Coverage Browser in TestFactory to review the lines of source code that each script coveredùexamining which source statements were executed and which were not. You can also view the combined code-based coverage data for two or more Robot scripts.
|
Rational Unified
Process |