Using Rational PureCoverageWith PureCoverage, you can ensure that all of your code is exercised in a few easy steps:
To monitor code coverage for an application, launch PureCoverage from the Start menu. Then click Run in the PureCoverage Welcome Screen to display the Run Program dialog. Java programmers: Click the Program name browse button and select your class or HTML file. PureCoverage automatically inserts the correct information in the Run Program dialog. For complete instructions, including the additional options that are available to you, look up java in the PureCoverage online Help index. Visual Basic programmers: Specify the native-code program (compiled using Visual Basic 5.0 or later) you want to test. For a p-code program (compiled using Visual Basic 6.0), type Cstart.exe as the program name and specify the p-code program you want to test in Command-line arguments. For complete instructions, including the additional options that are available to you, look up visual basic in the PureCoverage online Help index. For Visual C++ and Visual Basic native-code programs, PureCoverage first copies the program and each component it calls, then instruments the copies using Object Code Insertion (OCI) technology. The instrumentation process inserts additional code that permits PureCoverage to identify the parts of your program that are executed during a run. For Visual Basic 6.0 projects and p-code programs, and for Java code, PureCoverage doesn't instrument the code, but instead uses Cstart.exe to monitor procedures or methods directly. PureCoverage caches all instrumented components. When you rerun a program, PureCoverage saves time by using the cached files, reinstrumenting only the ones that have changed since the previous run. The Coverage Browser and Function List windows show you the overall coverage status of your program at a glance:
With this information, you can easily identify testing hot spots - major areas that your tests have not covered. The Coverage Browser window provides coverage
data organized hierarchically according to source file.
The Function List window provides a textual,
non-hierarchical view of the same data. You can do full-program sorts in
the Function List window to find the least tested components in your entire
program.
More information? To learn how to customize the data display, look up coverage browser window and function list window in the PureCoverage online Help index. Focusing coverage data with filters PureCoverage collects coverage information for every module in your program, but, by default, does not display all the data it collects. In order to highlight the coverage information that you are most likely to find interesting, PureCoverage applies a default filter set to hide the data for certain system and third-party components of your program. To see the data that PureCoverage has filtered out, or to change the
filtering to display other information that concerns you, click the Filter
Manager tool to open
the Filter Manager dialog.
More information? Look up filters in the PureCoverage online Help index. PureCoverage displays line-by-line coverage data as annotations in a
copy of your source file. Double-click a function, procedure, or method
in the Coverage Browser or Function List window to display the code in
the Annotated Source window.
By default, PureCoverage displays untested lines in red, tested lines in blue, and dead lines (typically in functions, procedures, or methods for which no active call is present in the code) in black. PureCoverage displays partially tested multi-block lines in pink. These lines often occur in conditional expressions for which you haven't tested the entire range of possible values. You can ensure that multi-block lines are fully tested by using the QuickWatch dialog in Visual Studio or by using an Immediate window in Visual Basic. With the program running, type in the name of the partially tested function or procedure and supply the parameter values you still need to test. More information? Look up annotated source window and colors, using in the PureCoverage online Help index. For help with the QuickWatch dialog or the Immediate window, see your Visual Studio or Visual Basic documentation. Now you know what sections of code you missed when you exercised the program. If you're running the program informally, consider how you can exercise the code that you missed previously. If you're working with a test suite, you can add or adjust test scripts to improve coverage. In either case, with the information PureCoverage provides, you're working with your eyes open. You know what parts of your code need to be covered - no guesswork. Now test again, and check your results. Check not only the coverage
data for the new run, but also the Auto Merge data. The Auto Merge data
is a composite of the coverage data from the new run and any available
previous runs of the program.
You can also merge data for specific runs manually. More information? Look up merging runs in the PureCoverage online Help index. For information about merging data from a series of tests automatically, read "Integrating PureCoverage in your test environment." PureCoverage saves you time during testing by making it easy to share information with other team members. To save data, and share information, click the Save Copy As tool to save data. PureCoverage supports two data formats:
More information? Look up saving data in the PureCoverage
online Help index.
|
Copyright © 1999, 2001 by Rational Software Corporation. All rights reserved. |