一句话:利用LLM挖掘API隐式约束并用于REST API测试,弥补状态码与模式校验的不足。
REST API 测试对现代 Web 服务的可靠性与性能至关重要,其中黑盒测试依赖 OpenAPI 规范(OAS)生成测试用例与数据。然而,现有 API 测试自动化方法主要局限于状态码校验与响应模式(schema)校验:前者检查每个 HTTP 请求是否返回状态码,后者检查响应中必填属性是否存在、数据类型是否与规范一致。这类检查难以覆盖请求与响应中的深层语义约束。本文(标题为《Using LLM for Mining and Testing Constraints in API Testing》)提出借助大语言模型从 API 规范中挖掘隐式约束,并将这些约束用于 API 测试,以弥补仅做状态码与模式校验的不足。摘要主要给出了动机与问题界定,未详细报告具体方法与实验结果。
Testing Representational State Transfer (REST) APIs is crucial for ensuring the reliability and performance of APIs, which are essential to modern web services. This testing process helps identify and resolve issues related to data exchange and integration with other systems. Among the various API testing techniques, black-box testing relies on the OpenAPI Specification (OAS) to generate test cases and data. However, current API test automation methods are primarily focused on status code [10] and schema validation [1]. Status code validation involves ensuring that each HTTP request returns a response with a status code, a three-digit integer that indicates the outcome of the request. Schema validation verifies the correctness of the response data by comparing it to the schema. This includes checking that all required properties are present and that data types of these properties align with the schema specified.
DOI 原文 ·
@inproceedings{paperbot8332,
title = {Using LLM for Mining and Testing Constraints in API Testing},
author = {Hieu Huynh and Quoc-Tri Le and Tien N. Nguyen and Vu Nguyen},
booktitle = {ASE},
year = {2024},
doi = {10.1145/3691620.3695341}
}