# US 2021/0240600 A1 · Test suite generation from metadata

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

- Number: US 2021/0240600 A1
- Document ID: US20210240600A1
- Status: Published application
- Kind: A1
- Application number: 16/778,660
- Filed: 2020-01-31
- Published: 2021-08-05
- Earliest claimed: 2020-01-31
- Assignees: salesforce.com, inc.
- Applicants: salesforce.com, inc.
- Inventors: Julio Alejandro LAROSA; Ignacio Bottero; Mauro Dentoni; Maria Mare; Nicolas Grossi
- Web page: https://patentgrep.com/patent/US20210240600A1

## CPC

- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F 9/547: {Remote procedure calls [RPC]; Web services}
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 2201/875: Monitoring of systems including the internet
- G06Q 10/105: Human resources
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06Q: INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR

## Abstract

Disclosed herein are system, method, and computer program product embodiments for providing the ability to generate unit tests for a web service from a logged interaction with the web service and an API specification for the web service. Rather than having to manually generate tests for the web service, a test developer may interact with the web service through a web browser and record a log of these interactions. The log is then matched to a definition of the API specification, and a test is created. The test developer can either run this test against the web service, or use the test as a foundation for developing and refining the test further.

## Claims

### Claim 1

A method, comprising:
receiving, by one or more computing devices, an interaction file comprising a request from a client to an application programming interface (API) on a web service, and a response to the request from the web service;
receiving, by the one or more computing devices, a specification of the API;
generating, by the one or more computing devices, a test request to the web service based on the request from the interaction file, wherein the test request is configured to satisfy the specification of the API; and
generating, by the one or more computing devices, a test suite comprising the test request and a constraint, wherein the constraint is based on the response from the interaction file.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
executing, by the one or more computing devices, the test suite on the web service, wherein the test suite is configured to apply the constraint against a test response received from the web service.

### Claim 3 (depends on 1)

The method of claim 1, wherein the interaction file is generated by a web browser logging an interaction with the web service.

### Claim 4 (depends on 1)

The method of claim 1, wherein generating the test comprises:
matching, by the one or more computing devices, the request from the interaction file to an API call defined by the specification of the API.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
providing, by the one or more computing devices, the test suite for manual editing.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
generating, by the one or more computing devices, an additional test request; and
including, by the one or more computing devices, the additional test request in the test suite.

### Claim 7 (depends on 1)

The method of claim 1, wherein the specification of the API is defined in a RESTful API Modeling Language (RAML) file.

### Claim 8

A system, comprising:
a memory configured to store operations; and
one or more processors configured to perform the operations, the operations comprising:
receiving an interaction file comprising a request from a client to an application programming interface (API) on a web service, and a response to the request from the web service,
receiving a specification of the API,
generating a test request to the web service based on the request from the interaction file, wherein the test request is configured to satisfy the specification of the API, and
generating a test suite comprising the test request and a constraint, wherein the constraint is based on the response from the interaction file.

### Claim 9 (depends on 8)

The system of claim 8, the operations further comprising:
executing the test suite on the web service, wherein the test suite is configured to apply the constraint against a test response received from the web service.

### Claim 10 (depends on 8)

The system of claim 8, wherein the interaction file is generated by a web browser logging an interaction with the web service.

### Claim 11 (depends on 8)

The system of claim 8, wherein generating the test comprises:
matching the request from the interaction file to an API call defined by the specification of the API.

### Claim 12 (depends on 8)

The system of claim 8, the operations further comprising:
providing the test suite for manual editing.

### Claim 13 (depends on 8)

The system of claim 8, the operations further comprising:
generating an additional test request; and
including the additional test request in the test suite.

### Claim 14 (depends on 8)

The system of claim 8, wherein the specification of the API is defined in a RESTful API Modeling Language (RAML) file.

### Claim 15

A computer readable storage device having instructions stored thereon, execution of which, by one or more processing devices, causes the one or more processing devices to perform operations comprising:
receiving an interaction file comprising a request from a client to an application programming interface (API) on a web service, and a response to the request from the web service;
receiving a specification of the API;
generating a test request to the web service based on the request from the interaction file, wherein the test request is configured to satisfy the specification of the API; and
generating a test suite comprising the test request and a constraint, wherein the constraint is based on the response from the interaction file.

### Claim 16 (depends on 15)

The computer readable storage device of claim 15, the operations further comprising:
executing the test suite on the web service, wherein the test suite is configured to apply the constraint against a test response received from the web service.

### Claim 17 (depends on 15)

The computer readable storage device of claim 15, wherein the interaction file is generated by a web browser logging an interaction with the web service.

### Claim 18 (depends on 15)

The computer readable storage device of claim 15, wherein generating the test comprises:
matching the request from the interaction file to an API call defined by the specification of the API.

### Claim 19 (depends on 15)

The computer readable storage device of claim 15, the operations further comprising:
providing the test suite for manual editing.

### Claim 20 (depends on 15)

The computer readable storage device of claim 15, the operations further comprising:
generating an additional test request; and
including the additional test request in the test suite.
