一句话:提出 NLPtoREST,利用 OpenAPI 规范的自然语言描述抽取规则并增强规范,从而提升 REST API 测试工具的效果。
RESTful 服务通常以 OpenAPI 规范文档化,现有自动测试技术多利用规范的机器可读部分指导测试生成,却忽视了人类可读的自然语言描述,而这些描述往往包含示例值和参数间依赖等可用于改进测试生成的信息。为此,作者提出 NLPtoREST:给定 API 及其规范,它应用自然语言处理技术从规范的人类可读部分抽取额外的 OpenAPI 规则,并将其加入原规范形成增强规范,使测试工具可透明地利用该增强规范生成更优测试用例。由于自然语言固有的歧义以及文档与实现的不一致可能导致规则抽取不准确,NLPtoREST 还引入验证步骤以消除虚假规则。作者评估了规则抽取与验证方法的有效性,并考察增强规范对八种先进 REST API 测试工具性能的影响,结果表明 NLPtoREST 能以高准确率抽取大量相关规则,并显著提升测试工具的表现。
RESTful services are commonly documented using OpenAPI specifications. Although numerous automated testing techniques have been proposed that leverage the machine-readable part of these specifications to guide test generation, their human-readable part has been mostly neglected. This is a missed opportunity, as natural language descriptions in the specifications often contain relevant information, including example values and inter-parameter dependencies, that can be used to improve test generation. In this spirit, we propose NLPtoREST, an automated approach that applies natural language processing techniques to assist REST API testing. Given an API and its specification, NLPtoREST extracts additional OpenAPI rules from the human-readable part of the specification. It then enhances the original specification by adding these rules to it. Testing tools can transparently use the enhanced specification to perform better test case generation. Because rule extraction can be inaccurate, due to either the intrinsic ambiguity of natural language or mismatches between documentation and implementation, NLPtoREST also incorporates a validation step aimed at eliminating spurious rules. We performed studies to assess the effectiveness of our rule extraction and validation approach, and the impact of enhanced specifications on the performance of eight state-of-the-art REST API testing tools. Our results are encouraging and show that NLPtoREST can extract many relevant rules with high accuracy, which can in turn significantly improve testing tools’ performance.
@inproceedings{KimCSOPTC23,
title = {Enhancing REST API Testing with NLP Techniques},
author = {Myeongsoo Kim and Davide Corradini and Saurabh Sinha and Alessandro Orso and Michele Pasqua and Rachel Tzoref-Brill and Mariano Ceccato},
booktitle = {ISSTA},
year = {2023},
doi = {10.1145/3597926.3598131}
}