# US 2025/0147869 A1 · Automated computer code generation

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

- Number: US 2025/0147869 A1
- Document ID: US20250147869A1
- Status: Published application
- Kind: A1
- Application number: 18/789,134
- Filed: 2024-07-30
- Published: 2025-05-08
- Earliest claimed: 2023-11-03
- Assignees: Ropes AI Inc
- Applicants: Ropes AI Inc
- Inventors: Kenneth Schumacher
- Web page: https://patentgrep.com/patent/US20250147869A1

## CPC

- G06F 11/3608: {using formal methods, e.g. model checking, abstract interpretation (theorem proving G06N5/013)}
- G06F 8/30: Creation or generation of source code
- G06F 8/35: model driven
- G06F 11/3438: {monitoring of user actions (tracking the activity of the user H04L67/535)}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3692: {for test results analysis}
- G06F 11/3696: {Methods or tools to render software testable}
- G09B 7/02: of the type wherein the student is expected to construct an answer to the question which is presented or wherein the machine gives an answer to the question presented by a student
- G09B 19/0053: {Computers, e.g. programming}
- G09B 23/186: {for digital electronics; for computers, e.g. microprocessors}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G09B: EDUCATIONAL OR DEMONSTRATION APPLIANCES; APPLIANCES FOR TEACHING, OR COMMUNICATING WITH, THE BLIND, DEAF OR MUTE; MODELS; PLANETARIA; GLOBES; MAPS; DIAGRAMS (devices for psychotechnics or for testing reaction times A61B5/16; games, sports, amusements A63; projectors, projector screens G03B)

## Abstract

Technical solutions are directed to creation of test problems and their candidate solutions using test cases. A processor coupled with memory can cause, responsive to inputting a prompt including a description of a test problem into an ML model to generate a test case for the test problem and a candidate solution comprising a computer code for the test problem, the test case including an input value and an output value. The processor can determine, responsive to executing computer-executable code comprising the computer code of the candidate solution to generate an output by passing the input value of the test case to the candidate solution, that the output of the candidate solution satisfies a validity condition corresponding to the output value. The processor can store, in a data structure, the description of the problem and the candidate solution responsive to determining that the candidate solution satisfies the validity condition.

## Claims

### Claim 1

A system comprising:
one or more processors coupled with memory configured to:
cause, responsive to inputting one or more prompts including a description of a test problem into one or more ML models, the one or more ML models to generate a JavaScript Object Notation (JSON) test case object for the test problem and a candidate solution comprising a computer code for the test problem, the test case object including at least one input value and at least one output value;
create a function for execution in an execution environment by appending, to the candidate solution, code generated using the candidate solution to evaluate the test case object against the function;
execute, in the execution environment, the test case object against the function to validate the candidate solution by by passing the at least one input value of the test case object to the function as an argument and compare the output of the function with the at least one output value of the test case object; and
store, in one or more data structures, the description of the problem and the candidate solution responsive to determining that the at least one output value of the test case object matches the output of the function.

### Claim 2

(canceled)

### Claim 3

(canceled)

### Claim 4 (depends on 1)

The system of claim 1, wherein the one or more prompts include first prompts and wherein the one or more processors are configured to:
cause, responsive to inputting one or more second prompts including a description of a test problem into the one or more ML models, the one or more ML models to generate a boilerplate portion of the candidate solution; and
store, in the one or more data structures, the boilerplate portion.

### Claim 5 (depends on 4)

The system of claim 4, wherein to cause the one or more ML models to generate the test case object for the test problem and the candidate solution, the one or more processors are configured to:
cause the one or more ML models to generate the test case object;
parse, responsive to generation of the first test case object, the test case object; and
cause the one or more ML models to generate the candidate solution.

### Claim 6 (depends on 1)

The system of claim 1, wherein the one or more ML models generate a plurality of test case objects including the test case object and wherein the one or more processors are configured to determine, responsive to generation of each of the plurality of test case objects, that the candidate solution satisfies a validity condition for each of the plurality of test case objects.

### Claim 7 (depends on 6)

The system of claim 6, wherein to store the description of the problem and the candidate solution, the one or more processors are configured to store the description of the test problem and the candidate solution responsive to determining that the candidate solution satisfies the validity condition for each of the plurality of test case objects.

### Claim 8 (depends on 1)

The system of claim 1, wherein the candidate solution is a first candidate solution and wherein the one or more processors are configured to:
cause the one or more ML models to generate a second candidate solution prior to the first candidate solution;
create a second function for execution in the execution environment by appending, to the second candidate solution, code generated using the second candidate solution to evaluate the test case object against the second function;
evaluate, in the execution environment, the test case object against the second function by by passing the at least one input value of the test case object to the second function as an argument and compare the output of the second function with the at least one output value of the test case object;
and
cause the one or more ML models to generate the first candidate solution responsive to determining that the at least one output value of the test case object matches the output of the second function.

### Claim 9 (depends on 8)

The system of claim 8, wherein the one or more processors are configured to:
debug the second candidate solution;
determine, responsive to debugging the second candidate solution, that the second candidate solution includes an error; and
discard the second candidate solution and cause the one or more ML models to generate the first candidate solution.

