Purpose

This 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:

Overview

You 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.
  2. Execute the Robot scripts in TestFactory.
  3. Review code-based coverage data for each script.

1.   Record or program test scripts in Robot To top of page

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).

Help icon   Refer to the following topic in TestFactory Help:

  • Viewing code coverage for a Robot script

2.   Execute the Robot scripts in TestFactory To top of page

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:

  • TestFactory passes each script to Robot to execute.
  • As a script executes, TestFactory monitors the instrumentation points in the code to tally the code-based coverage information.

Help icon   Refer to the following topics in TestFactory Help:

  • Specifying information for a new project
  • Instrumenting the application-under-test
  • Run a single script

3.   Review code-based coverage data for each script To top of page

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.

Help icon   Refer to the following topics in TestFactory Help:

  • Review coverage results for a script
  • View combined code coverage for multiple scripts
  • Code coverage for scripts in a Java application or applet
Copyright  ⌐ 1987 - 2000 Rational Software Corporation

Display Rational Unified Process using frames

Rational Unified Process