# US 10,120,783 B2 · Determining test case efficiency

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

- Number: US 10,120,783 B2
- Document ID: US10120783B2
- Status: Granted
- Kind: B2
- Application number: 15/582,990
- Filed: 2017-05-01
- Published: 2017-09-14
- Granted: 2018-11-06
- Earliest claimed: 2015-01-22
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Michael S. Fulton; John R. MacMillan
- Web page: https://patentgrep.com/patent/US10120783B2

## CPC

- G06F 11/3676: {for coverage analysis}
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3692: {for test results analysis}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method, computer program product, and system is provided for determining test case efficiency. In an implementation, a method may include determining each code unit executed by a test case in a test suite including a plurality of test cases, wherein a product-under-test includes a plurality of code units. The method may also include determining an execution time for the test case. The method may further include calculating an efficiency rating of the test case based upon, at least in part, a number of code units executed by the test case and the execution time for the test case.

## Claims

### Claim 1

A computer-implemented method comprising:
determining, by a processor, each code unit executed by a test case in a test suite including a plurality of test cases based upon, at least in part, running the test case on a product-under-test in a code coverage mode, wherein the product-under-test includes a plurality of code units;
determining, by the processor, a number of times each of the plurality of code units is executed in the test suite;
determining, by the processor, an execution time for the test case;
determining a sanity rating for each of the plurality of test cases based upon, at least in part, a number of code units executed by the test case and the execution time for the test case;
generating a sanity model of the test suite based upon at least in part, the sanity rating of the plurality of test cases, wherein generating a sanity model includes displaying the sanity rating for each of the plurality of test cases included in the test suite; and
calculating, by the processor, an efficiency rating of the test case based upon, at least in part, an increment, for each code unit executed by the test case, of a reciprocal of the number of times each code unit is executed by the test suite and the execution time for the test case.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further including:
generating a code unit distribution model based upon, at least in part, the number of times each of the plurality of code units is executed in the test suite.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, further including:
generating an execution model of the test suite based upon, at least in part, the efficiency rating of the test case.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, further including:
defining an order of execution of the plurality of test cases based upon, at least in part, the execution model.

### Claim 5 (depends on 3)

The computer-implemented method of claim 3,
further including:
executing a subset of the test suite based upon, at least in part, the execution model.

### Claim 6

A computer program product comprising a non-transitory computer readable medium having a plurality of instructions stored thereon, which, when executed by a processor, cause the processor to perform operations including:
determining each code unit executed by a test case in a test suite including a plurality of test cases based upon, at least in part, running the test case on a product-under-test in a code coverage mode, wherein the product-under-test includes a plurality of code units;
determining a number of times each of the plurality of code units is executed in the test suite;
determining an execution time for the test case;
determining a sanity rating for each of the plurality of test cases based upon, at least in part, a number of code units executed by the test case and the execution time for the test case;
generating a sanity model of the test suite based upon at least in part, the sanity rating of the plurality of test cases, wherein generating a sanity model includes displaying the sanity rating for each of the plurality of test cases included in the test suite; and
calculating an efficiency rating of the test case based upon, at least in part, an increment, for each code unit executed by the test case, of a reciprocal of the number of times each code unit is executed by the test suite and the execution time for the test case.

### Claim 7 (depends on 6)

The computer program product of claim 6, further including:
generating a code unit distribution model based upon, at least in part, the number of times each of the plurality of code units is executed in the test suite.

### Claim 8 (depends on 6)

The computer program product of claim 6, further including:
generating an execution model of the test suite based upon, at least in part, the efficiency rating of the test case.

### Claim 9 (depends on 8)

The computer program product of claim 8, further including:
defining an order of execution of the plurality of test cases based upon, at least in part, the execution model.

### Claim 10 (depends on 8)

The computer program product of claim 8, further including:
executing a subset of the test suite based upon, at least in part, the execution model.

### Claim 11

A system comprising:
at least one processor device and at least one memory architecture coupled with the at least one processor device, the at least one processor device configured for:
determining each code unit executed by a test case in a test suite including a plurality of test cases based upon, at least in part, running the test case on a product-under-test in a code coverage mode, wherein the product-under-test includes a plurality of code units;
determining a number of times each of the plurality of code units is executed in the test suite;
determining an execution time for the test case;
determining a sanity rating for each of the plurality of test cases based upon, at least in part, a number of code units executed by the test case and the execution time for the test case;
generating a sanity model of the test suite based upon at least in part, the sanity rating of the plurality of test cases, wherein generating a sanity model includes displaying the sanity rating for each of the plurality of test cases included in the test suite; and
calculating an efficiency rating of the test case based upon, at least in part, an increment for each code unit executed by the test case, of a reciprocal of the number of times each code unit is executed by the test suite and the execution time for the test case.

### Claim 12 (depends on 11)

The system of claim 11, further including:
generating a code unit distribution model based upon, at least in part, the number of times each of the plurality of code units is executed in the test suite.

### Claim 13 (depends on 11)

The system of claim 11, further including:
generating an execution model of the test suite based upon, at least in part, the efficiency rating of the test case.

### Claim 14 (depends on 13)

The system of claim 13, further including:
defining an order of execution of the plurality of test cases based upon, at least in part, the execution model.

### Claim 15 (depends on 13)

The system of claim 13, further including:
executing a subset of the test suite based upon, at least in part, the execution model.
