The widespread adoption of REST APIs, coupled with their growing complexity and size, has led to the need for automated REST API testing tools. Current tools focus on the structured data in REST API specifications but often neglect valuable insights available in unstructured natural-language descriptions in the specifications, which leads to suboptimal test coverage. Recently, to address this gap, researchers have developed techniques that extract rules from these human-readable descriptions and query knowledge bases to derive meaningful input values. However, these techniques are limited in the types of rules they can extract and prone to produce inaccurate results. This paper presents RESTGPT, an innovative approach that leverages the power and intrinsic context-awareness of Large Language Models (LLMs) to improve REST API testing. RESTGPT takes as input an API specification, extracts machine-interpretable rules, and generates example parameter values from natural-language descriptions in the specification. It then augments the original specification with these rules and values. Our evaluations indicate that RESTGPT outperforms existing techniques in both rule extraction and value generation. Given these promising results, we outline future research directions for advancing REST API testing through LLMs.
翻译:REST API的广泛采用,加之其日益增长的复杂性和规模,催生了对自动化REST API测试工具的需求。现有工具主要专注于REST API规范中的结构化数据,但往往忽略了规范中非结构化自然语言描述可用且有价值的信息,导致测试覆盖率不尽如人意。为弥补这一不足,研究人员近期开发了从这些人类可读描述中提取规则并查询知识库以生成有意义输入值的技术。然而,这些技术能提取的规则类型有限,且易产生不精确的结果。本文提出RESTGPT——一种利用大语言模型强大能力及其内在语境感知特性来改进REST API测试的创新方法。RESTGPT以API规范为输入,提取机器可解释的规则,并从规范中的自然语言描述生成示例参数值,随后将这些规则与值增强至原始规范中。评估表明,RESTGPT在规则提取和值生成方面均优于现有技术。基于这些前景良好的结果,我们概述了通过LLM推进REST API测试的未来研究方向。