IP Library › Granted Patent US 12,675,390
Granted Patent B2
US 12,675,390 · App. 18/951,741 · Granted Jul 7, 2026

Large language model-based test-case refinement for application programming interfaces

Inventors: Devika Sondhi (Noida, IN); Diptikalyan Saha (Bangalore, IN)
Assignee: International Business Machines Corporation
G06F11/3684G06F9/54
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,675,390
App. No.
18/951,741
Filed
Nov 19, 2024
Granted
Jul 7, 2026
Kind
B2
Art Unit
2114
USPC
714/37
Abstract

Using a large language model to improve testing of an application programming interface. Access an application programming interface specification, the application programming interface specification used for testing of an application programming interface. Access one or more test cases previously generated for testing the application programming interface which when utilized to test the application programming interface resulted in one or more errors. Access the one or more errors generated when testing the application programming interface using the one or more test cases previously generated. Input the application programming interface specification, the one or more test cases previously generated, and the one or more errors into a large language model for refinement by the large language model. Receive a modified set of the one or more test cases, modified by the large language model. Receive a modified application programming interface specification, modified by the large language model.

Claims (41)

1 . A method of using a computing device associated with a large language model to improve testing of an application programming interface in order to minimize errors associated with the application programming interface, the method comprising:

accessing by a computing device an application programming interface specification associated with an application programming interface, the application programming interface specification an electronically available document which describes at least in-part in natural language how to build and utilize functionality associated with the application programming interface specification, the application programming interface specification containing natural language descriptions, source code, and test cases to be used for testing of the application programming interface;

accessing by the computing device from the application programming interface specification one or more test cases previously generated for testing the application programming interface which when utilized to test the application programming interface resulted in one or more errors;

accessing by the computing device the one or more errors generated when testing the application programming interface using the one or more test cases previously generated;

generating automatically by the computing device a scenario specific prompt for input into a large language model, the scenario specific prompt to provide instructions for the large language model to correctly generate test cases and update the application programming interface specification;

inputting automatically by the computing device via the scenario specific prompt the application programming interface specification, the one or more test cases previously generated, and the one or more errors into the large language model for refinement;

receiving a modified set of the one or more test cases, modified by the large language model, the modified set of the one or more test cases generated by the large language model in response to the automatically generated prompt to improve testing of the application programming interface; and

receiving from the large language model a modified application programming interface specification, modified by the large language model to improve testing of the application programming interface.

2 . The method of claim 1 , wherein the modified set of the one or more test cases are automatically utilized for testing of the application programming interface by an interactive development environment.

3 . The method of claim 1 , wherein the one or more errors are HTTP status codes.

4 . The method of claim 1 , wherein the application programming interface specification is in a format associated with OpenAPI.

5 . The method of claim 1 , wherein the application programming interface specification is incomplete or incorrect.

6 . The method of claim 1 , wherein the one or more test cases previously generated for testing of the application programming interface exist in a JSON file format which describes one or more parameters, one or more data values for each parameter, and a sequence of operations.

7 . The method of claim 1 , wherein the modified set of the one or more test cases are output in a JSON file format.

8 . The method of claim 1 , wherein the modified set of the one or more test cases and the modified application programming interface specification are utilized by a debugger in further testing of application programming interface.

9 . A computer system associated with a large language model to improve testing of an application programming interface in order to minimize errors associated with the application programming interface, the computer system comprising:

one or more computer processors;

one or more computer-readable storage media;

program instructions stored on the computer-readable storage media for execution by at least one of the one or more processors, the program instructions comprising:

program instructions to access an application programming interface specification associated with an application programming interface, the application programming interface specification an electronically available document which describes at least in-part in natural language how to build and utilize functionality associated with the application programming interface specification, the application programming interface specification containing natural language descriptions, source code, and test cases to be used for testing of the application programming interface;

program instructions to access from the application programming interface specification one or more test cases previously generated for testing the application programming interface which when utilized to test the application programming interface resulted in one or more errors;

program instructions to access the one or more errors generated when testing the application programming interface using the one or more test cases previously generated;

program instructions to generate automatically a scenario specific prompt for input into a large language model, the scenario specific prompt to provide instructions for the large language model to correctly generate test cases and update the application programming interface specification;

program instructions to input automatically by the computing device via the scenario specific prompt the application programming interface specification, the one or more test cases previously generated, and the one or more errors into the large language model for refinement;

program instructions to receive a modified set of the one or more test cases, modified by the large language model, the modified set of the one or more test cases generated by the large language model in response to the automatically generated prompt to improve testing of the application programming interface; and

program instructions to receive from the large language model a modified application programming interface specification, modified by the large language model to improve testing of the application programming interface.

10 . The computer system of claim 9 , wherein the modified set of the one or more test cases are output and automatically utilized for testing of the application programming interface by an interactive development environment.

11 . The computer system of claim 9 , wherein the one or more errors are HTTP status codes.

12 . The computer system of claim 9 , wherein the application programming interface specification is in a format associated with OpenAPI.

13 . The computer system of claim 9 , wherein the one or more test cases previously generated for testing of the application programming interface exist in a JSON file format which describes one or more parameters, one or more data values for each parameter, and a sequence of operations.

14 . A computer program product associated with a large language model to improve testing of an application programming interface in order to minimize errors associated with the application programming interface, the computer program product comprising:

one or more non-transitory computer-readable storage media and program instructions stored on the one or more non-transitory computer-readable storage media capable of performing a method, the method comprising:

accessing by a computing device an application programming interface specification associated with an application programming interface, the application programming interface specification an electronically available document which describes at least in-part in natural language how to build and utilize functionality associated with the application programming interface specification, the application programming interface specification containing natural language descriptions, source code, and test cases to be used for testing of the application programming interface;

