Using Code Coverage with Xpediter/TSO. Compuware Code Coverage
Publicité
Publicité
7-1
Chapter 7.
Using Code Coverage with Xpediter/TSO
This chapter describes how to use Xpediter/Code Coverage with Xpediter/TSO, 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/TSO installer:
1. The proper Code Coverage features must be enabled in Xpediter/TSO.
If you are uncertain whether the 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 Xpediter/TSO Product Features screen (Figure 7-1),
verify that the proper Code Coverage Support options (Basic Code Coverage Support and/or IMS Code Coverage Support) are set to Y (Yes).
Figure 7-1. Xpediter/TSO 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.
7-2 Xpediter/Code Coverage Mainframe User/Reference Guide
Collecting Code Coverage Data
Code Coverage data is collected by Xpediter/TSO. 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 explaining how these two items are conceived and developed in
Xpediter/TSO appears later in this chapter.
Define the Repository
1. Refer to Chapter 5, “Using Results Repository Utilities” of this manual and use the
CREATE command to create a repository file.
2. Specify the optional fields displayed in Figure 7-2.
Refer to the instructions in Chapter 5, “Using Results Repository Utilities” of this
manual to assist you in determining which fields are necessary to complete your job.
Figure 7-2. Xpediter/Code Coverage Repository Utility Screen (TSO)
---------------- 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
Edit JCL ===> NO Default for online submission
Press ENTER to process or enter END command to terminate
Defining 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. The system name allows the clustering of collected data by whatever criteria your requirements have pre-determined.
Refer to Figure 7-5 on page 7-7.
Note: The system name cannot contain an asterisk (*) as this is used as a wildcard.
Creating a Source Listing Dataset
1. Choose one of the following two methods to allocate a source listing dataset:
– Refer to the Compuware Shared Services (CSS) User/Reference Guide MVS Version for information on how to create a source listing dataset.
Using Code Coverage with Xpediter/TSO 7-3
– Use the Xpediter/TSO DDIO File Facility and refer to any of the Xpediter/TSO and
Xpediter/IMS User Guides for information about allocating source listing datasets.
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 (CSS) User/Reference
Guide MVS Version for information on using the CSS Language Processor (LP).
Completing the Collection of Code Coverage Data
After completing the steps listed in this chapter starting with “Installation
Requirements” on page 7-1, the corresponding Xpediter/TSO 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) will generate the
screen displayed in Figure 7-3.
Figure 7-3. TRIMAIN Test Screen (With PTF XTD0033)
Profile: TRIMAIN ------ XPEDITER/TSO - STANDARD (2.1) ----------------------
COMMAND ===>
COMMANDS: SEtup (Display Setup Menu)
PROFile (Display Profile List)
TEST SELECTION CRITERIA:
Program ===> TRIMAIN
Entry Point ===>
Load Module ===>
Initial Script ===>
Post Script ===>
PARM ( Caps = YES ) ===>
File List/JCL Member ===> 'XPEDITER.TSO.R74.SAMPLIB(TRIJCL)'
Preview Files? ===> NO
Code Coverage Test? ===> YES (YES, NO, TDO)
Is This a DB2 Test? ===> NO Plan ===> System ===>
Press ENTER to process or enter END command to terminate
Note that Code Coverage Test? ===> appears on this interactive test screen. Similarly, when you have converted the JCL, option 3 (Debug programs interactively under batch)
will produce a screen comparable to the screen displayed in Figure 7-4.
7-4 Xpediter/Code Coverage Mainframe User/Reference Guide
Figure 7-4. Xpediter/TSO Select Job Step Screen (With PTF XTD0033)
----------------------- XPEDITER/TSO - SELECT JOB STEP ----- Row 1 to 1 of 1
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: 'XPEDITER.TSO.R74.SAMPLIB(TRIJCL)'
PROGRAM INITSCR POSTSCR STEPNAME PROCNAME PROCSTEP EXEC PGM
----------------------------------- -----------------------------------------
__ TRIMAIN_ ________ ________ RUNPROG_
******************************* Bottom of data ********************************
Note that new optional line commands have been added to the Xpediter/TSO Select Job
Step screen. These changes are detailed as follows:
• IC - Interactive Code Coverage
• IT - IC with Test Data Optimize
• UC - Unattended Code Coverage
• UT - UC with Test Data Optimize
Note: See Chapter 9, “Test Data Optimization” for more details on TDO.
The Line Commands and Primary Commands of this screen are defined as follows:
Line Commands
I - Interactive testing
Selects the step to run in interactive mode.
U - Unattended testing
Selects the step to run in unattended mode.
IC - Interactive Code Coverage
Selects the step to run in interactive mode (with Code Coverage active).
IT - Interactive Code Coverage with TDO
Selects the step to run in interactive mode (with Code Coverage and TDO active).
UC - Unattended Code Coverage
Selects the step to run in unattended mode (with Code Coverage active).
UT - Unattended Code Coverage with TDO
Selects the step to run in unattended mode (with Code Coverage and TDO active).
Note: If you are licensed to use Compuware’s Code Coverage product, options IC,
IT, UC, and UT are displayed on the Xpediter/TSO Select Job Step screen. It is important that you become aware of some optional primary commands which are not visible on the Select Job Step screen. Information regarding
these optional commands is provided in “Primary Commands” on page 7-5.
Using Code Coverage with Xpediter/TSO 7-5
Primary Commands
Edit
END
Accesses the ISPF edit facility. The JCL is automatically converted and displayed on the ISPF edit screen. You can view and confirm the JCL conversion and make additional modifications to the converted JCL. You can submit the JCL from the edit screen using the RUN or SUBMIT command. Changes made to converted JCL will not be saved when you use CANCEL or press PF3 (END) from the edit screen. Refer to
“Editing the JCL” on page 7-10 for more information.
Exits without converting the JCL, saving any modifications, or submitting the job, and returns you to the Process JCL screen.
RUN
Converts the steps selected by the I, U, IC, and UC line commands to Xpediter/TSO steps and submits the JCL. The terminal cannot be used while the job is running. If the job is a long-running job, the Connect Status screen is displayed showing the job status. When the job processes successfully, you are automatically connected to the job steps selected to run in foreground mode and the Source screen is displayed.
If the JCL is already converted, the RUN command (with a DSNAME) can be entered on any screen except an Xpediter test session screen. Refer to the Xpediter/TSO and
Xpediter/IMS Reference Manual for more information about the RUN command.
SEtup
Displays the Setup Menu from which you can select to view and change the job card and library information, such as the source listing file (XPSL000n) and the SCRIPT file (XINCLUDE).
SUBmit
Converts the steps selected by the I, U, IC and UC commands to Xpediter/TSO steps and submits the job. While the job is running, you can continue using your terminal.
A job submitted with the SUBMIT command is not automatically connected. To connect to a job submitted with the SUBMIT command, you must use the CONNECT
or STATUS command. Refer to “Connecting to a Job” on page 7-9.
STatus
Displays the status of a job. You can connect to the job directly from the Status screen.
ICAll (Optional)
When entered as a Primary Command on the Job Step Selection screen, ICAll will place the letters IC on all of the individual step selection lines. If you are testing with
Batch Interactive Code Coverage (Line Command IC), and are processing a JCL stream with many steps, you will then be able to blank out all of the steps for which you do not want Code Coverage.
UCAll (Optional)
When entered as a Primary Command on the Job Step Selection screen, UCAll will place the letters UC on all of the individual step selection lines. If you are testing with Batch Unattended Code Coverage (Line Command UC), and are processing a
JCL stream with many steps, you will then be able to blank out all of the steps for which you do not want Code Coverage.
Field Definitions of the Select Job Step Screen
Dataset
This field is pre-filled with the dataset name of the JCL being processed.
7-6 Xpediter/Code Coverage Mainframe User/Reference Guide
PROGRAM
The name of the program to be tested. The program name does not necessarily match the EXEC PGM name.
INITSCR
The member name of the script in the INCLUDE library specified on the Setup screen. The INITSCR field can be typed over to specify a test script member which can be processed at the beginning of a debugging session.
When using Xpediter/TSO, 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.
STEPNAME
The job step name.
PROCNAME
The in-stream or cataloged procedure name.
PROCSTEP
The step name within the called procedure.
EXEC PGM
The name of the EXEC program that is executed for the step. XPTSO if I (Interactive) or IC (Interactive Code Coverage) was specified for the step. XPBATCH if U
(Unattended) or UC (Unattended Code Coverage) was selected for the step. The field is left blank if the name is the same as the one entered in the PROGRAM field.
Interactive and Batch Test Requirements
In order for Code Coverage data to be collected, interactive tests require that the Code
Coverage Test? field be set to Y (Yes) or T (TDO). In addition, batch tests require the entering of the IC, IT, UC, or UT line command. You must specify what Code Coverage system name is to be used and to what Code Coverage Repository the collected data is to be written at the end of the test.
For both interactive and batch tests, you can specify the appropriate Code Coverage system name by first entering the SEtup command and selecting option C (Code
Coverage Setup options) from the SETUP menu. The Code Coverage Setup options screen
is similar to the screen displayed in Figure 7-5.
Using Code Coverage with Xpediter/TSO 7-7
Figure 7-5. Xpediter/Code Coverage Setup (for TSO) 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 screen, 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. For more information on Test Data
Optimization (TDO) and its associated fields, refer to Chapter 9, “Test Data
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.
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'
7-8 Xpediter/Code Coverage Mainframe User/Reference Guide 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 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/TSO, 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/TSO be changed to specify the
Using Code Coverage with Xpediter/TSO 7-9 following:
CTLBRCOV=Y
For additional information on controlling Branch Coverage for a Code Coverage test with
Xpediter/TSO, refer to the description of JCLRA093 parameter CTLBRCOV in Appendix B 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/TSO includes an optional SVC breakpoint processing technology that reduces the overhead associated with collection of Branch and Frequency data. Refer to the Xpediter/TSO and
Xpediter/IMS Installation and Configuration Guide for information on how to implement this breakpoint technology.
Connecting to a Job
Two methods exist for connection to a job: the RUN command and the SUBMIT command.
When you use the RUN command to submit the job, the steps that are selected for interactive debugging are automatically displayed at your terminal.
When you use the SUBMIT command to submit the job, there are two ways to connect to a job: the CONNECT command and the STATUS command.
CONNECT Command
Use the CONNECT command on any screen (except the source display) to connect a
VTAM terminal to a job submitted through Xpediter/TSO’s batch connect facility. You can connect to a job with multiple steps or to a single step job. For information on the
CONNECT command syntax, refer to the Xpediter/TSO and Xpediter/IMS Reference Manual.
STATUS command
The STATUS command is used to display the Status screen containing a list of the jobs in the system. The STATUS command can be entered from any screen. The ATTACH line command on the Status screen is used to connect to a job and display the source of each job step for which the I (Interactive), IC (Interactive Code Coverage), or IT (Interactive
Code Coverage with TDO) command was specified. A message is displayed notifying you that the job step selected for testing is executing.
Connection Security Check
Connection can be made to any job, including production jobs, as long as your site security grants the authority. The batch connect facility is shipped with a default security exit routine that allows connection to a job if the JOBNAME, without the last character, matches the TSO ID where the STATUS screen is accessed. When a connection cannot be made, the messages CANNOT CONNECT....... or SECURITY CHECK FAILED....... are issued.
The site installer can customize the security exit routine to tailor the security level for certain groups or individuals. When an asterisk (*) is entered in the JOBNAME field on the Status screen, all jobs that are waiting for connection or being tested under batch connect are listed. System programmers are able to connect to a remote job and use the facility as a help desk feature in debugging application programs.
7-10 Xpediter/Code Coverage Mainframe User/Reference Guide
Editing the JCL
There are two points at which the batch connect facility lets you edit your JCL.
1. Primary editing is available by entering the EDIT primary command on the Process
Execute JCL screen. An ISPF edit session is invoked and the specified JCL is displayed.
If your site security permits, changes will be saved to the original JCL when the edit session ends.
2. Secondary editing is available by entering the EDIT primary command on the Select
Job Step screen. An ISPF edit session is invoked and a temporary copy of the JCL is displayed. JCL statements for the steps selected for testing, using the I (Interactive),
IC (Interactive Code Coverage), IT (Interactive Code Coverage with TDO), U
(Unattended), UC (Unattended Code Coverage), or UT (Unattended Code Coverage with TDO) line commands, are already converted when the edit screen is displayed.
After editing is complete, you can submit the job from this screen with the RUN or
SUBMIT command.
Note: Entering END (PF3) or CANCEL returns to the Select Job Step screen without saving the changes. To save the converted JCL, use the ISPF CREATE command and copy the contents to a dataset. The saved JCL can be submitted at any time with the RUN or SUBMIT command.
Télécharger
Publicité