# US 2022/0179776 A1 · Systems and Methods for Automatic Test Generation

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

- Number: US 2022/0179776 A1
- Document ID: US20220179776A1
- Status: Published application
- Kind: A1
- Application number: 17/113,784
- Filed: 2020-12-07
- Published: 2022-06-09
- Earliest claimed: 2020-12-07
- Assignees: Diffblue Ltd
- Applicants: Diffblue Ltd
- Inventors: Peter Schrammel; Daniel Kroening
- Web page: https://patentgrep.com/patent/US20220179776A1

## CPC

- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F 8/75: Structural analysis for program understanding
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3604: Analysis of software for verifying properties of programs (testing of software G06F11/3668)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method comprising obtaining a first candidate test associated with a testable component, wherein the first candidate test comprises an input having an input value; generating a second candidate test associated with the testable component by performing a dynamic mutation-based fuzzing of the first candidate test, wherein the second candidate test is based on the first candidate test and comprises a modified input value for the input based on data generated during an execution of the first candidate test or domain knowledge associated with the testable component; and creating a test for the testable component based on the first candidate test or the second candidate test.

## Claims

### Claim 1

A computer-implemented method comprising:
obtaining, a first candidate test associated with a testable component, wherein the first candidate test comprises an input having an input value;
generating a second candidate test associated with the testable component by performing a dynamic mutation-based fuzzing of the first candidate test, wherein the second candidate test is based on the first candidate test and comprises a modified input value for the input based on data generated during an execution of the first candidate test or domain knowledge associated with the testable component; and
creating a test for the testable component based on the first candidate test or the second candidate test.

### Claim 2

A computer-implemented method comprising:
obtaining a prioritized list of candidate input values, wherein the prioritized list of candidate input values includes at least one candidate input value based on domain knowledge associated with a testable component;
updating the prioritized list of candidate input values by:
obtaining a first candidate test associated with the testable component, wherein the first candidate test comprises an input having an input value;
causing an execution of the first candidate test and recording data generated during the execution of the first candidate test;
determining a candidate input value based on the data generated during the execution of the first candidate test;
adding the candidate input value to the prioritized list of candidate input values according to a priority value associated with the candidate input value; and
modifying the first candidate test to create a second candidate test based on the first candidate test, the second candidate test including a modified input wherein the modified input value is selected from the prioritized list of candidate input values; and
generating a test associated with the testable component based on the first candidate test or the second candidate test.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein the domain knowledge associated with the testable component includes analysis data associated with a first codebase and analysis data associated with a second codebase, wherein the first codebase includes the testable component.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, further comprising:
performing a static analysis of the first codebase to determine analysis data associated with the first codebase.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4, further comprising:
determining one or more candidate literal values and one or more candidate implementation types based on the analysis data associated with the first codebase;
wherein the modified input value is further based on the one or more candidate literal values or the one or more candidate implementation types determined from the analysis data associated with the first codebase.

### Claim 6 (depends on 3)

The computer-implemented method of claim 3, further comprising:
performing an offline static analysis of the second codebase to determine offline analysis data associated with the second codebase.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, further comprising:
determining one or more candidate literal values and one or more candidate implementation types based on the offline analysis data associated with the second codebase;
wherein the modified input value is further based on the one or more candidate literal values or the one or more candidate implementation types determined from the offline analysis data associated with the second codebase.

### Claim 8 (depends on 2)

The computer-implemented method of claim 2, wherein causing the execution of the first candidate test and recording data generated during the execution of the first candidate test further comprises:
instrumenting a first code section associated with the testable component to determine a first instrumented code section, wherein the first instrumented code collects and records data generated during the execution of the first candidate test.

### Claim 9 (depends on 2)

The computer-implemented method of claim 2, further comprising, prior to adding the candidate input value to the prioritized list of candidate input values:
determining the priority value associated with the candidate input value.

### Claim 10 (depends on 9)

The computer-implemented method of claim 9, wherein the priority value is based on the data generated during the execution of the first candidate test and/or the domain knowledge associated with the testable component.

### Claim 11 (depends on 2)

The computer-implemented method of claim 2, wherein the method further comprises repeating the steps of updating and generating until a termination criteria is met.

### Claim 12

A system comprising:
one or more processors; and
one or more non-transitory computer-readable media that collectively store instructions that, when executed by the one or more processors, cause the system to perform operations, the operations comprising:
obtaining a prioritized list of candidate input values, wherein the prioritized list of candidate input values includes at least one candidate input value based on a domain knowledge associated with a testable component;
obtaining a first candidate test associated with the testable component, wherein the current candidate test comprises an input having an input value;
causing an execution of the first candidate test and recording data generated during the execution of the first candidate test;
determining a candidate input value based on the data generated during the execution of the first candidate test;
adding the candidate input value to the prioritized list of candidate input values according to a priority value associated with the candidate input value;
modifying the first candidate test to create a second candidate test based on the first candidate test, the second candidate test including a modified input value different to a corresponding input value of the first candidate test, wherein the modified input value is selected from the prioritized list of candidate input values; and
generating a test associated with the testable component based on the first candidate test or the second candidate test.

### Claim 13 (depends on 12)

The system of claim 12, wherein the operations further comprise:
determining the domain knowledge associated with the testable component, wherein the domain knowledge associated with the testable component includes analysis data associated with a first codebase including the testable component and analysis data associated with a second codebase.

### Claim 14 (depends on 13)

The system of claim 13, wherein the operations further comprise:
performing a static analysis of the first codebase to determine analysis data associated with the first codebase;
determining one or more candidate literal values and one or more candidate implementation types based on the analysis data associated with the first codebase; and
wherein the modified input value is further based on the one or more candidate literal values or the one or more candidate implementation types determined from the analysis data associated with the first codebase.

### Claim 15 (depends on 13)

The system of claim 13, wherein the operations further comprise:
performing an offline static analysis of the second codebase to determine offline analysis data associated with the second codebase;
determining one or more candidate literal values and one or more candidate implementation types based on the offline analysis data associated with the second codebase; and
wherein the modified input value is further based on the one or more candidate literal values or the one or more candidate implementation types determined from the offline analysis data associated with the second codebase.

### Claim 16 (depends on 12)

The system of claim 12, wherein the operations further comprise:
instrumenting a first code section associated with the testable component to determine a first instrumented code section, wherein the first instrumented code collects and records data generated during the execution of the first candidate test.

### Claim 17 (depends on 12)

The system of claim 12, wherein the test is generated based on the first candidate test in accordance with a determination that the first candidate test satisfies a criterion.

### Claim 18 (depends on 12)

The system of claim 12, wherein the test is generated based on the second candidate test in accordance with a determination that the second candidate test satisfies a criterion.

### Claim 19 (depends on 12)

The system of claim 12, wherein the operations further comprise
determining the priority value associated with the candidate input value, wherein the priority value is based on the data generated during the execution of the first candidate test and/or the domain knowledge associated with the testable component.

### Claim 20 (depends on 2)

A non-transitory computer readable medium comprising one or more instructions which when executed by one or more processors cause a device to carry out operations as set forth in the method of claim 2.
