RESTestBench
收藏资源简介:
RESTestBench是由CASABLANCA酒店软件公司联合多所高校开发的REST API测试基准,包含3个真实场景的REST服务、106条经过人工验证的双粒度自然语言需求(精确版与模糊版)以及228条基于需求设计的变异用例。数据集通过OpenAPI规范描述接口,配套提供评估框架,支持对LLM生成的测试用例进行基于属性变异测试(PBMT)的量化评估。该基准旨在解决传统API测试指标(如代码覆盖率)无法衡量需求对齐度的痛点,特别适用于验证自然语言需求到可执行测试用例的转换效果,推动智能化API测试工具的发展。
RESTestBench is a REST API testing benchmark developed by CASABLANCA Hotel Software Company in collaboration with multiple universities. It includes 3 real-world REST services, 106 manually verified dual-granularity natural language requirements (precise and vague versions), and 228 mutation test cases designed based on these requirements. The dataset describes interfaces via the OpenAPI Specification, and is equipped with an evaluation framework that supports quantitative evaluation of test cases generated by LLMs through Property-Based Mutation Testing (PBMT). This benchmark aims to solve the pain point that traditional API testing metrics such as code coverage cannot measure requirements alignment, and is particularly suitable for verifying the conversion effect from natural language requirements to executable test cases, so as to promote the development of intelligent API testing tools.
RESTestBench 数据集概述
RESTestBench 是一个用于评估由大型语言模型(LLM)从自然语言需求生成的 REST API 测试用例有效性的基准测试集。
核心目标
通过基于需求的变异测试(requirements-based mutation testing),衡量生成的测试用例能否检测出 REST API 实现中注入的已知故障(变异体)。
数据集构成
数据集位于 data/requirements/ 目录下,覆盖了三个 REST API 服务:
| 服务 | 框架 | 需求数量 | 端口 |
|---|---|---|---|
fastapi |
FastAPI (Python) | 63 | 8000 |
nestjs-realworld |
NestJS (TypeScript) | 26 | 3000 |
todoapp |
.NET (C#) | 14 | 5000 |
每个需求是一个 JSON 文件(data/requirements/<服务名>/requirement_<编号>.json),包含:
- 精确需求(precise) 和 模糊需求(vague) 两种描述
- 一个或多个变异体(injected faults),测试用例需要检测这些故障
主要特点
- 支持评估多种测试生成方法
- 提供单步生成(single-step)和迭代精化(refinement)两种工具实现
- 评估了 10 种 LLM 模型在精确和模糊需求下的表现
关键发现
- 需求精确度对测试有效性影响显著,精确描述通常比增加精化循环更重要
- 迭代精化在需求不明确时帮助更大,但在需求精确时收益有限
- 生成过程中与服务交互可能导致工具适应错误行为,遗漏本应检测的故障
- 模型大小不能简单代表测试质量,小模型可能无法覆盖变异代码,大模型可能过度设计断言



