Generating Code Coverage Reports. 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
3-1
Chapter 3.
Generating Code Coverage Reports
This chapter describes how to generate reports from within the mainframe component of
Xpediter/Code Coverage. DevEnterprise provides powerful display, analysis, and report generating functions. Access to global online help covering all components of
DevEnterprise is available from the workstation’s Start menu.
IMPORTANT:
Xpediter/Code Coverage results are based, in part, on the mapping of program source code to the compiler-generated machine instructions executed. Because the results for optimized programs can seem illogical, Xpediter/Code Coverage may make certain inferences, indicated by an asterisk (*), in an attempt to clarify actual program execution.
For more information, see “Using Code Coverage with Optimized Programs” on page 6-1.
Reports Screen
The Reports screen shown in Figure 3-1 on page 3-2 is accessed by entering option 1 on
the Primary Menu. This screen is used to generate reports that detail the extent to which different sections of your code have been executed. Various screen fields, described below, allow you to control:
• the type of report
• the covered systems, load modules, and programs
• whether to include results obtained with and without debugging
• whether to include only the COBOL procedure division
The Reports screen is accessed by entering option 1 on the Primary Menu. Sample reports
with detailed descriptions are provided in “Sample Code Coverage Reports” on page 3-5.
Press Enter to process any information in the screen fields and submit the job to generate a Code Coverage report. Use the END command (default PF3) to return to the Primary
Menu without generating a report.
Reports can be run in foreground or batch mode. If the reports are run in the foreground, the output is directed to the terminal. When viewing of these foreground reports is complete, a Report Disposition screen is displayed that gives the user the option of deleting the report, printing the report, or saving the report on disk. If the reports are run in batch, the Job Information screen determines the attributes of the output.
3-2 Xpediter/Code Coverage Mainframe User/Reference Guide
Figure 3-1. Reports Screen
----------------------- CODE COVERAGE 17.02 - REPORTS ------- Row 1 to 4 of 4
COMMAND ===> SCROLL ===> PAGE
Line Commands: Primary Commands:
I (Insert new report), SEtup , DEL (Delete), ACT (Activate),
D (Delete), A (Activate), SUS (Suspend), SUBmit , Edit (JCL),
S (Submit), P (Suspend), RUN (Online report),
R (Run online report) END (Exit and save),
CANcel (Exit without saving)
Report type ==> S ( S = System level, P = Program level, A = Annotated listing)
Combine Debug/NoDebug ===> N ( Y / N )
Merge Annotated results ===> Y ( Y / N )
COBOL Procedure Division only ===> Y ( Y / N )
Selection Criteria ACTIVE ===> _ ( E = Edit, A = Activate, P = Suspend)
Report Filters ACTIVE ===> _ ( E = Edit, A = Activate, P = Suspend)
CMD Status System name Test ID User ID Load Module Program
_ ACTIVE TEST301________ _______________ ________ CWXTCOB_ CWXTCOB_
_ ACTIVE ALL____________ UPDATE TAX CODE JOHNDOE_ TRIMAIN_ CWDEMBCL
_ SUSPNDED ACCOUNTING UPDATE TAX CODE JOHNDOE_ TRIIFP__ TRIIFP__
_ SUSPNDED PAYROLL UPDATE TAX CODE TRIDB2P1 TRIDB2P1 TRIDB2P1
******************************** Bottom of data *******************************
Press ENTER to process or enter END to terminate
Line Commands
The line commands displayed in Figure 3-1 are defined as follows:
I Insert (add) a report request.
D Delete a report request.
A Activate a report request that was previously excluded.
S Submit a report request for batch processing for this line.
P Suspend a report request that was previously active.
R Enables the user to run a report request online, and then browse the output.
Primary Commands
SEtup
DEL
Modifies the global default values, including repository dataset(s), override source listing dataset(s), and jobcards.
ACT
Deletes all reports in the ISPF table and inserts one new request.
SUS
Marks all report requests active.
Marks all report requests suspended.
SUBmit
Edit
Submits a batch job using all entries marked active.
Creates JCL for batch processing and repositions you into ISPF edit.
Generating Code Coverage Reports 3-3
RUN
END
Invokes the report program for processing all entries marked as active.
Exits the display and saves all changes.
CANcel
Exits the display without saving any changes.
Input Fields
Report type
Specifies the type of report you want Code Coverage to generate. Enter S (the default) for a system-level report, P for a program-level report, and A for an annotated listing.
Examples are provided in “Sample Code Coverage Reports” on page 3-5.
Combine Debug/NoDebug
Specifies whether to include the results of testing in which debugging was done.
Such results may not necessarily reflect normal program execution. Valid entries are
Y for Yes and N for No.
Merge Annotated results
Specifies whether to merge annotated results. Valid entries are Y for Yes and N for No.
COBOL Procedure Division only
Specifies whether or not to include only the procedure division of COBOL programs in the Code Coverage report.
Selection Criteria ACTIVE/SUSPNDED
Specifies one of two optional commands to activate or suspend the status of a repository program report. After entering either a blank or a valid command in the
Report type field, specify a third optional command to display the Reports Selection
Criteria screen (Figure 3-2 on page 3-4). The optional commands are E (Edit), A
(Activate), or P (Suspend).
Report Filters ACTIVE/SUSPNDED
Specifies one of two optional commands to activate or suspend the status of a repository program report. After entering either a blank or a valid command in the
Report type field, specify a third optional command to display the Report Filters
selection screen (Figure 2-5 on page 2-5). The optional commands are E (Edit), A
(Activate), or P (Suspend).
CMD
Specifies one of the six available line commands next to the system name you want
to affect. See “Line Commands” on page 3-2 for details of each command that can be
entered in this field.
Status
A protected field indicating the active or suspended status of a repository program report. This field cannot be edited.
System Name
Specifies the system name on which Code Coverage is to report. More than one system name can be specified by using additional lines. This field is limited to 15 characters in length and is subject to wildcard rules.
3-4 Xpediter/Code Coverage Mainframe User/Reference Guide
Test ID
Specifies the name of the test ID that the selected Code Coverage Repository will report on. This field is limited to 15 characters in length and is subject to wildcard rules.
User ID
Specifies the name of the TSO, IMS, or CICS user ID. This field is limited to eight characters in length and is subject to wildcard rules.
Load Module
Specifies the load module on which Code Coverage is to report. More than one load module can be specified. This field is limited to eight characters in length and is subject to wildcard rules.
Program
Specifies the program on which Code Coverage is to report. This field is limited to eight characters in length and is subject to wildcard rules.
Reports Selection Criteria Screen
The Reports Selection Criteria screen shown in Figure 3-2 allows you to control the
variety of data categories selected in the Code Coverage report you intend to generate.
This screen is accessed by entering an E in the “Selection Criteria ACTIVE/SUSPNDED”
field of the Code Coverage Reports screen (Figure 3-1 on page 3-2).
Figure 3-2. Reports Selection Criteria Screen
----------------------- CODE COVERAGE 17.02 - REPORTS ----------------------
OPTION ===>
SELECTION CRITERIA
OPERATOR (EQ/LT/GT) VALUE
Percent Verbs Executed ===> GT 05
Percent Critical Verbs Executed ===> GT 05
Percent Exclude Verbs Executed ===> __
Percent Net Total Verbs Executed ===> __
Percent Branches Executed ===> __
Percent Critical Branches Executed ===> __
Percent Exclude Branches Executed ===> __
Percent Net Total Branches Executed ===> __
Selection Criteria Fields
Selection criteria fields allow you to enter values to limit the scope of the Code Coverage report you will generate. Using selection criteria can help you quickly identify and focus on those areas of your code that require further testing or, alternatively, those areas which have been sufficiently tested. Two types of selection criteria are available on the
Reports Selection Criteria screen shown above:
OPERATOR (EQ/LT/GT)
Indicates the operators to be used to limit the scope of the Code Coverage report.
Valid operators are EQ (equals), LT (less than), and GT (greater than). If you enter an
OPERATOR, you must enter a VALUE.
Generating Code Coverage Reports 3-5
VALUE
Indicates the target percentage to be used in conjunction with an operator to limit the scope of the Code Coverage report. For example, specifying an operator of LT and a value of 90 will result in a report that only shows those members for which less than 90% of the selection criteria indicated in the input fields have been executed.
Valid percentage values range from 0 to 100. If you enter a VALUE, you must enter an
OPERATOR.
Input Fields
Percent Verbs Executed
Specifies an operator and value in this row to limit report results based on the proportion of verbs executed in the system, module, or program specified.
Percent Critical Verbs Executed
Specifies an operator and value in this row to limit report results based on the proportion of verbs executed in the system, module, or program specified that pass
the Critical filters established on the Report Filters screen (see page 2-4).
Percent Exclude Verbs Executed
Specifies an operator and value in this row to limit report results based on the proportion of verbs executed in the system, module, or program specified that pass
the Exclude filters established on the Report Filters screen (see page 2-4).
Percent Net Total Verbs Executed
Specifies an operator and value in this row to limit report results based on the proportion of net total verbs executed in the system, module, or program specified.
Net total verbs executed is derived by subtracting exclude verbs executed from verbs executed.
Percent Branches Executed
Specifies an operator and value in this row to limit report results based on the proportion of branches executed in the system, module, or program specified.
Percent Critical Branches Executed
Specifies an operator and value in this row to limit report results based on the proportion of branches executed in the system, module, or program specified that
pass the Critical filters established on the Report Filters screen (see page 2-4).
Percent Exclude Branches Executed
Specifies an operator and value in this row to limit report results based on the proportion of branches executed in the system, module, or program specified that
pass the Exclude filters established on the Report Filters screen (see page 2-4).
Percent Net Total Branches Executed
Specifies an operator and value in this row to limit report results based on the proportion of net total branches executed in the system, module, or program specified. Net total branches executed is derived by subtracting exclude branches executed from branches executed.
Note: If an OPERATOR and VALUE are specified for any of the above input fields, all of the selection criteria specified must be met for the report to be generated.
Sample Code Coverage Reports
Xpediter/Code Coverage can generate system-level and program-level reports as well as annotated listings. Each report is preceded by a Reports Selection Criteria page that lists the following:
3-6 Xpediter/Code Coverage Mainframe User/Reference Guide
• the type of report selected
• the program selection
• testid and userid report selection capability
• whether debugging and non-debugging results are to be included
• the dataset name of the Code Coverage Results Repository used.
Annotated listings also include an annotated summary.
System-Level Report
An example of a system-level hardcopy batch report is shown in Figure 3-3 on page 3-6.
This report summarizes results at the system, load module, and program levels. It includes actual numbers and percentages of verbs and branches executed as well as the number and percentage of filtered verbs and branches if filters were established before the report was generated. The report also provides the compile date and time for each program and indicates whether compiler optimization was used.
The DEBUG column indicates whether results were obtained while using debugging procedures or during normal non-debugging testing. This is important because the use of certain debugging commands can alter the natural flow of execution in a program.
The L/T column indicates both the programming language (L) and the Compuware product line type (T). Language selections available are C (COBOL), A (Assembler), and P
(PL/I). Defined Compuware product types are D (Xpediter/CICS) and T (Xpediter/TSO and Xpediter/IMS).
Figure 3-3. System-Level Code Coverage Report
09/22/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 1
REPORT SELECTION CRITERIA
REPORT SELECTED: SYSTEM LEVEL REPORT
REPORT REQUEST-> SYSTEM: TEST301 TEST ID: * USER ID: ALL LOAD MODULE: CWXTCOB PROGRAM: ALL
COMBINE DEBUG/NODEBUG: YES
COBOL PROCEDURE DIVISION ONLY: YES
REPOSITORIES: ACMJET0.XV17.REPOSIT
ACMNDF0.XV31.REPOSIT
ENTQA.XW.V30.REPOS
DDIO OVERRIDES: XV.XV31S1.DDIO
ACMNDF0.XV17.DDIO
CRITICAL STATEMENT MASK: DATE
STARTING IN COLUMN 01 ENDING IN COLUMN 80 WORD MATCH=N
EXCLUDE STATEMENT MASK: DISPLAY
STARTING IN COLUMN 01 ENDING IN COLUMN 80 WORD MATCH=N
START EXCLUDE BLOCK MASK: 000-MAINLINE
STARTING IN COLUMN 01 ENDING IN COLUMN 72
END EXCLUDE BLOCK MASK: ENDHERE
STARTING IN COLUMN 01 ENDING IN COLUMN 72
09/22/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 2
SYSTEM: TEST301 TEST ID: * USER ID: ALL LOAD MODULE: CWXTCOB PROGRAM: ALL
LOAD PROGRAM COMPILE COMPILE VERBS BRANCHES
SYSTEM TEST ID USER ID MODULE DATE TIME OPT DEBUG L/T EXEC TOTAL EXEC TOTAL
TEST301 SIMPLE ACMJET0 CWXTCOB CWXTCOB 06/06/2015 12:31:47 N N CT 68% 193 62% 40
*** CRITICAL FILTER TOTALS: 70% 10 0% 0
*** EXCLUDE FILTER TOTALS: 75% 151 67% 34
*** NET COVERAGE TOTALS: 45% 42 33% 6
TEST301 SIMPLE ACMJET0 CWXTCOB CWXTDATE 04/10/2012 07:43:04 N N CT 63% 19 56% 16
*** CRITICAL FILTER TOTALS: 100% 1 50% 2
*** EXCLUDE FILTER TOTALS: 63% 19 56% 16
*** NET COVERAGE TOTALS: 0% 0 0% 0
TEST301 SIMPLE ACMJET0 CWXTCOB CWXTSUBC 04/10/2012 07:45:06 N N CT 44% 27 35% 20
*** CRITICAL FILTER TOTALS: 0% 0 0% 0
*** EXCLUDE FILTER TOTALS: 44% 27 35% 20
*** NET COVERAGE TOTALS: 0% 0 0% 0
TOTALS FOR THIS SYSTEM: 65% 239 53% 76
CRITICAL FILTER TOTALS: 72% 11 55% 70
EXCLUDE FILTER TOTALS: 70% 197 N/A
NET COVERAGE TOTALS: 45% 42 33% 6
Program-Level Report
An example of a program-level hardcopy batch report is shown in Figure 3-4. This report
summarizes results at the program level. It includes actual numbers and percentages of verbs and branches executed as well as the number and percentage of filtered verbs and
Generating Code Coverage Reports 3-7 branches if filters were established before the report was generated. The report also provides the compile date and time for each program and indicates whether compiler optimization was used.
The DEBUG column indicates whether results were obtained while using debugging procedures or during normal non-debugging testing. This is important because the use of certain debugging commands can alter the natural flow of execution in a program.
The L/T column indicates both the programming language (L) and the Compuware product line type (T). Language selections available are C (COBOL), A (Assembler), and P
(PL/I). Defined Compuware product types are D (Xpediter/CICS) and T (Xpediter/TSO and Xpediter/IMS).
Figure 3-4. Program-Level Code Coverage Report
09/22/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 1
REPORT SELECTION CRITERIA
REPORT SELECTED: PROGRAM LEVEL REPORT (" MERGED>" DENOTES MULTIPLE SYSTEM(S)/MODULE(S))
REPORT REQUEST-> SYSTEM: TEST301 TEST ID: * USER ID: ALL LOAD MODULE: CWXTCOB PROGRAM: ALL
COMBINE DEBUG/NODEBUG: YES
COBOL PROCEDURE DIVISION ONLY: YES
SELECT VERBS EXECUTED: GT 005%
SELECT CRITICAL VERBS EXECUTED: GT 005%
REPOSITORIES: ACMJET0.XV17.REPOSIT
ACMNDF0.XV31.REPOSIT
ENTQA.XW.V30.REPOS
DDIO OVERRIDES: XV.XV31S1.DDIO
ACMNDF0.XV17.DDIO
CRITICAL STATEMENT MASK: DATE
STARTING IN COLUMN 01 ENDING IN COLUMN 80 WORD MATCH=N
EXCLUDE STATEMENT MASK: DISPLAY
STARTING IN COLUMN 01 ENDING IN COLUMN 80 WORD MATCH=N
START EXCLUDE BLOCK MASK: 000-MAINLINE
STARTING IN COLUMN 01 ENDING IN COLUMN 72
END EXCLUDE BLOCK MASK: ENDHERE
STARTING IN COLUMN 01 ENDING IN COLUMN 72
09/22/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 2
SYSTEM: TEST301 TEST ID: * USER ID: ALL LOAD MODULE: CWXTCOB PROGRAM: ALL
LOAD PROGRAM COMPILE COMPILE VERBS BRANCHES
SYSTEM TEST ID USER ID MODULE DATE TIME OPT DEBUG L/T EXEC TOTAL EXEC TOTAL
TEST301 SIMPLE ACMJET0 CWXTCOB CWXTCOB 06/06/2015 12:31:47 N N CT 68% 193 62% 40
*** CRITICAL FILTER TOTALS: 70% 10 0% 0
*** EXCLUDE FILTER TOTALS: 75% 151 67% 34
*** NET COVERAGE TOTALS: 45% 42 33% 6
TEST301 SIMPLE ACMJET0 CWXTCOB CWXTDATE 04/10/2012 07:43:04 N N CT 63% 19 56% 16
*** CRITICAL FILTER TOTALS: 100% 1 50% 2
*** EXCLUDE FILTER TOTALS: 63% 19 56% 16
*** NET COVERAGE TOTALS: 0% 0 0% 0
Annotated Listing
An example of an annotated listing hardcopy batch report is shown in Figure 3-5 on page
3-9 through Figure 3-9 on page 3-13. This report details results down to the line level for
one or more programs. It includes actual numbers and percentages of verbs and branches executed as well as the number and percentage of filtered verbs and branches if filters were established before the report was generated. This report is split into two sections: an annotated summary and an annotated listing.
The ANNOTATED SUMMARY section provides the compile date and time for each program and indicates whether compiler optimization was used. DEBUG MODE indicates whether results were obtained while using debugging procedures or during normal nondebugging testing. This is important because the use of certain debugging commands can alter the natural flow of execution in a program.
The ANNOTATED LISTING section of the report shows the source code of the selected program or programs with flags for each line indicating whether or not it was executed and, if so, how many times.
3-8 Xpediter/Code Coverage Mainframe User/Reference Guide
Table 3-1 describes the meaning of each of the source line flags that are used in Code
Coverage annotated listings.
Table 3-1.
Annotation Flags
Flag Description
E Executed: The machine code corresponding to this source line was executed.
E*
U
Execution of the machine code at the offset shared by this source line occurred. The last source line sharing that offset was flagged E.
Unexecuted: The machine code corresponding to this source line was not executed.
U*
B0
B1
B2
B3
B4
X
Execution of the machine code at the offset shared by this source line did not occur. The last source line sharing that offset was flagged U.
No execution or branching: The machine code corresponding to this conditional verb was not executed, and no branches were taken.
Statements under the true branch were executed. Note: If a true condition does not contain any executable statements, then B1 indicates that statements under the false branch were executed.
An example is when the true branch contains the statement NEXT SENTENCE.
Statements under the false branch were executed. Note: If a true condition does not contain any executable statements, then B2 indicates that statements under the false branch were not executed. An example is when the true branch contains the statement NEXT SENTENCE.
Both branches taken: The machine code corresponding to this conditional verb, the machine code immediately following it, and the machine code not immediately following it were executed.
Executed without branching: An abnormal condition in which the machine code corresponding to this conditional verb was executed, but no branches were taken.
The source line has been completely “optimized out” of the compiler output.
Generating Code Coverage Reports 3-9
Figure 3-5. Annotated Listing Code Coverage Report (First Portion)
07/20/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 1
REPORT SELECTION CRITERIA
REPORT SELECTED: ANNOTATED LISTING
REPORT REQUEST-> SYSTEM: TEST301 TEST ID: ALL USER ID: ALL LOAD MODULE: CWXTCOB PROGRAM: CWXTCOB
COMBINE DEBUG/NODEBUG: YES
COBOL PROCEDURE DIVISION ONLY: YES
REPOSITORIES: ACMJET0.XV17.REPOSIT
ACMJET0.XV31.REPOSIT
DDIO OVERRIDES: XV.XV31S1.DDIO
ACMJET0.XV17.DDIO
CRITICAL STATEMENT MASK: DATE
STARTING IN COLUMN 01 ENDING IN COLUMN 80
EXCLUDE STATEMENT MASK: DISPLAY
STARTING IN COLUMN 01 ENDING IN COLUMN 80
START EXCLUDE BLOCK MASK: 7000-PRINT-REGION-REPORT.
STARTING IN COLUMN 01 ENDING IN COLUMN 80
END EXCLUDE BLOCK MASK: MOVE 10
STARTING IN COLUMN 01 ENDING IN COLUMN 80
07/20/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 2
ANNOTATED SUMMARY
FOR CWXTCOB
PROGRAM: CWXTCOB
MODULE: CWXTCOB
SYSTEM: TEST301
TEST ID: SIMPLE
USER ID: ACMJET0
COMPILE DATE: 06/06/2015
COMPILE TIME: 12:31:47
COLLECTION ENGINE: XPEDITER/TSO
DEBUG MODE: NO
COMPILER LANGUAGE: COBOLII R4
OPTIMIZED: NO
ONE OR MORE COLLECTIONS HAD BRANCH COVERAGE DISABLED
------------------------------------------------------TOTAL COVERAGE----------------------------------------------------------------
EXECUTABLE VERBS: 193 VERBS EXECUTED: 133 VERB PERCENT COVERED: 68%
EXECUTABLE BRANCHES: 40 BRANCHES EXECUTED: 25 BRANCH PERCENT COVERED: 62%
------------------------------------------------------CRITICAL FILTER COVERAGE------------------------------------------------------
EXECUTABLE VERBS: 10 VERBS EXECUTED: 7 VERB PERCENT COVERED: 70%
EXECUTABLE BRANCHES: 0 BRANCHES EXECUTED: 0 BRANCH PERCENT COVERED: N/A
------------------------------------------------------EXCLUDE FILTER COVERAGE------------------------------------------------------
EXECUTABLE VERBS: 48 VERBS EXECUTED: 0 VERB PERCENT COVERED: 0%
EXECUTABLE BRANCHES: 4 BRANCHES EXECUTED: 0 BRANCH PERCENT COVERED: 0%
------------------------------------------------------NET COVERAGE (TOTAL COVERAGE minus EXCLUDE FILTERS) --------------------------
EXECUTABLE VERBS: 145 VERBS EXECUTED: 133 VERB PERCENT COVERED: 91%
EXECUTABLE BRANCHES: 36 BRANCHES EXECUTED: 25 BRANCH PERCENT COVERED: 69%
* Critical and exclude filters overlapped. See annotated report.
----------------------------------------------------LEGEND FOR ANNOTATION FLAGS-----------------------------------------------------
E=EXECUTED U=UNEXECUTED B0=CONDITIONAL NOT EXECUTED
B1=VERB IMMEDIATELY FOLLOWING CONDITIONAL EXECUTED B2=VERB NOT IMMEDIATELY FOLLOWING CONDITIONAL EXECUTED
B3=BOTH PATHS OF CONDITIONAL EXECUTED B4=CONDITIONAL WITH NO EXECUTED PATHS
07/20/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 3
ANNOTATED LISTING
FOR CWXTCOB
LINE FLAGS ----------------------------------SOURCE---------------------------------------- FREQUENCY
344 PROCEDURE DIVISION USING PARMINFO.
345 0000-MAINLINE.
346 E PERFORM 9000-OPEN.
347 E PERFORM 9100-CHECK-PARM.
348 B1 IF GOOD-PARM
349 E PERFORM 9200-INIT
350 E PERFORM 8000-READ-INPUT
351 UNTIL RECORDS-READ = START-NUMBER
352 OR END-OF-FILE
353 E PERFORM 1000-PROCESS-DATA
354 UNTIL END-OF-FILE
355 E PERFORM 6000-PRINT-EMPLOYEE-REPORT
356 E MOVE 1 TO REGION-SUB
357 B2 IF END-OF-MONTH
358 U PERFORM 7000-PRINT-REGION-REPORT
359 UNTIL REGION-SUB > 4.
360 E PERFORM 9900-CLOSE.
361 E GOBACK.
362 *********
363 ********* DIFFERENT PROCESSING OCCURS BASED ON EMPLOYEE TYPE. THERE
364 ********* ARE 3 VALID EMPLOYEE TYPES. IF A RECORD IS READ CONTAINING
365 ********* A RECORD TYPE OTHER THAN H, S OR M, AN ERROR MESSAGE IS
366 ********* WRITTEN AND PROCESSING CONTINUES.
367 *********
368 1000-PROCESS-DATA.
369 B3 IF HOURLY
370 E PERFORM 2000-PROCESS-HOURLY
371 ELSE
372 B3 IF SALES
373 E PERFORM 3000-PROCESS-SALES
374 ELSE
375 B1 IF MANAGEMENT
376 E PERFORM 4000-PROCESS-MANAGEMENT
377 ELSE
378 U MOVE ' INVALID EMPLOYEE TYPE ' TO ERROR-LINE
379 U WRITE REPORT-RECORD FROM ERROR-LINE.
3-10 Xpediter/Code Coverage Mainframe User/Reference Guide
Figure 3-6. Annotated Listing Code Coverage Report (Second Portion)
380 E PERFORM 8000-READ-INPUT.
381 *********
382 ********* CALCULATE TYPE H (HOURLY) EMPLOYEE COMPENSATION. ANY
383 ********* EMPLOYEE WITH MORE THAN 40 HOURS RECEIVES OVERTIME COMPUTED
384 ********* AT 1.5 TIMES THEIR HOURLY RATE. ONCE EMPLOYEE COMPENSATION
385 ********* IS CALCULATED, IT IS STORED IN A HOLD TABLE. THE DATA IN
386 ********* THE HOLD TABLE IS USED FOR PRINTING THE EMPLOYEE COMPENSATION
387 ********* REPORT.
388 *********
389 2000-PROCESS-HOURLY.
390 E MOVE ZERO TO OT-AMOUNT.
391 B3 IF WA-EMP-HOURS GREATER THAN 40
392 E COMPUTE EMP-WAGES = WA-EMP-RATE * 40
393 E COMPUTE OT-HOURS = WA-EMP-HOURS - 40
394 E COMPUTE OT-AMOUNT = OT-HOURS * (WA-EMP-RATE * 1.5)
395 ELSE
396 E COMPUTE EMP-WAGES = WA-EMP-HOURS * WA-EMP-RATE.
397 E COMPUTE EMP-COMPENSATION = EMP-WAGES + OT-AMOUNT.
07/20/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 4
ANNOTATED LISTING
FOR CWXTCOB
LINE FLAGS ----------------------------------SOURCE---------------------------------------- FREQUENCY
398 E ADD EMP-COMPENSATION TO GRAND-TOTAL-EMP.
399 E CALL 'CWXTDATE' USING END-OF-MONTH-SW *CRITICAL FILTER*
400 YRS-OF-SERVICE
401 TODAYS-DATE *CRITICAL FILTER*
402 WA-EMP-HIRE-DATE. *CRITICAL FILTER*
403 E PERFORM 5000-STORE-EMPLOYEE-DETAIL.
404 E SET HOLD-IX UP BY 1.
405 *********
406 ********* CALCULATE TYPE S (SALES) EMPLOYEE COMPENSATION. THE TOTAL
407 ********* SALES FOR THE EMPLOYEE IS PASSED TO THE CALLED PROGRAM WHICH
408 ********* CALCULATES COMMISSION. ONCE EMPLOYEE COMPENSATION IS
409 ********* RETURNED FROM CWXTSUBC, IT IS STORED IN A HOLD-TABLE. THE
410 ********* DATA IN THE HOLD-TABLE IS USED FOR PRINTING THE EMPLOYEE
411 ********* COMPENSATION REPORT.
412 *********
413 3000-PROCESS-SALES.
414 B1 IF WA-SALES-AMOUNT > 0
415 E ADD WA-SALES-AMOUNT TO REGION-SALES (WA-EMP-REGION)
416 E MOVE WA-SALES-AMOUNT TO CALC-SALES
417 E MOVE 0 TO CALC-COMMISSION
418 E MOVE 'S' TO EMP-TYPE
419 E CALL 'CWXTSUBC' USING EMP-TYPE,
420 CALC-SALES,
421 CALC-COMMISSION
422 ELSE
423 U MOVE 'UH-OH' TO REGION-COMMENT (WA-EMP-REGION).
424 E COMPUTE EMP-COMPENSATION = WA-SALES-SALARY +
425 CALC-COMMISSION.
426 E ADD EMP-COMPENSATION TO GRAND-TOTAL-EMP.
427 E CALL 'CWXTDATE' USING END-OF-MONTH-SW *CRITICAL FILTER*
428 YRS-OF-SERVICE
429 TODAYS-DATE *CRITICAL FILTER*
430 WA-EMP-HIRE-DATE. *CRITICAL FILTER*
431 E PERFORM 5000-STORE-EMPLOYEE-DETAIL.
432 E SET HOLD-IX UP BY 1.
433 *********
434 ********* PROCESS TYPE M (MANAGEMENT) RECORDS. THE MANAGER NAME AND
435 ********* SALARY ARE STORED IN A TABLE FOR USE DURING PRINTING OF THE
436 ********* REGIONAL SALES REPORT.
437 *********
438 4000-PROCESS-MANAGEMENT.
439 E MOVE WA-EMP-NAME TO REGION-MANAGER (WA-EMP-REGION).
440 E MOVE WA-MGMT-SALARY TO REGION-SALARY (WA-EMP-REGION).
441 *********
442 ********* SALES AND HOURLY EMPLOYEE DATA IS STORED IN A HOLD TABLE FOR
443 ********* PRINTING OF EMPLOYEE COMPENSATION REPORT. THE HOLD TABLE IS
444 ********* A TWO-DIMENSIONAL TABLE AND HOLDS DATA FOR A MAXIMUM OF 20
445 ********* EMPLOYEES.
446 *********
447 5000-STORE-EMPLOYEE-DETAIL.
448 E PERFORM 5100-SET-INDEX.
449 B1 IF VALID-REGION
450 E MOVE WA-EMP-NAME TO HOLD-NAME (REG-IX, HOLD-IX)
451 E MOVE REGION-ID (WA-EMP-REGION)
07/20/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 5
ANNOTATED LISTING
FOR CWXTCOB
LINE FLAGS ----------------------------------SOURCE---------------------------------------- FREQUENCY
452 TO HOLD-REGION (REG-IX, HOLD-IX)
453 E MOVE WA-EMP-TYPE TO HOLD-TYPE (REG-IX, HOLD-IX)
454 E MOVE WA-EMP-HIRE-DATE TO HOLD-HIRE-DATE (REG-IX, HOLD-IX) *CRITICAL FILTER*
455 E MOVE YRS-OF-SERVICE TO HOLD-YEARS (REG-IX, HOLD-IX)
456 E MOVE EMP-COMPENSATION
457 TO HOLD-TOTAL (REG-IX, HOLD-IX)
458 B3 IF HOURLY
459 E MOVE EMP-WAGES TO HOLD-WAGES (REG-IX, HOLD-IX)
460 E MOVE OT-AMOUNT TO HOLD-OT (REG-IX, HOLD-IX)
461 ELSE
462 E MOVE WA-SALES-SALARY
463 TO HOLD-WAGES (REG-IX, HOLD-IX)
464 E MOVE CALC-COMMISSION
465 TO HOLD-COMM (REG-IX, HOLD-IX).
466 *********
467 ********* SET THE REGION INDEX BASED ON EMPLOYEE REGION ID AND
468 ********* SEQUENTIALLY INCREMENT HOLD INDEX WITHIN EACH REGION.
469 ********* THE EMPLOYEE COMPENSATION REPORT WILL BE GROUPED BY
Generating Code Coverage Reports 3-11
Figure 3-7. Annotated Listing Code Coverage Report (Third Portion)
470 ********* REGION. IF AN INVALID REGION IS FOUND, AN ERROR MESSAGE
471 ********* IS WRITTEN AND PROCESSING CONTINUES.
472 *********
473 5100-SET-INDEX.
474 E MOVE 'N' TO REGION-ERROR-SW.
475 B3 IF NORTH
476 E ADD 1 TO NORTH-COUNT
477 E SET HOLD-IX TO NORTH-COUNT
478 ELSE
479 B3 IF SOUTH
480 E ADD 1 TO SOUTH-COUNT
481 E SET HOLD-IX TO SOUTH-COUNT
482 ELSE
483 B3 IF EAST
484 E ADD 1 TO EAST-COUNT
485 E SET HOLD-IX TO EAST-COUNT
486 ELSE
487 B1 IF WEST
488 E ADD 1 TO WEST-COUNT
489 E SET HOLD-IX TO WEST-COUNT
490 ELSE
491 U MOVE 'Y' TO REGION-ERROR-SW.
492 B1 IF VALID-REGION
493 E SET REG-IX TO WA-EMP-REGION.
494 *********
495 ********* COMPENSATION DATA FOR HOURLY AND SALES EMPLOYEES ARE PRINTED
496 ********* TO THE EMPLOYEE COMPENSATION REPORT FROM THE HOLD TABLE.
497 *********
498 6000-PRINT-EMPLOYEE-REPORT.
499 E SET REG-IX TO 1.
500 E PERFORM 6100-PRINT-EMPLOYEE-DETAIL
501 VARYING HOLD-IX FROM 1 BY 1
502 UNTIL HOLD-IX > NORTH-COUNT.
503 E SET REG-IX TO 2.
504 E PERFORM 6100-PRINT-EMPLOYEE-DETAIL
505 VARYING HOLD-IX FROM 1 BY 1
07/20/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 6
ANNOTATED LISTING
FOR CWXTCOB
LINE FLAGS ----------------------------------SOURCE---------------------------------------- FREQUENCY
506 UNTIL HOLD-IX > SOUTH-COUNT.
507 E SET REG-IX TO 3.
508 E PERFORM 6100-PRINT-EMPLOYEE-DETAIL
509 VARYING HOLD-IX FROM 1 BY 1
510 UNTIL HOLD-IX > EAST-COUNT.
511 E SET REG-IX TO 4.
512 E PERFORM 6100-PRINT-EMPLOYEE-DETAIL
513 VARYING HOLD-IX FROM 1 BY 1
514 UNTIL HOLD-IX > WEST-COUNT.
515 E WRITE REPORT-RECORD FROM BLANK-LINE.
516 E MOVE GRAND-TOTAL-EMP TO EMP-GRAND-TOTAL.
517 E WRITE REPORT-RECORD FROM EMP-TOTAL-DTL.
518 *********
519 ********* PRINT DETAIL LINES FOR EMPLOYEE COMPENSATION REPORT
520 *********
521 6100-PRINT-EMPLOYEE-DETAIL.
522 B3 IF EMP-LINE-COUNT GREATER THAN 55
523 E PERFORM 6200-PRINT-EMPLOYEE-HEADERS.
524 E MOVE HOLD-NAME (REG-IX, HOLD-IX) TO EMP-DTL-NAME.
525 E MOVE HOLD-REGION (REG-IX, HOLD-IX) TO EMP-DTL-REGION.
526 E MOVE HOLD-TYPE (REG-IX, HOLD-IX) TO EMP-DTL-TYPE.
527 E MOVE HOLD-HIRE-MM(REG-IX, HOLD-IX) TO EMP-DTL-HIRE-MM.
528 E MOVE '/' TO EMP-DTL-SLASH1.
529 E MOVE HOLD-HIRE-DD(REG-IX, HOLD-IX) TO EMP-DTL-HIRE-DD.
530 E MOVE '/' TO EMP-DTL-SLASH2.
531 E MOVE HOLD-HIRE-YY(REG-IX, HOLD-IX) TO EMP-DTL-HIRE-YY.
532 E MOVE HOLD-YEARS (REG-IX, HOLD-IX) TO EMP-DTL-YRS-OF-SERVICE.
533 E MOVE HOLD-WAGES (REG-IX, HOLD-IX) TO EMP-DTL-WAGES.
534 E MOVE HOLD-OT (REG-IX, HOLD-IX) TO EMP-DTL-OT.
535 E MOVE HOLD-COMM (REG-IX, HOLD-IX) TO EMP-DTL-COMM.
536 E MOVE HOLD-TOTAL (REG-IX, HOLD-IX) TO EMP-DTL-TOTAL.
537 E WRITE REPORT-RECORD FROM EMPLOYEE-DTL
538 AFTER ADVANCING 1 LINE.
539 E ADD 1 TO EMP-LINE-COUNT.
540 E MOVE SPACES TO EMPLOYEE-DTL.
541 *********
542 ********* PRINT HEADERS FOR EMPLOYEE COMPENSATION REPORT
543 *********
544 6200-PRINT-EMPLOYEE-HEADERS.
545 E MOVE PAGE-COUNT TO EMP-PAGE.
546 E MOVE DATE-YY TO EMP-RUN-YY. *CRITICAL FILTER*
547 E MOVE DATE-MM TO EMP-RUN-MM. *CRITICAL FILTER*
548 E MOVE DATE-DD TO EMP-RUN-DD. *CRITICAL FILTER*
549 E WRITE REPORT-RECORD FROM BLANK-LINE.
550 E WRITE REPORT-RECORD FROM BLANK-LINE.
551 E WRITE REPORT-RECORD FROM BLANK-LINE.
552 E WRITE REPORT-RECORD FROM EMPLOYEE-HDR1.
553 E WRITE REPORT-RECORD FROM BLANK-LINE.
554 E WRITE REPORT-RECORD FROM BLANK-LINE.
555 E WRITE REPORT-RECORD FROM EMPLOYEE-HDR2.
556 E WRITE REPORT-RECORD FROM EMPLOYEE-HDR3.
557 E WRITE REPORT-RECORD FROM BLANK-LINE.
558 E ADD 1 TO PAGE-COUNT.
559 E MOVE 9 TO EMP-LINE-COUNT.
3-12 Xpediter/Code Coverage Mainframe User/Reference Guide
Figure 3-8. Annotated Listing Code Coverage Report (Fourth Portion)
07/20/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 7
ANNOTATED LISTING
FOR CWXTCOB
LINE FLAGS ----------------------------------SOURCE---------------------------------------- FREQUENCY
560 *********
561 ********* COMPENSATION DATA FOR MANAGEMENT EMPLOYEES IS PRINTED
562 ********* TO THE REGIONAL SALES REPORT. THE TOTAL SALES FOR THE
563 ********* REGION IS PASSED TO THE CALLED PROGRAM WHICH CALCULATES
564 ********* COMMISSION. THIS REPORT IS GENERATED AT END-OF-MONTH.
565 ********* STARTHERE
566 7000-PRINT-REGION-REPORT. *EXCLUDE FILTER*
567 B0 IF REG-LINE-COUNT GREATER THAN 55 *EXCLUDE FILTER*
568 U PERFORM 7100-PRINT-REGION-HEADERS. *EXCLUDE FILTER*
569 U MOVE SPACES TO REGION-DETAIL. *EXCLUDE FILTER*
570 U MOVE REGION-NAME (REGION-SUB) TO REG-DTL-REGION. *EXCLUDE FILTER*
571 U MOVE REGION-MANAGER (REGION-SUB) TO REG-DTL-MANAGER. *EXCLUDE FILTER*
572 U MOVE REGION-SALARY (REGION-SUB) TO REG-DTL-SALARY. *EXCLUDE FILTER*
573 U MOVE REGION-SALES (REGION-SUB) TO REG-DTL-SALES. *EXCLUDE FILTER*
574 U MOVE REGION-SALES (REGION-SUB) TO CALC-SALES. *EXCLUDE FILTER*
575 U MOVE REGION-COMMENT (REGION-SUB) TO REG-DTL-COMMENT. *EXCLUDE FILTER*
576 U MOVE 'M' TO EMP-TYPE. *EXCLUDE FILTER*
577 U CALL 'CWXTSUBC' USING EMP-TYPE, *EXCLUDE FILTER*
578 CALC-SALES, *EXCLUDE FILTER*
579 CALC-COMMISSION. *EXCLUDE FILTER*
580 U MOVE CALC-COMMISSION TO REG-DTL-COMM. *EXCLUDE FILTER*
581 U COMPUTE MGMT-COMPENSATION = CALC-COMMISSION + *EXCLUDE FILTER*
582 REGION-SALARY(REGION-SUB). *EXCLUDE FILTER*
583 U ADD MGMT-COMPENSATION TO GRAND-TOTAL-MGMT. *EXCLUDE FILTER*
584 U MOVE MGMT-COMPENSATION TO REG-DTL-TOTAL. *EXCLUDE FILTER*
585 U WRITE REPORT-RECORD FROM REGION-DETAIL. *EXCLUDE FILTER*
586 B0 IF REGION-SUB = 4 *EXCLUDE FILTER*
587 U WRITE REPORT-RECORD FROM BLANK-LINE *EXCLUDE FILTER*
588 U MOVE GRAND-TOTAL-MGMT TO MGMT-GRAND-TOTAL *EXCLUDE FILTER*
589 U WRITE REPORT-RECORD FROM MGMT-TOTAL-DTL. *EXCLUDE FILTER*
590 U ADD 1 TO REG-LINE-COUNT. *EXCLUDE FILTER*
591 U ADD 1 TO REGION-SUB. *EXCLUDE FILTER*
592 ********* ENDHERE *EXCLUDE FILTER*
593 ********* PRINT HEADERS FOR REGIONAL SALES REPORT *EXCLUDE FILTER*
594 ********* *EXCLUDE FILTER*
595 7100-PRINT-REGION-HEADERS. *EXCLUDE FILTER*
596 U MOVE PAGE-COUNT TO REG-PAGE. *EXCLUDE FILTER*
597 U MOVE DATE-YY TO REG-RUN-YEAR. *CRIT/EXC FILTER*
598 U MOVE DATE-MM TO REG-RUN-MONTH. *CRIT/EXC FILTER*
599 U MOVE DATE-DD TO REG-RUN-DAY. *CRIT/EXC FILTER*
600 U WRITE REPORT-RECORD FROM BLANK-LINE. *EXCLUDE FILTER*
601 U WRITE REPORT-RECORD FROM BLANK-LINE. *EXCLUDE FILTER*
602 U WRITE REPORT-RECORD FROM BLANK-LINE. *EXCLUDE FILTER*
603 U WRITE REPORT-RECORD FROM BLANK-LINE. *EXCLUDE FILTER*
604 U WRITE REPORT-RECORD FROM BLANK-LINE. *EXCLUDE FILTER*
605 U WRITE REPORT-RECORD FROM REGION-HDR1. *EXCLUDE FILTER*
606 U WRITE REPORT-RECORD FROM BLANK-LINE. *EXCLUDE FILTER*
607 U WRITE REPORT-RECORD FROM BLANK-LINE. *EXCLUDE FILTER*
608 U WRITE REPORT-RECORD FROM REGION-HDR2. *EXCLUDE FILTER*
609 U WRITE REPORT-RECORD FROM BLANK-LINE. *EXCLUDE FILTER*
610 U ADD 1 TO PAGE-COUNT. *EXCLUDE FILTER*
611 U MOVE 10 TO REG-LINE-COUNT. *EXCLUDE FILTER*
612 *********
613 *********
07/20/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 8
ANNOTATED LISTING
FOR CWXTCOB
LINE FLAGS ----------------------------------SOURCE---------------------------------------- FREQUENCY
614 8000-READ-INPUT.
615 E READ EMPLOYEE-FILE INTO EMPLOYEE-WORK-AREA
616 AT END
617 E MOVE 'Y' TO EOF-SW.
618 E ADD 1 TO RECORDS-READ.
619 *********
620 *********
621 9000-OPEN.
622 E OPEN INPUT EMPLOYEE-FILE.
623 E OPEN OUTPUT REPORT-FILE.
624 *********
625 ********* VALID PARMS ARE BLANK OR 5 DIGIT NUMBER
626 *********
627 9100-CHECK-PARM.
628 B1 IF PARM-LTH = 5
629 B1 IF PARM-DATA IS NUMERIC
630 E MOVE PARM-DATA TO START-NUMBER
631 ELSE
632 U PERFORM 9800-BAD-PARM
633 ELSE
634 B0 IF PARM-LTH = 0
635 U MOVE 1 TO START-NUMBER
636 ELSE
637 U PERFORM 9800-BAD-PARM.
638 *********
639 *********
640 9200-INIT.
641 E MOVE 1 TO REGION-SUB.
642 E PERFORM 9300-INITIALIZE-REGION-TABLE
643 UNTIL REGION-SUB > 4.
644 E SET HOLD-IX TO 1.
645 E ACCEPT TODAYS-DATE FROM DATE. *CRITICAL FILTER*
646 *********
647 *********
648 9300-INITIALIZE-REGION-TABLE.
649 E MOVE SPACES TO REGION-MANAGER (REGION-SUB).
Generating Code Coverage Reports 3-13
Figure 3-9. Annotated Listing Code Coverage Report (Fifth Portion)
650 E MOVE SPACES TO REGION-COMMENT (REGION-SUB).
651 E MOVE 0 TO REGION-SALARY (REGION-SUB).
652 E MOVE 0 TO REGION-SALES (REGION-SUB).
653 E ADD 1 TO REGION-SUB.
654 *********
655 *********
656 9800-BAD-PARM.
657 U MOVE 'Y' TO PARM-ERROR-SW.
658 U MOVE ' PARAMETER LENGTH OR DATA IS INCORRECT '
659 TO ERROR-LINE.
660 U WRITE REPORT-RECORD FROM ERROR-LINE.
661 *********
662 *********
663 9900-CLOSE.
664 E CLOSE EMPLOYEE-FILE.
665 E CLOSE REPORT-FILE.
666 *********
667 *********
07/20/2015 COMPUWARE CORPORATION CODE COVERAGE 17.02 PAGE 9
ANNOTATED LISTING
FOR CWXTCOB
LINE FLAGS ----------------------------------SOURCE---------------------------------------- FREQUENCY
668 9999-RIP.
669 U DISPLAY ' ************ '. *EXCLUDE FILTER*
670 U DISPLAY ' * * '. *EXCLUDE FILTER*
671 U DISPLAY ' * T H I S * '. *EXCLUDE FILTER*
672 U DISPLAY ' * * '. *EXCLUDE FILTER*
673 U DISPLAY ' * I S * '. *EXCLUDE FILTER*
674 U DISPLAY ' * * '. *EXCLUDE FILTER*
675 U DISPLAY ' * D E A D * '. *EXCLUDE FILTER*
676 U DISPLAY ' * * '. *EXCLUDE FILTER*
677 U DISPLAY ' * C O D E * '. *EXCLUDE FILTER*
678 U DISPLAY ' ****************** '. *EXCLUDE FILTER*
3-14 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.