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

APITestGenie:通过生成式AI实现自动化API测试生成

APITestGenie: Automated API Test Generation through Generative AI

André Pereira, Bruno Lima, João Pascoal Faria

AI总结:

针对Web API测试难题,本文提出APITestGenie,利用LLM依据业务需求和API规范生成可执行测试脚本,并在真实API实验中验证其有效性。

摘要:

由大型语言模型(LLM)驱动的智能助手能够以较高准确率生成程序和测试代码,从而提升开发人员与测试人员的生产力。然而,目前缺乏探索使用LLM测试Web API的研究;Web API是现代软件系统的基本构建块,并带来了重大的测试挑战。因此,本文提出APITestGenie,这是一种利用LLM从业务需求和API规范生成可执行API测试脚本的方法与工具。在针对10个真实API的实验中,该工具在57%的情况下生成了有效测试脚本。通过为每个任务进行三次生成尝试,这一成功率提升至80%。建议在将生成的脚本集成到CI/CD流水线之前进行人工干预,以验证或完善脚本,这使我们的工具定位为生产力助手,而非测试人员的替代品。行业专家的反馈表明,他们对采用该工具改进API测试流程具有浓厚兴趣。

英文摘要:

Intelligent assistants powered by Large Language Models (LLMs) can generate program and test code with high accuracy, boosting developers' and testers' productivity. However, there is a lack of studies exploring LLMs for testing Web APIs, which constitute fundamental building blocks of modern software systems and pose significant test challenges. Hence, in this article, we introduce APITestGenie, an approach and tool that leverages LLMs to generate executable API test scripts from business requirements and API specifications. In experiments with 10 real-world APIs, the tool generated valid test scripts 57% of the time. With three generation attempts per task, this success rate increased to 80%. Human intervention is recommended to validate or refine generated scripts before integration into CI/CD pipelines, positioning our tool as a productivity assistant rather than a replacement for testers. Feedback from industry specialists indicated a strong interest in adopting our tool for improving the API test process.

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

↑