Browse Prior Art Database

Determination of Code Coverage

IP.com Disclosure Number: IPCOM000050612D
Original Publication Date: 1982-Nov-01
Included in the Prior Art Database: 2005-Feb-10
Document File: 1 page(s) / 12K

Publishing Venue

IBM

Related People

Bradley, DJ: AUTHOR [+3]

Abstract

During he testing phase of a software project, it is desirable to determine whether all conditional paths have been executed. The two-part algorithm set out below is useful in accomplishing such a test. 1. Find and mark conditional instructions: A. Identify those areas to be marked for cover analysis. B. Examine the identified sections of the code and replace the conditional instructions with a call instruction to a special handler (see part 2). C. Construct a table containing address and original opcode of the marked conditional instructions. 2. Execute test cases and determine coverage: A. Test cases designed to exercise all portions of of the code. B.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 93% of the total text.

Page 1 of 1

Determination of Code Coverage

During he testing phase of a software project, it is desirable to determine whether all conditional paths have been executed. The two-part algorithm set out below is useful in accomplishing such a test. 1. Find and mark conditional instructions:

A. Identify those areas to be marked for cover

analysis.

B. Examine the identified sections of the code

and replace the conditional instructions with

a call instruction to a special handler (see

part 2).

C. Construct a table containing address and original

opcode of the marked conditional instructions.

2. Execute test cases and determine coverage:

A. Test cases designed to exercise all portions of

of the code.

B. When the special handler is called (from a

replaced conditional instruction), search the table

of 1C to determine the instruction that should

be executed.

C. Simulate the original instruction by the special

handler.

D. Update the table to show which direction of the

branch was taken.

E. If both directions of the branch have been taken,

replace the call to the special handler by the

original opcode to lessen the overhead and

subsequent executions.

F. Return control to the program at the point

determined by the simulation of the instruction.

G. After all test cases have been executed, display

the table to show all paths that have not been

executed and the address at which they are.

Any instruction generating a software interrupt may be used to pass control to the special handler. If t...