Browse Prior Art Database

Test Case Generator

IP.com Disclosure Number: IPCOM000051498D
Original Publication Date: 1981-Feb-01
Included in the Prior Art Database: 2005-Feb-10
Document File: 3 page(s) / 52K

Publishing Venue

IBM

Related People

Wang, JS: AUTHOR

Abstract

This article describes a new software testing tool which generates a minimum number of test cases guaranteeing 100% code coverage.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 3

Test Case Generator

This article describes a new software testing tool which generates a minimum number of test cases guaranteeing 100% code coverage.

Achieving software reliability is the final goal of a software designer. There are three major techniques used for this purpose: See Original. program verification, fault tolerance, and software testing. Program verification is limited to the small program at the current development stage. No automation is known to exist for generating input assertions and looping invariance, making this method useful as an ad hoc approach only. The fault tolerance approach, which includes steps such as introduce redundancy, roll back, and run time validation, is usually uneconomical and thus is used only as a partial solution for software reliability.

A more reasonable approach to software testing is to attempt l00% code coverage with a set of test cases such that every piece of code will be exercised at least once.

Fig. 1 is an example expressed in both syntax and flow-chart form used throughout this article. Uppercase letters represent conditions. Numerals represent actions.

Level is the complexity of "if statement" nesting. A condition is level 1 if it is the outermost one. A condition is level n if its next outer "if statement" is level n- 1. Note that the "do while statement" condition has no level.

Referring to Fig. 1, condition A is level 1 and condition B is level 2. B is on the true branch of A; that is, if the Boolean value of A is true, B will be tested. If A is false, then B is not tested. If A is false, then B is considered a 'don't care' condition. Since A has both true and false branches, the test case selected for this particular example should assign the Boolean value for A to be both true and false. B has only the true branch, so a test case forcing the false branch of B to be executed is unnecessary.

Information such as conditions, levels, the existence of an ELSE part of that condition, and whether this condition is on the true or false branch of the outer level condition must be collected before test cases can be generated. An Information Table is set up consisting of four arrays of size N: the COND array, LEVEL array, ELSE array, and SIDE array, where N is the total number of test conditions.

The Information Table for Fig. 1 is shown in Fig. 2. ELSE is 1 if the corresponding condition has an ELSE action. The entry of SIDE is 1 if the corresponding condition is on the true branch of the outer "if statement".

Path information can be created given the total number of test conditions present. In the example, there are 5. The total number of paths should...