arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.00894cs.SE
收藏

利用大语言模型改进REST API测试

Leveraging Large Language Models to Improve REST API Testing

Myeongsoo Kim, Tyler Stennett, Dhruv Shah, Saurabh Sinha, Alessandro Orso

AI总结:

针对现有REST API测试工具忽略规范中非结构化自然语言描述导致测试覆盖不足的问题,提出RESTGPT方法,利用大语言模型提取规则、生成参数值以增强规范,在规则提取和值生成上均优于现有技术。

摘要:

REST API的广泛应用,加之其复杂性和规模不断增长,催生了对自动化REST API测试工具的需求。现有工具聚焦于REST API规范中的结构化数据,却往往忽略了规范中非结构化自然语言描述所蕴含的宝贵洞见,导致测试覆盖率欠佳。为弥补这一差距,近期研究人员开发了从这些人类可读描述中提取规则、并查询知识库以生成有效输入值的技术,但这类技术可提取的规则类型有限,且容易产生不准确结果。本文提出RESTGPT,这是一种创新方法,借助大语言模型(LLMs)的强大能力与内在上下文感知能力改进REST API测试。RESTGPT以API规范为输入,提取机器可解释的规则,并根据规范中的自然语言描述生成示例参数值,再用这些规则和值增强原始规范。我们的评估表明,RESTGPT在规则提取和值生成两方面均优于现有技术。基于这些可观结果,我们概述了通过大语言模型推进REST API测试的未来研究方向。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