paperbot · PL 论文追踪

全部论文 待读 收藏

P2 AGORA: Automated Generation of Test Oracles for REST APIs

AGORA:为 REST API 自动生成测试预言
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 2/10 · 该论文研究REST API测试预言自动生成,使用动态不变量检测(扩展Daikon),属于软件测试与动态分析方向。用户研究方向聚焦于PL与AI/LLM的交叉、静态分析、浮点程序分析和贝叶斯程序分析,二者无直接交集,论文也未涉及LLM/Agent或相关交叉主题。引用 26 inbox
Juan C. Alonso, Sergio Segura, Antonio Ruiz-Cortés
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 AGORA,用动态不变量检测为 REST API 自动生成测试预言,并发现多种实际缺陷。

REST API 测试工具虽能自动生成输入,但测试预言过于简单,只能发现崩溃、回归或规范违背。AGORA 通过分析历史 API 请求与响应学习预期行为,自动生成测试预言。它扩展了动态不变量检测工具 Daikon,新增 REST API 不变量类型,并实现 Beet 将 OpenAPI 规范及请求/响应转为 Daikon 格式,目前支持 105 种不变量。在 7 个工业 API 的 11 个操作上,精度为 81.2%,可检测出 60% 的种子错误;还在 Amadeus、GitHub、Marvel、OMDb 和 YouTube 中发现 11 个缺陷,部分报告促成 GitHub 修复与文档更新。AGORA 以黑盒方式运行,可集成到现有 API 测试工具中。

问题
REST API 的输入生成已较成熟,但测试预言简单,限制了可检测的故障类型,如崩溃、回归、规范或最佳实践违背。
方法
通过分析历史请求与响应学习 API 预期行为,以动态不变量检测为核心,扩展 Daikon、新增不变量类型并用 Beet 转换 OpenAPI 规范与请求/响应。
评估
在来自 7 个工业 API 的 11 个操作上评估,精度达 81.2%,检测出 60% 的种子错误,并在多个实际 API 中发现 11 个缺陷。
原文摘要(Abstract)

Test case generation tools for REST APIs have grown in number and complexity in recent years. However, their advanced capabilities for automated input generation contrast with the simplicity of their test oracles, which limit the types of failures they can detect to crashes, regressions, and violations of the API specification or design best practices. In this paper, we present AGORA, an approach for the automated generation of test oracles for REST APIs through the detection of invariants—properties of the output that should always hold. In practice, AGORA aims to learn the expected behavior of an API by analyzing previous API requests and their corresponding responses. For this, we extended the Daikon tool for dynamic detection of likely invariants, including the definition of new types of invariants and the implementation of an instrumenter called Beet. Beet converts any OpenAPI specification and a collection of API requests and responses to a format processable by Daikon. As a result, AGORA currently supports the detection of up to 105 different types of invariants in REST APIs. AGORA achieved a total precision of 81.2% when tested on a dataset of 11 operations from 7 industrial APIs. More importantly, the test oracles generated by AGORA detected 6 out of every 10 errors systematically seeded in the outputs of the APIs under test. Additionally, AGORA revealed 11 bugs in APIs with millions of users: Amadeus, GitHub, Marvel, OMDb and YouTube. Our reports have guided developers in improving their APIs, including bug fixes and documentation updates in GitHub. Since it operates in black-box mode, AGORA can be seamlessly integrated into existing API testing tools.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{AlonsoSR23,
  title = {AGORA: Automated Generation of Test Oracles for REST APIs},
  author = {Juan C. Alonso and Sergio Segura and Antonio Ruiz-Cortés},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598114}
}