# US 2004/0210874 A1 · Automatic test program generation method

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2004/0210874 A1
- Document ID: US20040210874A1
- Status: Published application
- Kind: A1
- Application number: 10/760,366
- Filed: 2004-01-21
- Published: 2004-10-21
- Earliest claimed: 2003-01-21
- Assignees: Hitachi, Ltd.; Hitachi Information Technology Co., Ltd.
- Inventors: Naohiro Kageyama; Zentaro Hirose; Michiyuki Kawauchi; Takeshi Fukuma
- Web page: https://patentgrep.com/patent/US20040210874A1

## CPC

- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Architecturally complicated computers require functionally complicated compiler. For such a compiler, the present invention provides an automatic compiler test program generation method capable of reducing the man-hour required to prepare a test program and testing many aspects of the compiler. By a random number-used method, a plurality of program cells are selected from a set of program cells each of which may form an element of a test program. The selected program cells are combined into a test program.

## Claims

### Claim 1

An automatic compiler test program generation method, comprising the steps of:
selecting a plurality of sub-procedural descriptions by a random number-used method from a set of sub-procedural descriptions each of which may form an element of a compiler test program; and
combining the selected sub-procedural descriptions to generate a compiler test program.

### Claim 2 (depends on 1)

An automatic compiler test program generation method according to claim 1, wherein each sub-procedural description is assigned a value which indicates the probability of the sub-procedural description being selected and the value is reflected in the random number-used selection of sub-procedural descriptions.

### Claim 3 (depends on 1)

An automatic compiler test program generation method according to claim 1, wherein variables included in the selected plural sub-procedural descriptions are made shared by the selected sub-procedural descriptions when the selected sub-procedural descriptions are combined.

### Claim 4 (depends on 1)

An automatic compiler test program generation method according to claim 1, wherein each selectable sub-procedural description internally has a procedure to display a result of having a computer execute the sub-procedural description on a display unit of the computer and/or a procedure to store the result in a storage unit of the computer.

### Claim 5

An automatic compiler test program generation method, comprising the steps of:
selecting a plurality of program cells by a random number-used method from a set of program cells each of which may form an element of a test program for a compiler after compiled by the compiler; and
combining the selected program cells to generate a test program;
wherein each program cell has a description which specifying whether the program cell is to be compiled alone or in combination with the other selected program cells.

### Claim 6 (depends on 5)

An automatic compiler test program generation method according to claim 5, wherein the set of program cells includes at least a basic cell where procedures are listed in the order of execution, a control cell (repeat cell) described to repeat a procedure, a control cell (select cell) described to select a procedure and a function cell described to call a function.

### Claim 7 (depends on 6)

An automatic compiler test program generation method according to claim 6, wherein the selected program cells are registered with a table in the order of selection and the registered cells are given the following combining process in the order of registration:
(1) if the cell preceding the current program cell is said basic cell or said function cell, the current cell is concatenated to the preceding cell; and
(2) if the cell preceding the current program cell is said control cell, the current program cell is nested into the preceding cell.

### Claim 8 (depends on 7)

An automatic compiler test program generation method according to claim 7, wherein the variables included in the selected plural program cells are made sharable among the selected program cells when the selected program cells are combined by the combining process.

### Claim 9

A compiler test system comprising:
test program generation means for generating a test-program;
testing means for taking in the generated test program, compiling the test program by using a test target compiler and outputting an execution result;
expected value generating means for taking in the generated test program, compiling the test program by using a proven compiler and outputting an expected value; and
result comparison means for taking in the execution result and the expected value for comparison with each other and storing the comparison result in a storage unit as a test result.

### Claim 10 (depends on 9)

A compiler test system according to claim 9, wherein the test program generation means selects a plurality of sub-procedural descriptions by a random number-used method from a set of sub-procedural descriptions each of which may form an element of a test program for a compiler, and combines the selected sub-procedural descriptions to generate a test program.

### Claim 11

A compiler test method comprising the steps of:
generating a test program;
taking in the generated test program, compiling the test program by using a test target compiler and outputting an execution result;
taking in the generated test program, compiling the test program by using a proven compiler and outputting an expected value;
taking in the execution result and the expected value for comparison with each other; and
storing the comparison result in a storage unit as a test result.

### Claim 12 (depends on 11)

A compiler test method according to claim 11, wherein the step of generating a test program comprises the sub-steps of:
selecting a plurality of sub-procedural descriptions by a random number-used method from a set of sub-procedural descriptions each of which may form an element of a test program for a compiler; and
combining the selected sub-procedural description to generate a test program.

### Claim 13

A program product for allowing a computer to execute a functional verification process for a compiler, said functional verification process comprising the steps of:
selecting a plurality of sub-procedural descriptions by a random number-used method from a set of sub-procedural descriptions each of which may form an element of a test program for a compiler;
combining the selected sub-procedural descriptions to generate a test program;
taking in the generated test program, compiling the test program by using a test target compiler and outputting an execution result;
taking in the generated test program, compiling the test program by using a proven compiler and outputting an expected value;
taking in the execution result and the expected value for comparison with each other; and
storing the comparison result in a storage unit as a test result.
