# US 2014/0196011 A1 · Automatic regression testing based on cyclomatic complexity

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

- Number: US 2014/0196011 A1
- Document ID: US20140196011A1
- Status: Published application
- Kind: A1
- Application number: 13/737,425
- Filed: 2013-01-09
- Published: 2014-07-10
- Earliest claimed: 2013-01-09
- Assignees: International Business Machines Corporation
- Inventors: JAMES E. BOSTICK; JOHN M. GANCI, JR.; JOHN P. KAEMMERER; CRAIG M. TRIM
- Web page: https://patentgrep.com/patent/US20140196011A1

## CPC

- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A processor-implemented method, system, and/or computer program product automates regression testing based on cyclomatic complexity of changed code. A base code change to a software program is identified as having a particular cyclomatic complexity. Multiple different software test routines are mapped to the base code change. A specific quantity of the different software test routines are then run to test the base code change, where the quantity of test routines that is run is based on the cyclomatic complexity of the base code change.

## Claims

### Claim 1

A processor-implemented method of automating regression testing, the processor-implemented method comprising:
identifying, by a processor, a base code change in a software program;
receiving, by the processor, a string of binary data that represents a cyclomatic complexity of the base code change;
mapping, by the processor, the base code change to different software test routines, wherein the different software test routines have been predetermined to test changes to the software program; and
executing, by the processor, a quantity of the different software test routines on the base code change to automatically perform regression testing on the software program, wherein the quantity of the different software test routines that are executed on the base code change is determined by the cyclomatic complexity of the base code change.

### Claim 2 (depends on 1)

The processor-implemented method of claim 1, further comprising:
the processor further determining the quantity of different software test routines that are executed on the base code change based on a number of lines of changed code found in the base code change.

### Claim 3 (depends on 1)

The processor-implemented method of claim 1, further comprising:
the processor further determining the quantity of different software test routines that are executed on the base code change based on whether the base code change has been predetermined to execute a new business requirement, wherein base code changes that execute the new business requirement are tested by more of the different software test routines than base code changes that do not execute the new business requirement.

### Claim 4 (depends on 1)

The processor-implemented method of claim 1, further comprising:
the processor further determining the quantity of different software test routines that are executed on the base code change based on a quantity of software routines that call the base code change.

### Claim 5 (depends on 1)

The processor-implemented method of claim 1, further comprising:
the processor further determining the quantity of different software test routines that are executed on the base code change based on a quantity of downstream routines from the base code change, wherein base code changes that result in more downstream routines are tested by more of the different software test routines than base code changes that result in relatively fewer downstream routines.

### Claim 6 (depends on 1)

The processor-implemented method of claim 1, further comprising:
the processor, in response to determining that the cyclomatic complexity of the base code change exceeds a predetermined value, issuing an alert indicating that a regression test is needed on the software program.

### Claim 7 (depends on 1)

The processor-implemented method of claim 1, further comprising:
the processor identifying any software routines that are called by the base code change; and
the processor automatically executing pre-identified test code on the software routines that are called by the base code change.

### Claim 8

A computer program product for automating regression testing, the computer program product comprising a computer readable storage medium having program code embodied therewith, the program code readable and executable by a processor to perform a method comprising:
identifying, by a processor, a base code change in a software program;
receiving, by the processor, a string of binary data that represents a cyclomatic complexity of the base code change;
mapping, by the processor, the base code change to different software test routines, wherein the different software test routines have been predetermined to test changes to the software program; and
executing, by the processor, a quantity of the different software test routines on the base code change to automatically perform regression testing on the software program, wherein the quantity of the different software test routines that are executed on the base code change is determined by the cyclomatic complexity of the base code change.

### Claim 9 (depends on 8)

The computer program product of claim 8, further comprising program code that is readable and executable by the processor to:
further determine the quantity of different software test routines that are executed on the base code change based on a number of lines of changed code found in the base code change.

