Enabling Black-box RPC-API Testing with Multi-Agent Reinforcement Learning and LLMs: An Industry Case Study
APIs underpin modern web and cloud services, making black-box testing crucial for reliability. However, existing approaches struggle in industrial settings where Remote Procedure Call (RPC) APIs are widely adopted. Being action-oriented, RPC services expose numerous interdependent operations with loosely structured specifications, which makes operation dependencies hard to infer, limiting test coverage and efficiency. Moreover, current methods neglect parameter constraints across operations, yielding many invalid test inputs and wasting resources. Besides, their crude feedback offers poor guidance, often misdirecting test strategy adaptation.
To solve these problems, we present \textbf{BRAT}, a practical \textbf{b}lack-box \textbf{R}PC \textbf{A}PI \textbf{t}esting solution that integrates multi-agent reinforcement learning (MARL) with large language models (LLMs). BRAT first analyzes API specifications and call logs to construct a Procedure Call Dependency Graph, capturing both semantic and behavioral information for more precise dependency inference. A target selector, composed of four MARL agents, then hierarchically explores the test space to prioritize testable targets. For valid input generation, BRAT fine-tunes a lightweight LLM using a rejection-sampling strategy enhanced by Chain-of-Thought to handle cross-operation constraints. Finally, a fine-grained, error-message–driven feedback mechanism pinpoints responsible components, facilitating targeted testing strategy refinement. Evaluations on 1k+ production RPC APIs in Alibaba Cloud Network show that BRAT achieves 77.67% operation coverage and 73.71% parameter coverage with 67.23% valid test cases, and discovers 57 previously unknown bugs, outperforming SOTA black-box testing tools. We share key insights and open challenges from this industrial practice.
Wed 15 AprDisplayed time zone: Brasilia, Distrito Federal, Brazil change
11:00 - 12:30 | Testing and Analysis 3SE In Practice (SEIP) / Research Track at Oceania I Chair(s): Yvonne Dittrich IT University of Copenhagen | ||
11:00 15mTalk | TestifAI: Tomography-Based Testing for Deep Learning Systems Research Track Arooj Arif Northeastern University London, Tobias Hartung Northeastern University London, Elena Botoeva University of Kent, Alexandros Koliousis Northeastern University London | ||
11:15 15mTalk | Automated Software Test Generation at Industry Scale Using a Multi-Agent Architecture and Workflow Integration SE In Practice (SEIP) Matas Rastenis Uber Technologies Inc., Ben Chou Uber Technologies Inc., Shauvik Roy Choudhary Uber Technologies, Inc, René Just University of Washington Media Attached | ||
11:30 15mTalk | On the Flakiness of LLM-generated Tests for Industrial and Open-Source Database Management Systems SE In Practice (SEIP) Alexander Berndt Heidelberg University, Thomas Bach SAP, Rainer Gemulla University of Mannheim, Marcus Kessel University of Mannheim, Sebastian Baltes Heidelberg University Pre-print | ||
11:45 15mTalk | Enabling Black-box RPC-API Testing with Multi-Agent Reinforcement Learning and LLMs: An Industry Case Study SE In Practice (SEIP) Xiaoqing Sun Alibaba Cloud, Zhou Shao Alibaba Cloud, Xiaonan Shi Alibaba Cloud, Shiliang Xiao Alibaba Cloud, Chao Ma Alibaba Cloud, Xiaobo Xue Alibaba Cloud, Jianyuan Lu Alibaba Cloud, Shize Zhang Alibaba Cloud, Enge Song Alibaba Cloud, Song Yang Alibaba Cloud, Xing Li Zhejiang University and Alibaba Cloud, Chongrong Fang Shanghai Jiao Tong University, Chunrong Fang Nanjing University, Biao Lyu Alibaba Cloud, Shunmin Zhu Hangzhou Feitian Cloud and Alibaba Cloud | ||
12:00 15mTalk | Hamster: A Large-Scale Study and Characterization of Developer-Written Tests SE In Practice (SEIP) Rangeet Pan IBM Research, Tyler Stennett Georgia Institute of Technology, Raju Pavuluri IBM T.J. Watson Research Center, Nate Levin Georgia Institute of Technology, Alessandro Orso University of Georgia, USA, Saurabh Sinha IBM Research | ||
12:15 15mTalk | AutoOracle: High-Quality C++ Test Oracle Generation via Data Quality-Driven and Filtering-Enabled LLMs SE In Practice (SEIP) Cong Li Samsung R&D Institute China Xi'an, Samsung Electronics, Jong-In Jang Samsung Electronics, Yuqi Zhang Samsung R&D Institute China Xi'an, Samsung Electronics, Nakwon Lee Samsung Electronics, Bin Wang , Yinghua Zhang Samsung R&D Institute China Xi'an, Samsung Electronics, Chanwook Kim Samsung Electronics, Jia Zhang Samsung R&D Institute China Xi'an, Samsung Electronics, HyunSeok Kim Samsung Electronics, Xing He Samsung R&D Institute China Xi'an, Samsung Electronics, Kangho Roh Samsung Electronics, Seongjun Ahn Samsung Electronics | ||