Test Data Optimization. Compuware Code Coverage
Xpediter/Code Coverage helps you understand the quality of your code and make sure the tests you run are thorough enough to cover every part of it. You'll be able to see which parts of the code are being exercised by your testing, and which are not. This will allow you to fix any potential problems before your application goes live and prevent any costly errors that could disrupt your operations.
Advertisement
Advertisement
9-1
Chapter 9.
Test Data Optimization
Whenever you have changes to program code, you can run one of Compuware’s mainframe debuggers in conjunction with Code Coverage to make sure a significant percentage of your program is still executing properly. Some users feed large volumes of data into an application, hoping to achieve the desired percentage of statements executed. It’s possible that not all of those input records are really necessary for a thorough test. If you could identify the ideal subset of records that would most thoroughly drive the different paths through a program, you could save all the wasted time and resources consumed by testing with vast quantities of data.
Code Coverage’s Test Data Optimization (TDO) identifies records that are “active” when statements are first marked executed. For programs in which the paths taken are determined by data content on a current input record, TDO can help identify an optimized subset of records that yield an acceptable execution percentage. Testing with this subset of records can significantly reduce execution time and conserve resources.
Collecting TDO Information
TDO information can only be collected during an Xpediter/TSO or Xpediter/IMS test for a program with Code Coverage active. TDO requires Release 7.4 or above of Xpediter/TSO or Xpediter/IMS. When used with Release 7.4 of Xpediter, TDO requires that
Xpediter/TSO PTF XTD0033 be applied.
The TDO routines monitor native COBOL files (QSAM and VSAM) and IMS files only within programs compiled with a COBOL II or later version of the COBOL compiler. You can optionally exclude certain files from monitoring. As the test runs, each time a statement is first executed, Code Coverage routines determine the current record of each applicable file. At the end of the test, the record identification data is written to a physical-sequential fixed-blocked file in the form of 80-byte control cards. The formats of this information are suitable as input to a File-AID/MVS or File-AID for IMS utility which can be used to extract the data. These utilities typically use relative record location or key information to identify the records.
Enabling TDO for a Test
The Code Coverage screen shown in Figure 9-1 on page 9-2 is accessed by selecting
option C on the Xpediter/TSO Setup Menu.
The Repository DSNAME, System Name, and Test ID fields are essentially unchanged. All fields below them are new and allow you to specify your preferences for TDO file allocation.
9-2 Xpediter/Code Coverage Mainframe User/Reference Guide
Figure 9-1. Xpediter/TSO Code Coverage Screen
Profile: PROG01 ----- XPEDITER/TSO - CODE COVERAGE --------------------------
COMMAND ===>
Repository DSNAME ===> 'USER262.REPOSIT'
System Name ===> PAYROLL Test ID ===> TDO 1
Test Data Optimization Dataset: (DSNAME will be generated if blank)
DSNAME ===> TEST.XVTDOOUT
Data Class ===>
Space Units ===> TRK
Primary ===> 2 Disposition Options:
Secondary ===> 2 A (Append)
Storage Class ===> D (Delete)
Unit ===> K (Keep)
Volume ===> ? (Prompt)
Disposition After the Test ===> K (K or ?)
Disposition Before the Test ===> A (A, D, or ? Only if DSN specified)
Press ENTER to Process or Enter END Command to Terminate
New Input Fields
DSNAME
Specifies the XVTDOOUT dataset name where Xpediter will write the TDO information. The dataset will be created if it does not already exist. The DSNAME field is limited to 46 characters in length. If this field is left blank, Xpediter will generate a DSNAME with the following format:
'userID.XPTDO.mmmdd.Thhmmss' where mmm is a three-character abbreviation for the current month, dd is the current date in the month, and hhmmss is the current time of day, in hours, minutes, and seconds.
Data Class, Space Units, Primary, Secondary, Storage Class, Unit, Volume
Specifies the allocation parameters according to your site’s standards if the dataset needs to be created.
Disposition After the Test
Specifies either of the following:
K Keep the dataset after the test is completed.
?
After the test is completed, prompt for an action to be taken against the dataset.
Disposition Before the Test
Specifies one of the following:
A Append the new TDO information to the existing data in the dataset.
D Delete and recreate the current dataset.
?
Before the test begins, prompt for an action to be taken against the dataset.
Requesting TDO for a Test
Test Data Optimization collection can be requested for TSO Interactive tests, or Batch
Connect Interactive or Unattended tests.
Test Data Optimization 9-3
For a TSO Interactive session, such as one originating from the Xpediter/TSO Standard
(2.1) screen, request TDO in the standard Code Coverage Test? field near the bottom of the screen. If you specify TDO, Code Coverage and TDO information will be collected during your test. If you specify YES, standard Code Coverage statistics will be gathered, but no TDO data will be collected.
Figure 9-2. Xpediter/TSO Standard Environment Test Screen
Profile: PROG01 ------- XPEDITER/TSO - STANDARD (2.1) -----------------------
COMMAND ===>
COMMANDS: SEtup (Display Setup Menu)
PROFile (Display Profile List)
TEST SELECTION CRITERIA:
Program ===> PROG01
Entry Point ===>
Load Module ===>
Initial Script ===>
Post Script ===>
PARM ( Caps = YES ) ===>
File List/JCL Member ===> FAU(PROG0001)
Preview Files? ===> NO
Code Coverage Test? ===> TDO (YES, NO, TDO)
Is This a DB2 Test? ===> NO Plan ===> System ===>
Press ENTER to process or enter END command to terminate
Batch Connect tests can be started on the Select Job Step screen (Figure 9-3) with two
new options. Use the IT line command to request a Batch Connect Interactive test with
Code Coverage and TDO. Use the UT line command to request a Batch Connect
Unattended test with Code Coverage and TDO.
Figure 9-3. Xpediter/TSO Select Job Step Screen
----------------------- XPEDITER/TSO - SELECT JOB STEP ----- Row 1 to 2 of 2
COMMAND ===> SCROLL ===> PAGE
Line Commands: Primary Commands:
I - Interactive testing Edit - Display converted selected steps
U - Unattended testing END - Exit without processing
IC - Interactive Code Coverage RUN - Submit and connect
IT - IC with Test Data Optimize SEtup - Setup work datasets
UC - Unattended Code Coverage SUBmit - Convert selected steps and submit
UT - UC with Test Data Optimize STatus - Display status of submitted job(s)
Dataset: 'ACMJET0.BATCON.JCL(TRIM3D)'
PROGRAM INITSCR POSTSCR STEPNAME PROCNAME PROCSTEP EXEC PGM
----------------------------------- -----------------------------------------
__ IEBGENER ________ ________ RUNPROG
__ TRIM3D ________ ________ RUNPROG
******************************* Bottom of data ********************************
Excluding Files from TDO
You may know certain COBOL or IMS files in a test that would not be good candidates for optimization. Excluding those files can save processing overhead and reduce the size of the XVTDOOUT file.
Xpediter provides two methods of excluding files by specifying their DDNAMEs or
DBDNAMEs. In the first method, the specification is made in the Xpediter/TSO or
9-4 Xpediter/Code Coverage Mainframe User/Reference Guide
Xpediter/IMS site defaults macro ADSCPDEF. In ADSCPDEF, add a new keyword specification CTLDDTDX as follows:
CTLDDTDX=(file1,file2,file3,file4,file5) where file1, file2, etc. are the DDNAME or DBDNAME to be excluded.
Note: PTF XTD0034 must be applied to Release 7.4 of Xpediter to enable specification of file exclusions in the ADSCPDEF macro.
The second method of excluding files from TDO replaces the macro file list with a set of file specifications customized for a single test. Use the following SET command:
SET TDODDXCL file1 file2 ...
to specify from one to eight DDNAMEs/DBDNAMEs from your list of files to exclude.
Additional SET commands can be entered to specify up to 100 files. Any SET command containing more than eight names will be truncated. The entire list will be ignored if the
SET command would cause the total number of specified files to exceed 100. For any file, the command must be entered before the file is opened. The commands can be placed in an initial script.
In both methods of files exclusion, you can terminate a file specification with a forward slash (/) to match for any DDNAME of DBDNAME with a prefix identical to the characters preceding the slash. For example, you could use the following command:
SET TDODDXCL INFI/ to exclude from TDO collection any DDNAME/DBDNAME whose name begins with the characters INFI, such as INFILE1, INFILE12, INFINITY, etc.
Format of the XVTDOOUT dataset
When your test session is done, the XVTDOOUT file will contain 80-byte control-card images you can use as input to File-AID/MVS or File-AID for IMS utilities. To interpret the specific formats of the criteria-specification cards pertaining to these products, refer to the Reference Manual for each product.
The TDO routines write a comment header at COBOL initialization time with the following format:
*TDO: JOBNAME jobname STEPNAME stepname PROCSTEP procstep
*TDO: DATE mm/dd/yyyy TIME hh:mm:ss
* where jobname stepname the jobname of the test session the stepname of the test session procstep the procedure stepname of the test session
mm/dd/yyyy the date at COBOL initialization hh:mm:yy the time of the COBOL initialization
This is followed by a series of control cards, grouped by file. Each grouping is separated from the next by a card with a single asterisk in position one. The COBOL file specifications precede the IMS file specifications. For sessions producing cards of both types, the dataset will need to be divided manually, since they will each be input to a distinct utility.
Note: GSAM file control cards are designed to be extracted by the File-AID/MVS utility, not by File-AID for IMS.
Test Data Optimization 9-5
COBOL and GSAM Files
Each COBOL file grouping begins with a comment card with the following format:
*TDO: type ddspec <==> progname FD: fd-specification where type ddspec file type (QSAM, ESDS, KSDS, RRDS) utility DDNAME specification ($$DD01, $$DD02, …) progname COBOL PROGRAM ID
fd-specification name on the FD card in the FILE SECTION
Each IMS (GSAM) file grouping begins with a comment card with the following format:
*TDO: GSAM ddspec <==> progname DB: dbd-name where ddspec utility DDNAME specification ($$DD01, $$DD02, …)
progname COBOL PROGRAM ID
dbd-name the DBDNAME of the GSAM file
In these groupings, this comment will be followed by the cards that can be used with the
File-AID/MVS utility to subset the file.
IMS (non-GSAM) Files
Each IMS (non-GSAM) file grouping begins with a comment card with the following format:
*TDO: IMS dbdtype <==> progname DB: dbd-name where dbdtype file type (HSAM, HISAM, SHSAM, SHISAM, HDAM, PHDAM, HIDAM, PHIDAM, PSINDEX)
progname COBOL PROGRAM ID
dbd-name the DBDNAME of the IMS file
In the grouping, this comment will be followed by the cards that can be used with the
File-AID for IMS utility to subset the file.
9-6 Xpediter/Code Coverage Mainframe User/Reference Guide
Download
Advertisement
Key features
Code coverage analysis
Report generation
Mainframe platform support
Multiple programming language support
Frequently asked questions
Xpediter Code Coverage is a software tool that helps you to test and analyze the code coverage of your mainframe applications.
It collects data about the code coverage of your programs and generates reports that show you which parts of your code have been executed and which parts have not been executed.
It supports a variety of mainframe platforms, including z/OS, z/VM, and z/VSE.
It supports a variety of programming languages, including COBOL, PL/I, and Assembler.