Skip to main content

Problem:

We ran the Test Coverage report for our program, but the results of the report were incorrect for WHEN clauses under an EVALUATE verb.

Resolution:

The Micro Focus compiler is a one-pass compiler and as such is building logical blocks of code internally as it scans the user source code. Test Coverage is intended to be used after a program has been debugged and one wants to see a report of the executed code.

The documented restrictions can be found in the Online Help via the Index tab. Type in 'test co' and the list will show various topics for Test Coverage. From here you can see 'restrictions' listed. Also, please make special note of the sub-entry 'TCReport'. This explains the options Test Coverage can use.

So, with that said, let me explain what has happened to your EVALUATE. As the compiler builds its references to Cobol verbs and clauses, it is using internal 'blocks' of code to separate the logic and consequently Test Coverage's logic flow mappings. Add the BLOCKNUM option to your reports by selecting Tools>Test Coverage>Report, and clicking the 'Basic block numbers' option on the 'Test coverage report' window in the 'Report content options' area. See attachment BlkNum.Jpg.

This option will list the compiler blocks and show you where each starts and ends. Our blocks are slightly different from what IBM's compiler might show if you used the LIST compiler option on the host to see the generated Assembler code, so it stands to reason why this is initially confusing to our customers.

Also attached is a test project, TCBLKS.Zip, using two inline PERFORMs each with its own EVALUATE and IF respectively. This was built using Mainframe Express v3.1. This test case will illustrate how Micro Focus defines blocks of code. With the BLOCKNUM option the Test Coverage report will show the counts for each block of user code.

Attachments:

BlkNum.Jpg

Old KB# 2584

#MFDS
#EnterpriseDeveloper