### Claim 10 (depends on 8)

The computer program product of claim 8, further comprising program code that is readable and executable by the processor to:
further determine the quantity of different software test routines that are executed on the base code change based on whether the base code change has been predetermined to execute a new business requirement, wherein base code changes that execute the new business requirement are tested by more of the different software test routines than base code changes that do not execute the new business requirement.

### Claim 11 (depends on 8)

The computer program product of claim 8, further comprising program code that is readable and executable by the processor to:
further determine the quantity of different software test routines that are executed on the base code change based on a quantity of software routines that call the base code change.

### Claim 12 (depends on 8)

The computer program product of claim 8, further comprising program code that is readable and executable by the processor to:
further determine the quantity of different software test routines that are executed on the base code change based on a quantity of downstream routines from the base code change, wherein base code changes that result in more downstream routines are tested by more of the different software test routines than base code changes that result in relatively fewer downstream routines.

### Claim 13 (depends on 8)

The computer program product of claim 8, further comprising program code that is readable and executable by the processor to:
in response to determining that the cyclomatic complexity of the base code change exceeds a predetermined value, issue an alert indicating that a regression test is needed on the software program.

### Claim 14 (depends on 8)

The computer program product of claim 8, further comprising program code that is readable and executable by the processor to:
identify any software routines that are called by the base code change; and
automatically execute pre-identified test code on the software routines that are called by the base code change.

### Claim 15

A computer system comprising:
a processor, a computer readable memory, and a computer readable storage medium;
first program instructions to identify a base code change in a software program;
second program instructions to receive a string of binary data that represents a cyclomatic complexity of the base code change;
third program instructions to map the base code change to different software test routines, wherein the different software test routines have been predetermined to test changes to the software program; and
fourth program instructions to execute a quantity of the different software test routines on the base code change to automatically perform regression testing on the software program, wherein the quantity of the different software test routines that are executed on the base code change is determined by the cyclomatic complexity of the base code change; and wherein the first, second, third, and fourth program instructions are stored on the computer readable storage medium for execution by the processor via the computer readable memory.

### Claim 16 (depends on 15)

The computer system of claim 15, further comprising:
fifth program instructions to further determine the quantity of different software test routines that are executed on the base code change based on a number of lines of changed code found in the base code change; and wherein
the fifth program instructions are stored on the computer readable storage medium for execution by the processor via the computer readable memory.

### Claim 17 (depends on 15)

The computer system of claim 15, further comprising:
fifth program instructions to further determine the quantity of different software test routines that are executed on the base code change based on whether the base code change has been predetermined to execute a new business requirement, wherein base code changes that execute the new business requirement are tested by more of the different software test routines than base code changes that do not execute the new business requirement; and wherein
the fifth program instructions are stored on the computer readable storage medium for execution by the processor via the computer readable memory.

### Claim 18 (depends on 15)

The computer system of claim 15, further comprising:
fifth program instructions to further determine the quantity of different software test routines that are executed on the base code change based on a quantity of software routines that call the base code change; and wherein
the fifth program instructions are stored on the computer readable storage medium for execution by the processor via the computer readable memory.

### Claim 19 (depends on 15)

The computer system of claim 15, further comprising:
fifth program instructions to further determine the quantity of different software test routines that are executed on the base code change based on a quantity of downstream routines from the base code change, wherein base code changes that result in more downstream routines are tested by more of the different software test routines than base code changes that result in relatively fewer downstream routines; and wherein
the fifth program instructions are stored on the computer readable storage medium for execution by the processor via the computer readable memory.

### Claim 20 (depends on 15)

The computer system of claim 15, further comprising:
fifth program instructions to, in response to determining that the cyclomatic complexity of the base code change exceeds a predetermined value, issue an alert indicating that a regression test is needed on the software program; and wherein
the fifth program instructions are stored on the computer readable storage medium for execution by the processor via the computer readable memory.
