论文标题
Morest:具有执行反馈的基于模型的RESTFUL API测试
Morest: Model-based RESTful API Testing with Execution Feedback
论文作者
论文摘要
Restful API可以说是访问Web服务的最受欢迎的终点。 BlackBox测试是确保Restful API的可靠性的新兴技术之一。测试RESTFUL API的主要挑战是需要正确的API操作序列进行深入测试。为了构建有意义的操作呼叫序列,研究人员提出了基于OpenAPI规范的API依赖性技术。但是,这些技术要么缺乏对所有API连接方式的总体意识,要么是适应性地固定学习知识的灵活性。在本文中,我们提出了Morest,这是一种基于模型的Restful API测试技术,该技术构建和维护动态更新的Restful-Service属性图(RPG),以建模RESTFULS服务的行为并指导呼叫序列生成。我们对Morest进行了经验评估,结果表明,Morest可以成功要求平均要求152.66%-232.45%的API操作,覆盖26.16%-103.24%的代码行高,并检测40.64%-215.94%的虫子,比较为明确的技术多。总的来说,我们将最敏锐的人应用于6个现实世界项目,发现44个错误(其中13个无法通过现有方法检测到)。具体来说,有2个已确认的错误来自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.