# US 11,119,889 B1 · Automated software program repair

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

- Number: US 11,119,889 B1
- Document ID: US11119889B1
- Status: Granted
- Kind: B1
- Application number: 16/936,390
- Filed: 2020-07-22
- Granted: 2021-09-14
- Earliest claimed: 2020-07-22
- Assignees: Fujitsu Limited
- Applicants: Fujitsu Limited
- Inventors: Hiroaki Yoshida; Mukul R. Prasad
- Web page: https://patentgrep.com/patent/US11119889B1

## CPC

- G06F 11/3604: Analysis of software for verifying properties of programs (testing of software G06F11/3668)
- G06F 11/3624: {by performing operations on the source code, e.g. via a compiler}
- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F 8/33: Intelligent editors
- G06F 9/44521: {Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading}
- G06F 11/3672: {Test management}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

According to one or more embodiments, operations may include identifying a plurality of source code edits made between a buggy version of first source code of a first software program and a repaired version of the first source code. The operations may also include identifying a plurality of clusters of the source code edits. Each cluster of the plurality of clusters includes one or more source code edits of the plurality of source code edits. The operations may also include identifying a plurality of valid clusters of the plurality of clusters and identifying one or more invalid clusters of the plurality of clusters based on compiling of the first source code. Moreover, the operations may include identifying, as a first repair of the first error, a particular set of one or more valid clusters of the plurality of valid clusters while excluding the one or more invalid clusters from consideration.

## Claims

### Claim 1

A method comprising:
identifying a plurality of source code edits made between a buggy version of first source code of a first software program and a repaired version of the first source code in which the buggy version includes a first error and the first error has been corrected in the repaired version;
identifying a plurality of clusters of the source code edits, wherein each cluster of the plurality of clusters includes one or more source code edits of the plurality of source code edits;
identifying a plurality of valid clusters of the plurality of clusters based on successful compiling of the first source code with respect to each valid cluster of the plurality of valid clusters wherein identifying a respective valid cluster of the plurality of valid clusters includes:
generating a first modified version of the first source code by applying the one or more source code edits that correspond to the respective valid cluster to the buggy version of the first source code;
generating a second modified version of the first source code by reversing the one or more source code edits that correspond to the respective valid cluster from the repaired version of the first source code; and
identifying the respective valid cluster as being valid in response to the first modified version of the first source code and the second modified version of the first source code successfully compiling;
identifying one or more invalid clusters of the plurality of clusters based on one or more compiling errors of the first software program with respect to each of the one or more invalid clusters; and
identifying, as a first repair of the first error, a particular set of one or more valid clusters of the plurality of valid clusters while excluding the one or more invalid clusters from consideration.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
identifying a second error in second source code of a second software program; and
performing repair operations on the second source code with respect to the second error based on the first repair.

### Claim 3 (depends on 1)

The method of claim 1, wherein identifying a respective invalid cluster of the one or more invalid clusters includes:
generating a third modified version of the first source code by applying the one or more source code edits that correspond to the respective invalid cluster to the buggy version of the first source code; and
identifying the respective invalid cluster as being invalid in response to the third modified version of the first source code having one or more compiling errors.

### Claim 4 (depends on 1)

The method of claim 1, wherein identifying a respective invalid cluster of the one or more invalid clusters includes:
generating a third modified version of the first source code by reversing the one or more source code edits that correspond to the respective invalid cluster from the repaired version of the first source code; and
identifying the respective invalid cluster as being invalid in response to the third modified version of the first source code having one or more compiling errors.

### Claim 5 (depends on 1)

The method of claim 1, wherein the particular set of one or more valid clusters has the smallest number of total edits that correct the first error as compared to other sets of valid clusters that also correct the first error.

### Claim 6 (depends on 1)

The method of claim 1, wherein identifying the particular set of one or more valid clusters as the first repair includes:
generating a third modified version of the first source code by applying the one or more source code edits that correspond to the particular set of one or more valid clusters to the buggy version of the first source code; and
identifying the particular set of one or more valid clusters as the first repair in response to the third modified version of the first source code repairing the first error.

### Claim 7 (depends on 1)

The method of claim 1, wherein identifying the particular set of one or more valid clusters as the first repair includes:
generating a third modified version of the first source code by reversing the one or more source code edits that correspond to the particular set of one or more valid clusters from the repaired version of the first source code; and
identifying the particular set of one or more valid clusters as the first repair in response to the third modified version of the first source code including the first error.

### Claim 8

