paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Adaptive REST API Testing with Reinforcement Learning

基于强化学习的自适应 REST API 测试
ASE 2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE)2023匹配度 2/10 · 该论文将强化学习用于 REST API 测试,属于机器学习辅助软件测试方向,而非用户关注的静态分析/形式化验证、Agentic/LLM 程序分析,或浮点、贝叶斯程序分析及其与 LLM 的交叉。仅与“机器学习与程序语言”有非常弱的标签关联,因此匹配度低。引用 58 inbox
Myeongsoo Kim, Saurabh Sinha, Alessandro Orso
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出用强化学习动态优先化操作与参数的自适应 REST API 测试技术,提升覆盖率与缺陷发现能力。

REST API 测试面临巨大的搜索空间:既要选择操作以构成调用序列,又要从大量参数中选参,并在近乎无限的输入空间中采样取值。现有工具缺乏高效探索机制,对所有操作与参数同等对待,缺少优先级策略,且在规范中缺失响应模式或存在变体时表现不佳。本文提出一种自适应 REST API 测试技术,引入强化学习在探索过程中优先化操作与参数;同时动态分析请求与响应数据以推断依赖参数,并采用基于采样的策略高效处理动态 API 反馈。作者在十个 RESTful 服务上开展评估,与最先进的 REST 测试工具比较代码覆盖率、生成请求数、覆盖操作数与触发的服务故障数,并对优先化、动态反馈分析与采样进行消融研究。结果表明该方法在有效性、效率与缺陷发现能力上均优于现有 REST API 测试工具。

问题
现有 REST API 测试工具在庞大搜索空间中平等对待所有操作与参数、缺乏优先级策略,且难以应对响应模式缺失或存在变体的规范,导致探索效率与缺陷发现能力不足。
方法
提出自适应测试技术,用强化学习动态优先化操作与参数,并通过分析请求与响应数据识别依赖参数,采用基于采样的策略处理动态 API 反馈。
评估
在十个 RESTful 服务上与最先进 REST 测试工具对比代码覆盖率、生成请求数、覆盖操作数与服务故障触发数,并通过消融研究评估优先化、动态反馈分析与采样各组件的贡献。
原文摘要(Abstract)

Modern web services increasingly rely on REST APIs. Effectively testing these APIs is challenging due to the vast search space to be explored, which involves selecting API operations for sequence creation, choosing parameters for each operation from a potentially large set of parameters, and sampling values from the virtually infinite parameter input space. Current testing tools lack efficient exploration mechanisms, treating all operations and parameters equally (i.e., not considering their importance or complexity) and lacking prioritization strategies. Furthermore, these tools struggle when response schemas are absent in the specification or exhibit variants. To address these limitations, we present an adaptive REST API testing technique that incorporates reinforcement learning to prioritize operations and parameters during exploration. Our approach dynamically analyzes request and response data to inform dependent parameters and adopts a sampling-based strategy for efficient processing of dynamic API feedback. We evaluated our technique on ten RESTful services, comparing it against state-of-the-art REST testing tools with respect to code coverage achieved, requests generated, operations covered, and service failures triggered. Additionally, we performed an ablation study on prioritization, dynamic feedback analysis, and sampling to assess their individual effects. Our findings demonstrate that our approach outperforms existing REST API testing tools in terms of effectiveness, efficiency, and fault-finding ability.

链接与引用

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

BibTeX
@inproceedings{abs-2309-04583,
  title = {Adaptive REST API Testing with Reinforcement Learning},
  author = {Myeongsoo Kim and Saurabh Sinha and Alessandro Orso},
  booktitle = {ASE},
  year = {2023},
  doi = {10.1109/ase56229.2023.00218}
}