paperbot · PL 论文追踪

全部论文 待读 收藏

P1 RBCTest: Leveraging LLMs to Mine and Verify Oracles of API Response Bodies for RESTful API Testing

RBCTest:利用LLM为RESTful API测试挖掘并验证API响应体判定(oracle)
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 5/10 · 该论文用 LLM 从 API 规范中静态挖掘响应体约束/oracle 并生成测试用例,与“LLM 辅助静态分析与验证”有方法层面的交集;但其核心是 RESTful API 测试与 oracle 挖掘,不涉及浮点程序分析、贝叶斯程序分析、Agentic 程序或 ML 系统静态分析,属于邻近但非核心方向。引用 3 inbox
Hieu Huynh, Quoc-Tri Le, Tu Nguyen, Viet Nguyen, Vu Nguyen, Tien N. Nguyen
crossref: 2026-09-12

AI 速览

一句话:提出LLM驱动的静态方法,从API规范中挖掘响应体约束作为oracle并生成RESTful API测试用例,以观察-确认提示抑制幻觉。

现有RESTful API测试中,响应体逻辑约束(作为oracle)的提取多依赖动态执行被测API,适用范围受限。本文提出RBCTest,一种互补的、基于LLM的静态方法:让大语言模型理解API规范,从中挖掘响应体应满足的约束,并据此自动生成测试用例。为缓解LLM的幻觉问题,作者设计了Observation-Confirmation(OC)提示方案,先用初始提示对约束进行语境化,再由后续提示更准确地确认约束是否存在。实验表明,采用OC提示的RBCTest在约束挖掘上平均精度达85.1%–93.6%,由约束生成的测试用例精度达86.4%–91.7%。作者还将其用于19个真实API,检测出46处API规范与实际响应数据之间的不一致,其中4处已在开发者论坛中被报告。

问题
在RESTful API测试中,从API响应体中推导作为oracle的逻辑约束十分关键,但现有方法局限于动态执行被测API,无法在仅有规范时提前获得约束。
方法
提出基于LLM的静态方法RBCTest,从API规范中理解并挖掘响应体约束、生成测试用例,并通过Observation-Confirmation提示方案先语境化后用后续提示确认约束,以降低幻觉。
评估
在真实API上评估约束挖掘与测试用例生成的精度(分别为85.1%–93.6%和86.4%–91.7%),并对19个真实API检测规范与响应数据的不一致,发现46处mismatch,其中4处已见于开发者论坛。
原文摘要(Abstract)

In API testing, deriving logical constraints on API response bodies to be used as oracles is crucial in generating test cases and performing automated testing of RESTful APIs. However, existing approaches are restricted to dynamic analysis in which oracles are extracted via the execution of APIs as part of the system under test. In this paper, we propose a complementary LLM-based, static approach in which the constraints for API response bodies are mined from API specifications. We leverage large language models (LLMs) to comprehend the API specifications, mine constraints for response bodies, and generate test cases. To reduce LLMs’ hallucination, we apply an Observation-Confirmation (OC) scheme which uses initial prompts to contextualize constraints, allowing subsequent prompts to more accurately confirm their presence. Our empirical results show that RBCTest with OC prompting achieves high precision in constraint mining with the average from 85.1%–93.6%. It also performs well in generating test cases from mined constraints, with a precision from 86.4%–91.7%. We also use the test cases generated by RBCTest to detect 46 mismatches between the API specification and actual response data for 19 real-world APIs. Four of the mismatches were, in fact, reported in developers’ forums.

链接与引用

DOI 原文 · arXiv ·

BibTeX
@inproceedings{paperbot11949,
  title = {RBCTest: Leveraging LLMs to Mine and Verify Oracles of API Response Bodies for RESTful API Testing},
  author = {Hieu Huynh and Quoc-Tri Le and Tu Nguyen and Viet Nguyen and Vu Nguyen and Tien N. Nguyen},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3787775}
}