Using PureCoverage power features

 

PureCoverage collects a detailed set of coverage data for your program and every component it uses. With this data, you can have confidence that the program you're testing has been exercised -- every line, every function, procedure, or method -- before you release it to your customers. That's what makes PureCoverage an essential tool for your development and testing cycles. 

Right from the start, PureCoverage gives you the information -- accurate, complete, and immediately usable code-coverage information -- that you need to evaluate your tests and pinpoint the parts of your code that are not tested. PureCoverage also provides powerful features that help you make maximum use of the coverage data -- and of your time. For example, you can: 

This section gets you started using these features to monitor your code more efficiently, and to focus on untested sections of code quickly and easily. 

Integrating PureCoverage with your development desktop  

PureCoverage’s integration—for example with Microsoft Developer Studio, Microsoft Visual Basic, Rational Visual Test®, Rational Robot, and Rational ClearQuest—puts powerful coverage data within easy reach while you develop and test your code using your favorite tools. 

During installation, a PureCoverage menu and toolbar are automatically added to Developer Studio and Visual Basic so you can monitor your code at any time during development, without leaving your development environment. 
 
click to enlarge 
 
If you have Visual Test or Robot installed, you can run a test script for a program and monitor the program at the same time, without leaving Visual Test or Robot. With ClearQuest, you can submit a coverage defect, and attach a PureCoverage data file (.cfy), as soon as you find untested code, without leaving PureCoverage. 

More information? Look up integrating in the PureCoverage online Help index. 

Fine-tuning data collection  

Using the PureCoverage PowerCov™ options, you can fine-tune the level of code coverage reported for any module in your program at any stage of development and testing. You can set default settings that apply to all programs. You can also assign settings that apply only to the current program. 
 
click to enlarge 

To concentrate on specific modules in your code, use PowerCov options to select Line as the coverage level for only those modules. You can improve instrumentation and runtime performance by selecting Function as the coverage level for the other modules. Or you can exclude modules from coverage. 

More information? Look up settings, overview and coverage levels, overview in the PureCoverage online Help index. 

Zeroing in on key program areas  

With PureCoverage, you can capture coverage data for your entire program or for any section of it. You can capture coverage information for specific sections using: 

  • Interactive snapshots 
  • PureCoverage API functions 
Taking interactive snapshots  

Using PureCoverage, you can take snapshots of coverage data for individual routines as you exercise your program. 
 
click to enlarge  

More information? Look up snapshots and run summary window in the PureCoverage online Help index. 

Using PureCoverage API functions  

PureCoverage includes a set of Application Programming Interface (API) functions that give you additional control over the collection of coverage data. You can use them to start and stop data collection or to save data at any time during a run, collecting only the coverage data you need to focus on a specific area of your program. 

You can call PureCoverage API functions from your program, from the QuickWatch dialog in Developer Studio, or from whatever debugger you're using. 

More information? Look up api functions, using in the PureCoverage online Help index. 

Integrating PureCoverage in your test environment  

Integrating PureCoverage with your test environment gives you a powerful tool for continuous coverage monitoring. For example, you can easily run PureCoverage from an existing test script by adding the command: 

    coverage /SaveTextData exename.exe
to run your program under PureCoverage. The /SaveTextData option generates coverage data in text-file format, without the graphical interface. You can incorporate the information from this file into your test results report. 

PureCoverage can also merge coverage data from multiple runs. Say you're running a series of automated tests on a program, each time using a different set of data. You can modify the script to merge the coverage data into a single file. Add the following line to the beginning of your test script: 

    del Exename_AutoMerge.cfy
to delete any existing Auto Merge files. 

Then, each time you run your program, substitute the following for the run command: 

    coverage /SaveMergeData /SaveMergeTextData exename.exe
This command merges the coverage data from all runs of the program and saves it to a PureCoverage data file, Exename_AutoMerge.cfy, and to an ASCII text file, Exename_AutoMerge.txt

Java and Visual Basic programmers: For Java code and Visual Basic p-code programs (Visual Basic 6.0 only), PureCoverage uses Cstart.exe, a helper program installed with PureCoverage in its product directory, to directly monitor methods and procedures. You can add the following lines to have a test script monitor a Java applet or p-code program, respectively, and save the data to a .txt file: 

coverage /SaveTextData cstart jview /p /a example1.html 

 or 

 coverage /SaveTextData cstart exename.exe 

More information? For more details, and additional command-line options, look up command line and scripts in the PureCoverage online Help index. 

If you have Rational Visual Test or Rational Robot installed, you can run a test script for a program and monitor the program at the same time, without leaving Visual Test or Robot. 

More information? Look up visual test and robot in the PureCoverage online Help index. 


 

Now you're ready to put PureCoverage to work. Remember that the online Help contains detailed information to assist you. 


Back | Index | Table of contents


Copyright © 1999 by Rational Software Corporation. All rights reserved.