API Test Case Generation by Extracting HTTP Requests During Front-End Testing

Yijie Guo, Shang‐Pin Ma, Hsin-Jui Peng, Yu‐Sheng Su · 2024

This study proposes a semi-automated generation method for Web API test cases based on front-end behavior-driven testing, called BATCG (BDD-based API Test Case Generation). BATCG uses the Gherkin language to describe front-end test scenarios to ensure the correct execution of front-end behavior-driven tests. It captures HTTP request data during the front-end UI (user interface) testing to accumulate test data. Based on API Swagger documents, it generates Web API test cases by considering usage scenarios in the form of Karate scripts. Besides, this study conducts experiments on five actual systems with six test cases (including 12 scenarios). The experimental results show that BATCG can correctly generate 10 test scripts that achieve an accuracy rate of 83.33%.

Read the paper · More papers on PaperTik