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.
翻译:图表查询语言( Grap Query QL) 是用于网络服务中处理 API 的有力语言。 它最近被作为解决 RESTAL API 限制的替代解决方案被引入。 本文引入了一个用于测试 Greag QL API 的自动解决方案。 我们为自动 API 测试提供了一个完整的框架, 从系统提取到测试案件生成。 此外, 我们考虑两种测试: 白箱和黑盒测试。 当 Graph QL API 源代码出现时, 将进行白箱测试。 我们的方法以进化搜索为基础。 测试案例将演变成智能探索解决方案空间, 同时最大限度地扩大代码覆盖范围和错误调查标准。 黑箱测试不需要访问 GreagQL API 的源代码。 因此, 它具有更普遍的可应用性, 尽管它有更差的性能。 在这方面, 我们使用随机搜索来生成图表 QL 数据。 拟议的框架将实施并整合到开放源 EvoMaster 工具中。 启用白盒 heuristics, 即黑盒、 白箱 白箱 将 空间测试 空间 空间测试工具加 以 ABbregregreforbreforbreal 样的 Astal ASlovelovelalalal 样的ABreal 样的A- 样的 Arbalbalbalbal 样的A- 样的A- 样式搜索 Breabal 样式搜索 样式 样式 样样式的Abrealbreal 。