Using Code Coverage with Xpediter/IMS. Compuware Code Coverage
Reklam
Reklam
8-1
Chapter 8.
Using Code Coverage with Xpediter/IMS
This chapter describes how to use Xpediter/Code Coverage with Xpediter/IMS, including basic Setup and specific Code Coverage related options. This chapter also provides a detailed explanation about how Code Coverage data is collected.
Note: All the procedures in this and subsequent chapters assume that Code Coverage has been properly installed and configured in accordance with the Compuware
Installer Mainframe Products SMP/E Installation Guide and the Xpediter/Code Coverage
Installation and Configuration Guide.
Installation Requirements
Before Code Coverage can be used under Xpediter, the following steps must be performed by the Xpediter/IMS installer:
1. The Basic Code Coverage Support features and the IMS Code Coverage Support product features must be enabled in Xpediter.
If you are uncertain whether these features are enabled, execute the XPLIBDEF CLIST with a parameter of ‘INSTALL’ (refer to the Xpediter/TSO and Xpediter/IMS Installation and
Configuration Guide). On the Product Features screen (Figure 8-1), verify that the Code
Coverage Support options are set to Y (Yes).
Figure 8-1. Xpediter/IMS Product Features Screen
COMPUWARE INSTALL ------------ PRODUCT FEATURES -----------------------------
COMMAND ===>
IBM SMS Active ===> Y Basic Code Coverage Support ===> Y
IBM Session Manager ===> Y IMS Code Coverage Support ===> Y
PANEXEC Load Module Support ===> Y DB2 Stored Procedure Support ===> Y
IBM DB2 ===> Y
Enhanced FIND Command ===> Y
XPEDITER/IMS ===> Y
CICS Connection ===> Y
File-AID for MVS ===> Y (N=No, Y=English, J=Japanese)
File-AID for IMS ===> Y
File-AID for DB2 ===> Y
XPEDITER for DB2 Extension ===> Y
XPEDITER/DevEnterprise Support ===> Y
Message to Display on Primary Menu:
Install for Release Level 7.4
Press ENTER to process or enter END command to terminate
2. The CCNODE() parameter in the XPLIBDEF must be set to the Code Coverage highlevel qualifier.
If you prefer, you can concatenate the Code Coverage ISPF datasets to the corresponding ISPLLIB, ISPPLIB, ISPMLIB, ISPSLIB, and SYSPROC DD statements in the TSO LOGON PROC.
8-2 Xpediter/Code Coverage Mainframe User/Reference Guide
Collecting Code Coverage Data
Code Coverage data is collected by Xpediter/IMS. The results of Verbs and Branches tested will be written to a Code Coverage Repository.
Preparing for Code Coverage Capture
In order to collect Code Coverage data, a repository dataset and source listing members must exist. Information which explains how these two items are conceived and developed in Xpediter/IMS is provided in this chapter.
Define the Repository
1. Refer to Chapter 4, “Repository Utility Screen” on page 5-2 and use the CREATE
command to create a repository file.
2. Specify the optional fields displayed in Figure 8-2. Refer to the instructions located in
Chapter 4, “Repository Utility Screen” on page 5-2 to assist you in determining
which fields are necessary to complete your job.
Figure 8-2. Xpediter/Code Coverage Repository Utility Screen
---------------- CODE COVERAGE 17.02 - REPOSITORY UTILITY ------------
COMMAND ===>
Commands: C (Create file) D (Delete file)
Repository File ===> ’OYAA.TEST.INV3OYAA.REPOSIT’
Management Class ===> (optional)
Storage Class ===> (optional)
Volume ===> (optional)
Unit ===> (optional)
Space Units ===> CYL (CYL/MB/REC/TRK)
Primary Quantity ===> 10
Press ENTER to process or enter END command to terminate
Define the System Naming Convention
The system name allows you to group different Code Coverage results together. The name you choose can be from one to fifteen characters in length and cannot include asterisks
(*). The system name allows the clustering of collected data by whatever criteria your
requirements have pre-determined. Refer to Figure 8-5 on page 8-7.
Create a Source Listing Dataset
1. There are two methods which can be used to allocate a source listing dataset:
– Refer to Compuware Shared Services User/Reference Guide MVS Version for information on how to create a source listing dataset.
– Use the Xpediter/IMS DDIO File Facility; refer to all/any of the Xpediter/TSO and
Xpediter/IMS User Guides for information about allocating source listing datasets.
Using Code Coverage with Xpediter/IMS 8-3
2. After you have created your source listing dataset, create source listing members for all application programs by compiling with CSS. There are two ways to compile your application programs:
– Use the Xpediter/TSO Program Preparation Facility (as described in all
Xpediter/TSO and Xpediter/IMS User Guides).
– Run a CSS Batch Compile. Refer to the Compuware Shared Services User/Reference
Guide MVS Version for information on using the CSS Language Processor (LP).
Completing the Collection of Code Coverage Data
After the steps listed in “Installation Requirements” on page 8-1 of this chapter have
been performed, the corresponding Xpediter/IMS test screens will be displayed and will contain one or more Code Coverage related fields. For example, Xpediter/TSO option 2
(Debug programs interactively under TSO) for an IMS/BTS test will generate the screen
Figure 8-3. BTS Test Screen (With PTF XTD0033)
Profile: TRIIMSM --------- XPEDITER/TSO - BTS (2.4) ------------------------
COMMAND ===>
COMMANDS: SEtup (Display Setup Menu)
BTsin (Display BTSIN Menu)
PROFile (Display Profile List) DOwn (Scroll Down)
INTERCEPTS
PROGRAM TRANCODE INITSCR POSTSCR START MAX
===> ===> ===> ===> ===> ===>
===> ===> ===> ===> ===> ===>
===> ===> ===> ===> ===> ===>
BTSIN ===>
Program Type ===> DLI (DLI, BMP, DBB)
PARM Passing Option ===> STD (STD) Retain Breakpoints? ===> NO
File List/JCL Member ===> 'XPEDITER.TSO.R74.SAMPLIB(TRIIMSJ)'
Code Coverage Test? ===> YES (YES, NO, TDO) Unattended? ===> NO
Is This a DB2 Test? ===> NO System ===>
Press ENTER to process or enter END command to terminate
Note that Code Coverage Test? ===> appears on this interactive BTS test screen.
Similarly, the IMS/MPP test screen is comparable to the one displayed in Figure 8-4.
8-4 Xpediter/Code Coverage Mainframe User/Reference Guide
Figure 8-4. MPP Test Screen (With PTF XTD0033)
Profile: TRIIMSM --------- XPEDITER/TSO - MPP (2.8) -------------------------
COMMAND ===>
COMMANDS: SEtup (Display Setup Menu)
INter (Display Intercepts)
PROFile (Display Profile List) DOwn (Scroll Down)
INTERCEPTS
PROGRAM TRANCODE INITSCR POSTSCR START MAX ------------ DATA ------------
> XPEDTRAN
>
>
IMS USERID ===> ACMJET0 Retain Breakpoints? ===> NO
NBA ===> 2 (Normal Buffer Allocation)
OBA ===> 3 (Overflow Buffer Allocation)
File List/JCL Member ===> 'XPEDITER.TSO.R74.SAMPLIB(TRIIMSJ)'
Code Coverage Test? ===> YES (YES, NO, TDO) Unattended? ===> NO
Is This a DB2 Test? ===> NO System ===>
Press ENTER to process or enter END command to terminate
Defined IMS Commands on the BTS and MPP Test Screens
The following commands are displayed on the BTS and MPP screens:
SEtup
Displays the Setup Menu from which you can select screens for specifying load libraries, DDIO datasets, and so on.
BTsin
Required Command field for the BTS screen. Xpediter/TSO scans the BTSIN dataset and searches for the program and transaction code to be debugged. An intercept is established for each one found. The BTSIN dataset must be either a sequential dataset or a member of a partitioned dataset. The BTSIN cards should not be modified.
INter
Displays the Intercepts screen showing you what IDs are logged on to Xpediter/IMS, what programs are being used, and so on. Located on the MPP screen.
DOwn
Scrolls to a continuation MPP screen. From this screen, UP is available for returning to the first debugging screen.
ALLOC
This command takes you to the File Allocation Utility (FAU) screens to create a file allocation list. Your program may require this list for the debugging session.
Field Definitions of the BTS and MPP Test Screens
The fields displayed on the BTS and MPP test screens are:
PROGRAM
Required if TRANCODE is not specified. Used to identify which programs are to be debugged by Xpediter/IMS. You can enter the load module name in this field, the transaction code in the TRANCODE field, or supply values for both fields. If you enter only the program name, all the transactions associated with that program will be intercepted by Xpediter/IMS. If you enter only a transaction code, its associated program is intercepted.
Using Code Coverage with Xpediter/IMS 8-5
Three programs or transaction codes can be specified on the MPP screen. If you want to continue the list, you can scroll down to a second MPP Test screen. The last entry on the previous page is displayed in the top row. Once the second screen is full, you can scroll down to a third screen. Notice that on the second (and subsequent screens), the UP command is available in addition to the DOWN command.
TRANCODE
Identifies which transactions are to be debugged by Xpediter/IMS. You can enter the transaction code in this field or the load module name in the PROGRAM field, or enter values for both fields.
This field is required if PROGRAM is not specified or if multiple transactions are associated with the program.
INITSCR
Enter the member name of a test script if you want to execute a predefined command stream at the beginning of the debugging session. This member will be executed after the inclusion of the site-wide script member @@SITE@@, if defined.
POSTSCR
Enter the member name of a test script if you want to execute a predefined command stream at the end of the debugging session.
START
The occurrence of the program invocation on which the intercept is to begin. Up to four digits can be entered. By default, program intercept begins on the first occurrence. When the program is intercepted, the debugging session is initiated and the source is displayed.
MAX
Enter up to four digits to specify the maximum number of times the program intercept is processed. If this field is left blank, the value defaults to an infinite number. If you enter an EXIT command and there are still intercepts remaining, those intercepts are ignored.
DATA
Specify up to 30 bytes of data from the IMS transaction you want to debug.
The DATA field is only active if IMS User ID/Data Value Intercept Support is enabled.
See the Xpediter/TSO and Xpediter/IMS Installation and Configuration Guide for more details.
Note: This field cannot contain the , (comma) or ¢ (cent) characters.
Program Type
Required for BTS Test screen. The type of IMS program. The value is generally the first parameter value passed to IMS in the JCL. The field can have any one of the following values:
BMP
A BMP program is manually scheduled by the system operator and, typically, processes some data that was held by IMS in a message queue.
DBB
A DBB program is processed in an offline DL/I batch processing region using ACB libraries instead of PSB and DBD libraries.
DLI
A DL/I program is processed in an offline DL/I batch processing region using PSB and DBD libraries.
These program types are retrieved from the PARM lists in the Setup option. Your specific site options determine which program types are available on the screen.
8-6 Xpediter/Code Coverage Mainframe User/Reference Guide
PARM Passing Option
Required for BTS Test screen. Default values are prefilled for this field. The valid
PARM passing option is STD. If you specify STD (standard) when debugging an IMS program, Xpediter/IMS passes the PARM string to the program unaltered.
IMS USERID
For an MPP test, specify the ID of the IMS user issuing the IMS transaction you want to debug. If IMS User ID/Data Value Intercept Support is enabled, you can enter an asterisk (*) to specify a generic match on any user ID.
The IMS USERID field is only active if either IMS User ID Support or IMS User
ID/Data Value Intercept Support is enabled. See the Xpediter/TSO and Xpediter/IMS
Installation and Configuration Guide for more details.
Note: If Xpediter/Code Coverage is active, this field is also used to record the IMS user ID in the Code Coverage Repository. If an asterisk is specified, the TSO user ID will be recorded.
Retain Breakpoints?
If you want Xpediter to retain breakpoints from one iteration of an IMS or BTS program or transaction to the next, enter YES in this field. Before breakpoints, after breakpoints, counts, skips, traces, Code Coverage breakpoints, and when conditions from the previous test iteration will be reapplied. Count values will accumulate across iterations, but a count with a maximum execution limit will be converted to a standard counter. Keeps and inserted lines are not retained.
The default is NO and will result in each iteration starting with only the standard before and after breakpoints.
NBA
OBA
Required for the MPP Test screen. The Normal Buffer Allocation (NBA), up to two digits. The default value is 0.
Required for the MPP Test screen. The Overflow Buffer Allocation (OBA), up to two digits. The default value is 0.
Note: The NBA and OBA fields appear on the screen only if your site installer indicated that your site uses Fast Path databases. The values are inserted in the PARM string when the IMS region is attached.
File List/JCL Member
The dataset name that contains the file list, CLIST, or JCL. The File Allocation Utility
(FAU) preallocates files and databases processed by the program upon entry to the debugging session. If the member name of a PDS is omitted, a member list is displayed. If the dataset contains a CLIST, Xpediter/IMS immediately executes it and begins the debugging session. If the dataset contains a file list or JCL, the FAU is invoked to dynamically allocate the specified files before beginning the debugging session.
Code Coverage Test?
Whether or not Xpediter/Code Coverage data should be collected for this test. Enter
YES to collect statistics without Test Data Optimization information. Enter TDO to
collect statistics and TDO information. The default value is NO. See Chapter 9, “Test
Data Optimization” for more information on TDO.
Unattended?
Whether or not to run the test in Unattended mode. Enter YES to run in Unattended mode. The default value is NO. In unattended mode, after BTS gives control to the application program, only Xpediter commands are processed in the Initial Script, the
Using Code Coverage with Xpediter/IMS 8-7
Post Script, and the Abend Script. Interactive Xpediter commands are not permitted
(from the terminal).
Is This a DB2 Test?
Whether or not this is a DB2 test. Enter YES if the program executes EXEC SQL statements. The default is NO.
System
The DB2 subsystem name. The subsystem name depends on the release level of DB2 allocated to the DSNLOAD library specified in the Setup option. When testing DB2 under the BTS/DLI environment, you must define the DB2 subsystem name to BTS by using the ./P statement as part of the BTSIN control cards.
IMS Test Screen Requirements
The Code Coverage Test? ===> again appears on the MPP interactive test screen (as
shown in Figure 8-4 on page 8-4). This example demonstrates that the Code Coverage
Test field must be set to Y (Yes) or T (TDO) for Code Coverage data to be collected. You must specify which Code Coverage system name should be used and to what Code
Coverage Repository the collected data should be written at the end of the test.
To specify the appropriate Code Coverage system name, you must enter the SEtup command and select option C (Code Coverage Setup options) from the SETUP menu. The
Code Coverage Setup options screen is similar to the screen displayed in Figure 8-5.
Figure 8-5. Xpediter/Code Coverage Setup (for IMS) Options Screen (With PTF XTD0033)
--------------------- XPEDITER/TSO - CODE COVERAGE --------------------------
COMMAND ===>
Repository DSNAME ===> 'ACMJET0.SAMPLE.REPOSIT'
System Name ===> SYSTEM 1 Test ID ===> TEST 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
On the Xpediter/Code Coverage Setup Options panel, you must enter the Code Coverage
Repository dataset name, the Code Coverage system name, and the Code Coverage test
ID name pertaining to the Code Coverage test. Test Data Optimization (TDO) and its
associated fields are covered in Chapter 9, “Test Data Optimization”.
Input Fields
Repository DSNAME
Specifies the repository dataset name where Xpediter will write the Code Coverage information. The Repository DSNAME field is limited to 46 characters or less in length.
8-8 Xpediter/Code Coverage Mainframe User/Reference Guide
System Name
Specifies the Code Coverage system name for this test. This name can be any userspecified name. This field is limited to 15 characters or less in length. They can be any character except an asterisk (*), including embedded blanks, and the field is automatically left-justified. The Code Coverage system name allows clustering of collected data by whatever criteria you choose. It could be by application (such as
“PAYROLL” or “INVENTORY”), by department (for example, “PROGRAMMING,”
“MATERIALS,” or “ACCOUNTING”), or by arbitrary grouping (for example, “TEST
SET #01” or “TEST SET #02”).
Test ID
Specifies a Code Coverage Test Identification name to be added to the Code Coverage test. This information is useful when reviewing test reports from Code Coverage. This field is limited to 15 characters or less in length and cannot contain an asterisk (*).
Test Data Optimization Dataset Area
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.
Defining the Collection Process
Xpediter/Code Coverage entails collecting two types of statistics in both optimized and non-optimized environments.
• Verb Coverage statistics
• Branch Coverage statistics
The GEN option will be set to ON during a Code Coverage test to collect data for all statements. These statements include translator-generated statements (for example, DL/I or DB2) and all statements suppressed by the compiler (for example, COPY SUPPRESS or
PRINT NOGEN %NOPRINT). Requests to turn Code Coverage GEN OFF during a session will be ignored. During an interactive test session, the appearance of the source to the user will be different during a Code Coverage test. All normally suppressed statements
Using Code Coverage with Xpediter/IMS 8-9 will be displayed.
Verb Coverage
Supported for COBOL, PL/I, and Assembler, Verb Coverage indicates whether or not each unique verb was executed. Verb coverage is achieved by having Xpediter set special Code
Coverage breakpoints on all statements. When a breakpoint is reached, the data is collected in a repository and the breakpoint is removed. These special Code Coverage breakpoints are not presented to you while you are using Code Coverage and require no interaction. You may still specify your own breakpoints. Those breakpoints will function independently of the special Code Coverage breakpoints.
Branch Coverage
Branch Coverage, supported for COBOL only, indicates whether the next verb is intended for execution or some other verb is intended for execution after each qualifying condition statement.
The qualifying condition statements include IF, ON n, and WHEN. The collection of branch coverage statistics is optional during a Code Coverage session. Frequency information is carried into the repository for any COUNT command you issue.
Collection of Branch Coverage information is optional with Xpediter/IMS and the default setting is “No Branch Coverage.” To change the default for all users at your site requires that the site-specific default defined to Xpediter/IMS be changed to specify the following:
CTLBRCOV=Y
For additional information on setting the collection of Branch Coverage information with Xpediter/TSO, refer to Appendix G of the Xpediter/TSO and Xpediter/IMS Installation and
Configuration Guide.
Branch Coverage can be set ON or OFF for a single execution by including the SET
BRCOV ON/OFF command in the initial script invoked when the Code Coverage collection takes place. The SET BRCOV command can also be specified in a site-wide script.
Collection of Branch Coverage information can cause the Code Coverage collection process to run longer since more detailed information is being collected. Xpediter/IMS
Release 6.5 and above include a new breakpoint processing technology that reduces the overhead associated with collection of Branch and Frequency data. Refer to Steps 5 and
13 of the Xpediter/TSO and Xpediter/IMS Installation and Configuration Guide for information on how to implement this new breakpoint technology.
8-10 Xpediter/Code Coverage Mainframe User/Reference Guide
İndir
Reklam