DeepREST: Automated Test Case Generation for REST APIs Exploiting Deep Reinforcement Learning
Automatically crafting test scenarios for REST APIs helps deliver more reliable and trustworthy web-oriented systems. However, current black-box testing approaches rely heavily on the information available in the API’s formal documentation, i.e., the Open API Specification (OAS for short). While useful, the OAS mostly covers syntactic aspects of the API (e.g., producer-consumer relations between operations, input value properties, and additional constraints in natural language), and it lacks a deeper understanding of the API business logic. Missing semantics include implicit ordering (logic dependency) between operations and implicit input-value constraints. These limitations hinder the ability of black-box testing tools to generate truly effective test cases automatically.
This paper introduces DeepREST, a novel black-box approach for automatically testing REST APIs. It leverages \emph{deep reinforcement learning} to uncover implicit API constraints, that is, constraints hidden from API documentation. Curiosity-driven learning guides an agent in the \emph{exploration} of the API and learns an effective order to test its operations. This helps identify which operations to test first to take the API in a testable state and avoid failing API interactions later. At the same time, \emph{experience} gained on successful API interactions is leveraged to drive accurate input data generation (i.e., what parameters to use and how to pick their values). Additionally, DeepREST alternates exploration with \emph{exploitation} by mutating successful API interactions to improve test coverage and collect further experience.
Our empirical validation suggests that the proposed approach is very effective in achieving high test coverage and fault detection and superior to a state-of-the-art baseline.
Thu 31 OctDisplayed time zone: Pacific Time (US & Canada) change
10:30 - 12:00 | Test generationResearch Papers / Journal-first Papers at Gardenia Chair(s): Lingming Zhang University of Illinois at Urbana-Champaign | ||
10:30 15mTalk | Towards Understanding the Effectiveness of Large Language Models on Directed Test Input Generation Research Papers Zongze Jiang Huazhong University of Science and Technology, Ming Wen Huazhong University of Science and Technology, Jialun Cao Hong Kong University of Science and Technology, Xuanhua Shi Huazhong University of Science and Technology, Hai Jin Huazhong University of Science and Technology | ||
10:45 15mTalk | Distribution-aware Fairness Test Generation Journal-first Papers Sai Sathiesh Rajan Singapore University of Technology and Design, Singapore, Ezekiel Soremekun Royal Holloway, University of London, Yves Le Traon University of Luxembourg, Luxembourg, Sudipta Chattopadhyay Singapore University of Technology and Design | ||
11:00 15mTalk | Effective Unit Test Generation for Java Null Pointer Exceptions Research Papers Myungho Lee Korea University, Jiseong Bak Korea University, Seokhyeon Moon , Yoon-Chan Jhi Technology Research, Samsung SDS, Seoul, South Korea, Hakjoo Oh Korea University | ||
11:15 15mTalk | SlicePromptTest4J: High-coverage Test Generation using LLM via Method Slicing Research Papers Zejun Wang Peking University, Kaibo Liu Peking University, Ge Li Peking University, Zhi Jin Peking University | ||
11:30 15mTalk | DeepREST: Automated Test Case Generation for REST APIs Exploiting Deep Reinforcement Learning Research Papers Davide Corradini University of Verona, Zeno Montolli University of Verona, Michele Pasqua University of Verona, Mariano Ceccato University of Verona | ||
11:45 15mTalk | On the Evaluation of Large Language Models in Unit Test Generation Research Papers Lin Yang Tianjin University, Chen Yang Tianjin University, Shutao Gao Tianjin University, Weijing Wang College of Intelligence and Computing, Tianjin University, Bo Wang Beijing Jiaotong University, Qihao Zhu DeepSeek-AI, Xiao Chu Huawei Cloud Computing Co. Ltd., Jianyi Zhou Huawei Cloud Computing Technologies Co., Ltd., Guangtai Liang Huawei Cloud Computing Technologies, Qianxiang Wang Huawei Technologies Co., Ltd, Junjie Chen Tianjin University Pre-print |