UPDF AI

A Method of Automated Mock Data Generation for RESTful API Testing

Doan Thi Hoai Thu,Le Duy Quang,D. Nguyen,Pham Ngoc Hung

2022 · DOI: 10.1109/RIVF55975.2022.10013835
Conference on Research, Innovation and Vision for the Future in Computing & Communication Technologies · 2 Citations

Abstract

Testing RESTful web services poses a lot of challenges, as inputs/outputs are HTTP Requests/Responses. Several approaches have been proposed to deal with this issue. In our previous paper, we introduced a white-box method, namely PUT, to automatically generate test data as message payload in HTTP requests for testing RESTful APIs. Although our experimental results indicated that PUT had achieved potential effectiveness, the code coverage could not reach the maximum value because of several restrictions, including database access. To handle this problem, this paper proposes PUT-MOCK method, an updated version of PUT, to generate useful mock data for stubbing accessing database functionalities. Our experimental results indicated that PUT-MOCK increases average statement coverage from 66.6% to 86.5%, compared to PUT method. It means that PUT-MOCK method could bring potential effectiveness for testing RESTful APIs.