paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SATORI: Static Test Oracle Generation for REST APIs

SATORI:面向 REST API 的静态测试预言生成
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 4/10 · 该论文用 LLM 从 OpenAPI 规范静态推断 REST API 的测试预言,属于 LLM 辅助软件测试/规约推断,与画像中“用 LLM 改进静态分析/形式化验证”仅在“LLM 作为静态推断工具”这一表层重合;其分析对象是 API 规范而非程序代码,不涉及程序分析、浮点程序分析或贝叶斯程序分析,与核心研究方向距离较远。工业落地与真实缺陷发现的亮点符合用户偏好,但主题不匹配。引用 1 inbox
Juan C. Alonso, Alberto Martin-Lopez, Sergio Segura, Gabriele Bavota, Antonio Ruiz-Cortés
crossref: 2026-09-12

AI 速览

一句话:用大语言模型分析 OpenAPI 规范静态推断 REST API 的测试预言,F1 达 74.3%,发现 18 个真实缺陷。

REST API 测试用例生成工具发展迅速,但在测试预言(oracle)方面支持有限,通常只能检测崩溃、回归以及违反 API 规范或设计标准的情况。本文提出 SATORI(Static API Test ORacle Inference),一种黑盒方法:它分析 API 的 OpenAPI 规范,利用大语言模型根据响应字段的名称、描述等属性推断 API 的期望行为,从而自动生成测试预言。为便于落地,作者扩展了 PostmanAssertify,将 SATORI 生成的预言自动转换为可执行断言。在来自 12 个工业 API 的 17 个操作上的评估显示,SATORI 每个操作可生成多达数百个有效预言,F1 分数为 74.3%,在可比预言类型上超过需要实际执行 API 的动态方法 AGORA+(69.3%)。研究还表明静态与动态预言推断具有互补性,两者合计覆盖标注真值数据集中 90% 的预言。SATORI 在 Amadeus Hotel、Deutschebahn、FDIC、GitLab、Marvel、OMDb 与 Vimeo 等流行 API 中发现 18 个缺陷,并促成维护者更新文档。

问题
REST API 测试生成工具虽能自动构造测试数据,但其支持的测试预言类型十分有限,通常仅覆盖崩溃、回归和规范不符合,难以检测更深层的语义错误。
方法
SATORI 是一种黑盒静态方法,从 OpenAPI 规范出发,用大语言模型分析操作响应字段的名称与描述等属性来推断期望行为,生成测试预言,并通过扩展的 PostmanAssertify 将其转换为可执行断言。
评估
在 12 个工业 API 的 17 个操作上与动态方法 AGORA+ 对比,SATORI 的 F1 为 74.3%,高于 AGORA+ 的 69.3%,二者互补可覆盖 90% 的标注真值预言,并在 7 个流行 API 中发现 18 个真实缺陷。
原文摘要(Abstract)

REST API test case generation tools are evolving rapidly, with growing capabilities for the automated generation of complex tests. However, despite their strengths in test data generation, these tools are constrained by the types of test oracles they support, often limited to crashes, regressions, and noncompliance with API specifications or design standards. This paper introduces SATORI (Static API Test ORacle Inference), a black-box approach for generating test oracles for REST APIs by analyzing their OpenAPI Specification. SATORI uses large language models to infer the expected behavior of an API by analyzing the properties of the response fields of its operations, such as their name and descriptions. To foster its adoption, we extended the PostmanAssertify tool to automatically convert the test oracles reported by SATORI into executable assertions. Evaluation results on 17 operations from 12 industrial APIs show that SATORI can automatically generate up to hundreds of valid test oracles per operation. SATORI achieved an F1-score of 74.3%, outperforming the state-of-the-art dynamic approach AGORA+(69.3%)—which requires executing the API—when generating comparable oracle types. Moreover, our findings show that static and dynamic oracle inference methods are complementary: together, SATORI and AGORA+ found 90% of the oracles in our annotated ground-truth dataset. Notably, SATORI uncovered 18 bugs in popular APIs (Amadeus Hotel, Deutschebahn, FDIC, GitLab, Marvel, OMDb and Vimeo) leading to documentation updates by the API maintainers.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot9545,
  title = {SATORI: Static Test Oracle Generation for REST APIs},
  author = {Juan C. Alonso and Alberto Martin-Lopez and Sergio Segura and Gabriele Bavota and Antonio Ruiz-Cortés},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00116}
}