One or more non-transitory computer-readable storage media configured to store instructions that, in response to being executed, cause a system to perform operations, the operations comprising:
identifying a plurality of source code edits made between a buggy version of first source code of a first software program and a repaired version of the first source code in which the buggy version includes a first error and the first error has been corrected in the repaired version;
identifying a plurality of clusters of the source code edits, wherein each cluster of the plurality of clusters includes one or more source code edits of the plurality of source code edits;
identifying a plurality of valid clusters of the plurality of clusters based on successful compiling of the first source code with respect to each valid cluster of the plurality of valid clusters;
identifying one or more invalid clusters of the plurality of clusters based on one or more compiling errors of the first software program with respect to each of the one or more invalid clusters; and
identifying, as a first repair of the first error, a particular set of one or more valid clusters of the plurality of valid clusters while excluding the one or more invalid clusters from consideration, wherein identifying the particular set of one or more valid clusters as the first repair includes:
generating a first modified version of the first source code by applying the one or more source code edits that correspond to the particular set of one or more valid clusters to the buggy version of the first source code;
generating a second modified version of the first source code by reversing the one or more source code edits that correspond to the particular set of one or more valid clusters from the repaired version of the first source code; and
identifying the particular set of one or more valid clusters as the first repair in response to the first modified version of the first source code repairing the first error and in response to the second modified version of the first source code including the first error.

### Claim 9 (depends on 8)

The one or more non-transitory computer-readable storage media of claim 8, wherein the operations further comprise:
identifying a second error in second source code of a second software program; and
performing repair operations on the second source code with respect to the second error based on the first repair.

### Claim 10 (depends on 8)

The one or more non-transitory computer-readable storage media of claim 8, wherein identifying a respective valid cluster of the plurality of valid clusters includes:
generating a third modified version of the first source code by applying the one or more source code edits that correspond to the respective valid cluster to the buggy version of the first source code; and
identifying the respective valid cluster as being valid in response to the third modified version of the first source code successfully compiling.

### Claim 11 (depends on 8)

The one or more non-transitory computer-readable storage media of claim 8, wherein identifying a respective valid cluster of the plurality of valid clusters includes:
generating a third modified version of the first source code by reversing the one or more source code edits that correspond to the respective valid cluster from the repaired version of the first source code; and
identifying the respective valid cluster as being valid in response to the third modified version of the first source code successfully compiling.

### Claim 12 (depends on 8)

The one or more non-transitory computer-readable storage media of claim 8, wherein identifying a respective invalid cluster of the one or more invalid clusters includes:
generating a third modified version of the first source code by applying the one or more source code edits that correspond to the respective invalid cluster to the buggy version of the first source code; and
identifying the respective invalid cluster as being invalid in response to the third modified version of the first source code having one or more compiling errors.

### Claim 13 (depends on 8)

The one or more non-transitory computer-readable storage media of claim 8, wherein identifying a respective invalid cluster of the one or more invalid clusters includes:
generating a third modified version of the first source code by reversing the one or more source code edits that correspond to the respective invalid cluster from the repaired version of the first source code; and
identifying the respective invalid cluster as being invalid in response to the third modified version of the first source code having one or more compiling errors.

### Claim 14 (depends on 8)

The one or more non-transitory computer-readable storage media of claim 8, wherein the particular set of one or more valid clusters has the smallest number of total edits that correct the first error as compared to other sets of valid clusters that also correct the first error.

### Claim 15

A system comprising:
one or more processors; and
one or more non-transitory computer-readable storage media configured to store instructions that, in response to being executed by the one or more processors, cause the system to perform operations, the operations comprising:
identifying a plurality of source code edits made between a buggy version of first source code of a first software program and a repaired version of the first source code in which the buggy version includes a first error and the first error has been corrected in the repaired version;
identifying a plurality of clusters of the source code edits, wherein each cluster of the plurality of clusters includes one or more source code edits of the plurality of source code edits;
identifying a plurality of valid clusters of the plurality of clusters based on successful compiling of the first source code with respect to each valid cluster of the plurality of valid clusters, wherein identifying a respective valid cluster of the plurality of valid clusters includes:
generating a first modified version of the first source code by applying the one or more source code edits that correspond to the respective valid cluster to the buggy version of the first source code;
generating a second modified version of the first source code by reversing the one or more source code edits that correspond to the respective valid cluster from the repaired version of the first source code and
identifying the respective valid cluster as being valid in response to the first modified version of the first source code and the second modified version of the first source code successfully compiling; and
identifying, as a first repair of the first error, a particular set of one or more valid clusters of the plurality of valid clusters, wherein identifying the particular set of one or more valid clusters as the first repair includes:
generating a third modified version of the first source code by applying the one or more source code edits that correspond to the particular set of one or more valid clusters to the buggy version of the first source code;
generating a fourth modified version of the first source code by reversing the one or more source code edits that correspond to the particular set of one or more valid clusters from the repaired version of the first source code; and
identifying the particular set of one or more valid clusters as the first repair in response to the third modified version of the first source code repairing the first error and in response to the fourth modified version of the first source code including the first error.

### Claim 16 (depends on 15)

The system of claim 15, wherein the operations further comprise:
identifying one or more invalid clusters of the plurality of clusters based on one or more compiling errors of the first software program with respect to each of the one or more invalid clusters, wherein the one or more invalid clusters are excluded from consideration while identifying the first repair.
