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

基于强化学习的多覆盖REST API测试

Reinforcement Learning-Based REST API Testing with Multi-Coverage

Tien-Quang Nguyen, Nghia-Hieu Cong, Ngoc-Minh Quach, Hieu Dinh Vo, Son Nguyen

AI总结:

本文提出基于Q-learning的REST API测试方法MUCOREST,通过最大化代码覆盖率和输出覆盖率提升缺陷发现能力,实验表明其缺陷发现数量比现有方法高11.6%-261.1%,且所需API调用更少。

摘要:

REST(表述性状态传递)API因其简单性、可扩展性以及与Web标准的兼容性,已成为数据通信与交换的重要组成部分。然而,由于操作、参数、输入、依赖关系和调用序列的复杂性,通过严格测试确保REST API的可靠性面临重大挑战。本文提出了MUCOREST,一种新颖的基于强化学习(RL)的API测试方法,利用Q-learning最大化代码覆盖率和输出覆盖率,从而改进缺陷发现。通过聚焦于这些近端目标而非最大化故障这一抽象目标,MUCOREST能够有效发现关键代码区域和多样的API行为。在包含10个服务的基准上的实验结果表明,MUCOREST在发现的API缺陷数量上显著优于最先进的API测试方法,提升幅度为11.6%至261.1%。与其他方法相比,MUCOREST能够以少得多的API调用发现相同数量的缺陷。此外,其他技术发现的缺陷中有12.17%至64.09%也能被MUCOREST发现。

英文摘要:

REST (Representational State Transfer) APIs have become integral for data communication and exchange due to their simplicity, scalability, and compatibility with web standards. However, ensuring REST APIs' reliability through rigorous testing poses significant challenges, given the complexities of operations, parameters, inputs, dependencies, and call sequences. In this paper, we introduce MUCOREST, a novel Reinforcement Learning (RL)-based API testing approach that leverages Q-learning to maximize code coverage and output coverage, thereby improving bug discovery. By focusing on these proximate objectives rather than the abstract goal of maximizing failures, MUCOREST effectively discovers critical code areas and diverse API behaviors. The experimental results on a benchmark of 10 services show that MUCOREST significantly outperforms state-of-the-art API testing approaches by 11.6-261.1% in the number of discovered API bugs. MUCOREST can generate much fewer API calls to discover the same number of bugs compared to the other approaches. Furthermore, 12.17%-64.09% of the bugs discovered by the other techniques can also be found by MUCOREST.

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

↑