arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2407.10227cs.SE
收藏

KAT:基于大语言模型的依赖感知自动化API测试

KAT: Dependency-aware Automated API Testing with Large Language Models

Tri Le, Thien Tran, Duy Cao, Vy Le, Tien Nguyen, Vu Nguyen

AI总结:

针对传统API测试工具处理依赖关系的局限性,研究提出AI驱动的KAT方法,结合GPT与提示技术自主生成RESTful API测试相关内容,经12个真实服务验证,在覆盖率、缺陷检测和误报率上均优于现有先进工具。

摘要:

API测试对软件公司的需求日益增长。以往的API测试工具能够识别操作与参数之间需要保持简洁的特定类型依赖关系,但由于这些依赖的复杂性,其大多采用人工实现或基于启发式算法的方法存在局限性。本文提出KAT(Katalon API Testing),这是一种新颖的AI驱动方法,结合大语言模型GPT与先进的提示工程技术,可自主生成测试用例以验证RESTful API。我们的综合策略涵盖多项流程:从OpenAPI规范构建操作依赖图,以及生成测试脚本、约束验证脚本、测试用例和测试数据。我们使用12个真实世界RESTful服务对KAT进行评估,结果显示,与最先进的自动测试生成工具相比,它能够提升测试覆盖率,检测到更多未记录的状态码,并降低这些服务中的误报率。这些结果表明,将大语言模型用于生成API测试的测试脚本与数据具备有效性。

英文摘要:

API testing has increasing demands for software companies. Prior API testing tools were aware of certain types of dependencies that needed to be concise between operations and parameters. However, their approaches, which are mostly done manually or using heuristic-based algorithms, have limitations due to the complexity of these dependencies. In this paper, we present KAT (Katalon API Testing), a novel AI-driven approach that leverages the large language model GPT in conjunction with advanced prompting techniques to autonomously generate test cases to validate RESTful APIs. Our comprehensive strategy encompasses various processes to construct an operation dependency graph from an OpenAPI specification and to generate test scripts, constraint validation scripts, test cases, and test data. Our evaluation of KAT using 12 real-world RESTful services shows that it can improve test coverage, detect more undocumented status codes, and reduce false positives in these services in comparison with a state-of-the-art automated test generation tool. These results indicate the effectiveness of using the large language model for generating test scripts and data for API testing.

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

↑