### Claim 10 (depends on 8)

The system of claim 8, wherein the test case object is a first test case object and wherein the one or more processors are configured to:
debug a second test case object generated by the one or more ML models;
determine, responsive to debugging the second test case object, that the second test case object includes an error; and
discard the second test case and cause the one or more ML models to generate the first test case object.

### Claim 11 (depends on 10)

The system of claim 10, wherein the one or more processors are configured to:
validate the second test case object with the second candidate solution; and
compare one or more expected outputs of the second test case object with one or more outputs of the second candidate solution based on one or more inputs of the second test case object input into the second candidate solution.

### Claim 12 (depends on 11)

The system of claim 11, wherein the one or more processors are configured to:
validate the second test case object with the candidate solution;
debug, responsive to one or more outputs of the second test case object not matching one or more corresponding outputs of the candidate solution, the second test case object; and
determine, responsive to debugging the second test case object, that the second test case object includes the error;
discard the second test case object and cause the one or more ML models to generate the first test case object for the candidate solution.

### Claim 13 (depends on 1)

The system of claim 1, wherein the test case object is one of a plurality of test case objects and wherein the one or more processors are configured to initiate generation of the candidate solution prior to the one or more ML models completing generation of each of the plurality of test case objects.

### Claim 14 (depends on 1)

The system of claim 1, wherein the one or more processors are configured to provide, for presentation at a client device, the candidate solution subsequent to storing, in the one or more data structures, the description of the problem and the candidate solution.

### Claim 15 (depends on 1)

The system of claim 1, wherein the one or more prompts include first prompts and the one or more processors are configured to:
receive, from a client device, a domain of the test problem to be generated;
generate, responsive to one or more second prompts and the domain input into the one or more ML models, one or more short problem summaries corresponding to the domain;
cause, responsive to the one or more second prompts and a candidate short problem summary of the one or more short problem summaries input into one or more ML models, a description of the test problem corresponding to the domain and the candidate short problem description.

### Claim 16 (depends on 1)

The system of claim 1, wherein the one or more ML models includes at least one of one or more generative pretrained transformer models or one or more large language models (LLMs).

### Claim 17 (depends on 1)

The system of claim 1, wherein the one or more processors are configured to:
generate, by the one or more ML models responsive to a prompt comprising an indication of the test problem, a string of text comprising the description of the test problem; and
provide for display on a client device, the string of text.

### Claim 18 (depends on 17)

The system of claim 17, wherein the one or more processors are configured to:
generate, by the one or more ML models responsive to a type of the computer code indicated in the one or more prompts and the string of text input into the one or more ML models, a boilerplate portion of the candidate solution according to the indicated type; and
provide for display on the client device, the boilerplate portion.

### Claim 19 (depends on 1)

The system of claim 1, wherein the one or more processors are configured to:
receive, from the one or more ML models responsive to parsing the candidate solution of the one or more candidate solutions for the test problem, the candidate solution parsed into a JavaScript Object Notation (JSON) object.

### Claim 20 (depends on 1)

The system of claim 1, wherein the one or more processors are configured to:
receive an indication that a test case object or the solution is incorrect;
generate a plurality of calls for the one or more ML models, each of the plurality of calls including the first test case object;
receive a plurality of results from the one or more ML models responsive to the plurality of calls; and
determine, based on the plurality of results, validity of the test case object.

### Claim 21

A method, comprising:
causing, by one or more processors, responsive to inputting one or more prompts including a description of a test problem into one or more ML models, the one or more ML models to generate a JavaScript Object Notation (JSON) test case object for the test problem and a candidate solution comprising a computer code for the test problem, the test case object including at least one input value and at least one output value;
creating, by the one or more processors, a function for execution in an execution environment by appending, to the candidate solution, code generated using the candidate solution to evaluate the test case object against the function;
executing, by the one or more processors, in the execution environment, the test case object against the function to validate the candidate solution by by passing the at least one input value of the test case object to the function as an argument and compare the output of the function with the at least one output value of the test case object; and
storing, by the one or more processors, in one or more data structures, the description of the problem and the candidate solution responsive to determining that the at least one output value of the test case object matches the output of the function.

### Claim 22

A non-transitory computer-readable media having processor readable instructions, such that, when executed, causes at least one processor to:
cause, responsive to inputting one or more prompts including a description of a test problem into one or more ML models, the one or more ML models to generate a JavaScript Object Notation (JSON) test case object for the test problem and a candidate solution comprising a computer code for the test problem, the test case object including at least one input value and at least one output value;
create a function for execution in an execution environment by appending, to the candidate solution, code generated using the candidate solution to evaluate the test case object against the function;
execute, in the execution environment, the test case object against the function to validate the candidate solution by by passing the at least one input value of the test case object to the function as an argument and compare the output of the function with the at least one output value of the test case object; and
store, in one or more data structures, the description of the problem and the candidate solution responsive to determining that the at least one output value of the test case object matches the output of the function.
