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

GraphQL API的白盒和黑盒模糊

White-Box and Black-Box Fuzzing for GraphQL APIs

Asma Belhadi, Man Zhang, Andrea Arcuri

摘要:

图形查询语言(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.

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

↑