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 testing 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 can 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 preliminary evaluation suggests that RESTGPT outperforms existing techniques in both rule extraction and value generation. Given these encouraging results, we outline future research directions for leveraging LLMs more broadly for improving REST API testing.
翻译:REST API 的广泛采用,加上其日益增长的复杂性和规模,催生了对自动化 REST API 测试工具的需求。当前的测试工具关注于 REST API 规范中的结构化数据,但常常忽略了规范中非结构化自然语言描述所提供的宝贵信息,导致测试覆盖率欠佳。近年来,为弥补这一不足,研究人员开发了从这些人类可读描述中提取规则并查询知识库以获取有意义的输入值的技术。然而,这些技术在可提取的规则类型上存在局限性,并且可能产生不准确的结果。本文提出 RESTGPT,一种利用大型语言模型 (LLM) 的强大能力与内在上下文感知性来改进 REST API 测试的创新方法。RESTGPT 以 API 规范为输入,提取机器可解释的规则,并从规范中的自然语言描述生成示例参数值。然后,它使用这些规则和值来增强原始规范。我们的初步评估表明,RESTGPT 在规则提取和值生成方面均优于现有技术。鉴于这些令人鼓舞的结果,我们概述了未来研究方向,即更广泛地利用 LLM 来改进 REST API 测试。