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

Morest:基于模型的RESTful API测试与执行反馈

Morest: Model-based RESTful API Testing with Execution Feedback

Yi Liu, Yuekang Li, Gelei Deng, Yang Liu, Ruiyuan Wan, Runchao Wu, Dandan Ji, Shiheng Xu, Minli Bao

摘要:

RESTful API可以说是访问Web服务的最流行的端点。黑盒测试是确保RESTful API可靠性的新兴技术之一。测试RESTful API的主要挑战是需要正确的API操作调用序列以进行深入测试。为了构建有意义的操作调用序列,研究人员提出了基于OpenAPI规范学习和利用API依赖关系的技术。然而,这些技术要么缺乏对所有API如何连接的整体意识,要么缺乏自适应地固定学习知识的灵活性。在本文中,我们提出了Morest,一个基于模型的RESTful API测试技术,建立和维护一个动态更新的RESTful-service属性图(RPG)建模的RESTful-service的行为,并指导调用序列生成。我们对Morest进行了经验评估,结果表明,与最先进的技术相比,Morest可以成功请求平均多152.66%-232.45%的API操作,覆盖26.16%-103.24%的代码行,并检测40.64%-215.94%的错误。总的来说,我们将Morest应用于6个真实世界的项目,发现了44个错误(其中13个无法通过现有方法检测到)。具体来说,其中2个已确认的bug来自Bitbucket,这是一个著名的代码管理服务,拥有超过600万用户。

英文摘要:

RESTful APIs are arguably the most popular endpoints for accessing Web services. Blackbox testing is one of the emerging techniques for ensuring the reliability of RESTful APIs. The major challenge in testing RESTful APIs is the need for correct sequences of API operation calls for in-depth testing. To build meaningful operation call sequences, researchers have proposed techniques to learn and utilize the API dependencies based on OpenAPI specifications. However, these techniques either lack the overall awareness of how all the APIs are connected or the flexibility of adaptively fixing the learned knowledge. In this paper, we propose Morest, a model-based RESTful API testing technique that builds and maintains a dynamically updating RESTful-service Property Graph (RPG) to model the behaviors of RESTful-services and guide the call sequence generation. We empirically evaluated Morest and the results demonstrate that Morest can successfully request an average of 152.66%-232.45% more API operations, cover 26.16%-103.24% more lines of code, and detect 40.64%-215.94% more bugs than state-of-the-art techniques. In total, we applied Morest to 6 real-world projects and found 44 bugs (13 of them cannot be detected by existing approaches). Specifically, 2 of the confirmed bugs are from Bitbucket, a famous code management service with more than 6 million users.

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

↑