accessing by the computing device from the application programming interface specification one or more test cases previously generated for testing the application programming interface which when utilized to test the application programming interface resulted in one or more errors;

accessing by the computing device the one or more errors generated when testing the application programming interface using the one or more test cases previously generated;

generating automatically by the computing device a scenario specific prompt for input into a large language model, the scenario specific prompt to provide instructions for the large language model to correctly generate test cases and update the application programming interface specification;

inputting automatically by the computing device via the scenario specific prompt the application programming interface specification, the one or more test cases previously generated, and the one or more errors into the large language model;

receiving a modified set of the one or more test cases, modified by the large language model, the modified set of the one or more test cases generated by the large language model in response to the automatically generated prompt to improve testing of the application programming interface; and

receiving from the large language model a modified application programming interface specification, modified by the large language model to improve testing of the application programming interface.

15 . The computer program product of claim 14 , wherein the one or more errors are HTTP status codes.

16 . The computer program product of claim 14 , wherein the application programming interface specification is in a format associated with OpenAPI.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 19, 2024
From: SONDHI, DEVIKA; SAHA, DIPTIKALYAN
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 069313/0932 →
Continuity (1)
Related Publication 20260140852A1 · May 21, 2026
References Cited (35)
US 11645139B2 · Cser · 2023 [cited by examiner]
US 12353317B1 · Surace · 2025 [cited by examiner]
US 20170353375A1 · Paropkari · 2017 [cited by examiner]
US 20220091967A1 · Wang · 2022 [cited by examiner]
US 20230251960A1 · Sharma · 2023 [cited by examiner]
US 20240054233A1 · Ohayon · 2024 [cited by examiner]
US 20240111498A1 · Vaughn · 2024 [cited by examiner]
US 20240256423A1 · Zhang · 2024 [cited by examiner]
US 20240311272A1 · Schaefer · 2024 [cited by examiner]
US 20240320130A1 · Sondhi · 2024 [cited by examiner]
US 20240378395A1 · Sommers · 2024 [cited by examiner]
US 20250013559A1 · Jiao · 2025 [cited by examiner]
US 20250044991A1 · Darji · 2025 [cited by examiner]
US 20250045185A1 · Tang · 2025 [cited by examiner]
US 20250061358A1 · Magendie · 2025 [cited by examiner]
US 20250077397A1 · Sen · 2025 [cited by examiner]
US 20250265178A1 · Jensen · 2025 [cited by examiner]
CN 117806980B · 2024 [cited by applicant]
CN 118445192A · 2024 [cited by applicant]
KR 1020240065047A · 2024 [cited by applicant]
“How to Design Prompts for Test Case Wizard and Implement It in OpenAI Playground”, retrieved from web https://www.linkedin.com/pulse/how-design-prompts-test-case-wizard-implement-openai-playground-j-78xzf, dated Aug. 2… [cited by applicant]
“IBM Watsonx Evaluating Models”, retrieved from web https://www.ibm.com/docs/en/watsonx/saas?topic=assets-evaluating-ai-models dated Aug. 16, 2024, 2 pages. [cited by applicant]
“lexnlp.extract.en.constraints: Extracting constraint statements”, ContraxSuite, LLC, 2018, 3 pages. [cited by applicant]
Arcuri Andrea “EvoMaster: Evolutionary Multi-context Automated System Test Generation”, 2018 IEEE 11th International Conference on Software Testing, Verification and Validation (ICST), Apr. 9-13, 2018, 4 pages. [cited by applicant]
Atlidakis et al., “RESTler: Stateful REST API Fuzzing”, 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), May 25-31, 2019, 11 pages. [cited by applicant]
Cadar et al. “EXE: Automatically Generating Inputs of Death”, ACM Transactions on Information and System Security (TISSEC), Dec. 1, 2008, pp. 1-38, vol. 12, Issue 2, Article No. 10. [cited by applicant]
Disclosed Anonymously, IP.com No. IPCOM000272674D “Method and System for Prediction of Large Scale Conversion Rate (CVR) through Dynamic Transfer Learning of Global and Local Features”, Jul. 12, 2023, 10 pages. [cited by applicant]
Godefroid et al, “DART: directed automated random testing”, PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation, Jun. 12, 2005, pp. 213-223. [cited by applicant]
Karlsson et al. “Quick REST: Property-based Test Generation of Open API-Described RESTful APIs”, 2020 IEEE 13th International Conference on Software Testing, Validation and Verification (ICST), Dec. 29, 2019, 11 pages. [cited by applicant]
Kim et al. “Adaptive REST API Testing with Reinforcement Learning”, 2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE), Sep. 8, 2023, 13 pages. [cited by applicant]
Liu et al., “Morest: Model-Based RESTful API Testing with Execution Feedback”, ICSE '22: Proceedings of the 44th International Conference on Software Engineering, pp. 1406-1417, Jul. 5, 2022, 12 pages. [cited by applicant]
Patrick, et al. “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.” Advances in Neural Information Processing Systems, Apr. 12, 2021, 19 pages. [cited by applicant]
Sen et al., “CUTE: a concolic unit testing engine for C”, ACM SIGSOFT Software Engineering Notes, Sep. 1, 2005, pp. 263-272, vol. 30, Issue 5. [cited by applicant]
Shizhe et al. “Active prompting with chain-of-thought for large language models.” arXiv preprint arXiv:2302.12246, 2023, 21 pages. [cited by applicant]
Sri et al. “Automating REST API Postman Test Cases Using LLM”, arXiv:2404.10678, 2024, 11 pages. [cited by applicant]