A Method of Automated Mock Data Generation for RESTful API Testing

Doan Thi Hoai Thu, Le Duy Quang, Duc–Anh Nguyen, Phạm Ngọc Hùng · 2022 RIVF International Conference on Computing and Communication Technologies (RIVF) · 2022

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.

Read the paper · More papers on PaperTik