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.
Embedding API Dependency Graph for Neural Code Generation
Shandong Normal University(山东师范大学);The University of Newcastle(纽卡斯尔大学);Big Data Center of Shandong Province(山东省大数据中心);Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);University of Chinese Academy of Sciences(中国科学院大学)
OOPS: Automated generation of REST API specification via LLMs
Beihang University(北京航空航天大学);Sino-German Joint Software Institute, Beihang University(北京航空航天大学中德工程学院);School of Computer Science and Engineering, Beihang University(北京航空航天大学计算机科学与工程学院);School of Cyber Science and Technology, Beihang University(北京航空航天网络空间安全学院);Beijing Key Laboratory of Networking Technology(北京市网络技术重点实验室)
LLM-based Low-Level Integration Test Generation for Java
Lero, the Research Ireland Centre for Software, University of Limerick(利默里克大学 Lero 爱尔兰软件研究中心);University of Ottawa(渥太华大学);the State Key Laboratory of Blockchain and Data Security, Zhejiang University(浙江大学区块链与数据安全国家重点实验室);Software Engineering Application Technology Lab Huawei(华为软件工程应用技术实验室)