paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Carving UI Tests to Generate API Tests and API Specification

从 UI 测试中切分出 API 测试与 API 规范
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 1/10 · 该论文研究从 UI 测试生成 API 测试与 OpenAPI 规范,属于 Web 应用测试与动态分析方向;与用户关注的 PL 与 AI/LLM/Agent 交叉、静态分析、浮点程序分析、贝叶斯程序分析等核心方向几乎没有交集。引用 27 inbox
Rahulkrishna Yandrapally, Saurabh Sinha, Rachel Tzoref-Brill, Ali Mesbah
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出从 UI 测试中切分生成 API 测试与 OpenAPI 规范,支持无规格 Web 应用的 API 级测试。

现代 Web 应用大量通过 API 更新 UI 状态,API 级测试可衔接单元测试与端到端 UI 测试,但现有工具依赖 OpenAPI 规范,而规范常缺失或与实现不一致。本文提出利用 UI 测试的 API 级测试方法:导航待测应用,结合 UI 导航与定向 API 探测,动态推断含路径参数的 API 端点,自动生成 API 测试套件和 OpenAPI 规范。在 7 个开源 Web 应用上,端点推断精确率 98%、召回率 56%;将切分出的 API 测试加入两个 REST API 测试工具生成的套件后,平均语句覆盖率提升 52% 和 29%,分支覆盖率提升 99% 和 75%。该方法可在现有工具不适用时进行 API 级测试,并补充已有 API 测试套件。

问题
现有 API 测试工具依赖可能缺失或不一致的 API 规范,难以对 Web 应用进行自动化 API 级测试。
方法
通过 UI 导航和定向 API 探测动态推断含路径参数的 API 端点,从 UI 测试中切分生成 API 测试套件与 OpenAPI 规范。
评估
在 7 个开源 Web 应用上评估端点推断的精确率、召回率,以及切分出的 API 测试对两个 REST API 测试工具套件的覆盖率提升效果。
原文摘要(Abstract)

Modern web applications make extensive use of API calls to update the UI state in response to user events or server-side changes. For such applications, API-level testing can play an important role, in-between unit-level testing and UI-level (or end-to-end) testing. Existing API testing tools require API specifications (e.g., OpenAPI), which often may not be available or, when available, be inconsistent with the API implementation, thus limiting the applicability of automated API testing to web applications. In this paper, we present an approach that leverages UI testing to enable API-level testing for web applications. Our technique navigates the web application under test and automatically generates an API-level test suite, along with an OpenAPI specification that describes the application's server-side APIs (for REST-based web applications). A key element of our solution is a dynamic approach for inferring API endpoints with path parameters via UI navigation and directed API probing. We evaluated the technique for its accuracy in inferring API specifications and the effectiveness of the “carved” API tests. Our results on seven open-source web applications show that the technique achieves 98% precision and 56% recall in inferring endpoints. The carved API tests, when added to test suites generated by two automated REST API testing tools, increase statement coverage by 52% and 29% and branch coverage by 99% and 75%, on average. The main benefits of our technique are: (1) it enables API-level testing of web applications in cases where existing API testing tools are inapplicable and (2) it creates API-level test suites that cover server-side code efficiently while exercising APIs as they would be invoked from an application's web UI, and that can augment existing API test suites.

链接与引用

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

BibTeX
@inproceedings{abs-2305-14692,
  title = {Carving UI Tests to Generate API Tests and API Specification},
  author = {Rahulkrishna Yandrapally and Saurabh Sinha and Rachel Tzoref-Brill and Ali Mesbah},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00167}
}