论文标题

graphQl apis的白色框和黑框绒毛

White-Box and Black-Box Fuzzing for GraphQL APIs

论文作者

Belhadi, Asma, Zhang, Man, Arcuri, Andrea

论文摘要

图形查询语言(GraphQL)是Web服务中API操作的强大语言。最近将其作为解决RESTFUL API的局限性的替代解决方案。本文引入了用于GraphQL API测试的自动解决方案。我们提供了一个自动API测试的完整框架,从架构提取到测试案例生成。此外,我们考虑了两种测试:白色框和黑盒测试。当有GraphQL API的源代码可用时,将执行白色框测试。我们的方法基于进化搜索。测试案例可以智能地探索解决方案空间,同时最大程度地提高代码覆盖范围和故障发现标准。黑框测试不需要访问GraphQL API的源代码。因此,它具有更一般的适用性,尽管性能较差。在这种情况下,我们使用随机搜索生成GraphQl数据。所提出的框架已实施并集成到开源Evomaster工具中。通过启用的白盒启发式方法,即白盒模式,与基线随机搜索相比,在7个开源GraphQl API上进行了实验,对进化方法的统计学显着改善。此外,在31个在线GraphQl API上进行的实验揭示了黑框模式检测实际故障的能力。

The Graph Query Language (GraphQL) is a powerful language for APIs manipulation in web services. It has been recently introduced as an alternative solution for addressing the limitations of RESTful APIs. This paper introduces an automated solution for GraphQL APIs testing. We present a full framework for automated APIs testing, from the schema extraction to test case generation. In addition, we consider two kinds of testing: white-box and black-box testing. The white-box testing is performed when the source code of the GraphQL API is available. Our approach is based on evolutionary search. Test cases are evolved to intelligently explore the solution space while maximizing code coverage and fault-finding criteria. The black-box testing does not require access to the source code of the GraphQL API. It is therefore of more general applicability, albeit it has worse performance. In this context, we use a random search to generate GraphQL data. The proposed framework is implemented and integrated into the open-source EvoMaster tool. With enabled white-box heuristics, i.e., white-box mode, experiments on 7 open-source GraphQL APIs show statistically significant improvement of the evolutionary approach compared to the baseline random search. In addition, experiments on 31 online GraphQL APIs reveal the ability of the black-box mode to detect real faults.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源