An Approach to Generating API Test Scripts Using GPT
Proceedings of the 12th International Symposium on Information and …, 2023•dl.acm.org
As more software systems publish and use web services or APIs today, automated API
testing is an important activity to help effectively ensure the quality of software services
before they are released for their usage. Generating test scripts and data is a crucial step to
perform API test automation successfully. In this paper, we propose an approach leveraging
GPT, a large language model, and API's Swagger specification to automatically generate
test scripts and test data for API testing. Our approach also applies GPT's self-refining with …
testing is an important activity to help effectively ensure the quality of software services
before they are released for their usage. Generating test scripts and data is a crucial step to
perform API test automation successfully. In this paper, we propose an approach leveraging
GPT, a large language model, and API's Swagger specification to automatically generate
test scripts and test data for API testing. Our approach also applies GPT's self-refining with …
As more software systems publish and use web services or APIs today, automated API testing is an important activity to help effectively ensure the quality of software services before they are released for their usage. Generating test scripts and data is a crucial step to perform API test automation successfully. In this paper, we propose an approach leveraging GPT, a large language model, and API’s Swagger specification to automatically generate test scripts and test data for API testing. Our approach also applies GPT’s self-refining with the feedback by executing tests on Katalon. We evaluate our proposed approach using a data set of seven APIs consisting of 157 endpoints and 179 operations. The result shows that while our approach generates fewer test scripts and data inputs, it can cover more successful status codes of 2xx than a state-of-the-art tool. This result suggests that leveraging the ability of GPT as a large language model to interpret API’s Swagger specification has the potential for improving the efficacy of generating test scripts and data for API testing.
![](/https/scholar.google.com/scholar/images/qa_favicons/acm.org.png)
Showing the best result for this search. See all results