论文标题

GraphQL API的自动基于属性的测试

Automatic Property-based Testing of GraphQL APIs

论文作者

Karlsson, Stefan, Čaušević, Adnan, Sundmark, Daniel

论文摘要

近年来,GraphQL已成为揭示Web API的流行方式。随着其在行业中的提高,还必须像软件系统的任何部分一样评估GraphQl API的质量,最好以自动化方式进行评估。但是,当前缺乏自动生成测试以锻炼GraphQL API的方法。在本文中,我们提出了一种自动产生GraphQl查询来测试GraphQl API的方法。这是使用基于属性的方法来创建基于正在测试系统的GraphQL架构的生成器来实现的。我们对现实世界软件系统的评估表明,这种方法在寻找真正的错误和高效方面既有效,又可以在几秒钟内涵盖完整的模式。此外,我们评估了播种已知断层时该方法的故障发现能力。在发现域特定行为方面,有73%的种子断层有改进的空间,这是自动测试生成中的常见甲骨文挑战。

In recent years, GraphQL has become a popular way to expose web APIs. With its raise of adoption in industry, the quality of GraphQL APIs must be also assessed, as with any part of a software system, and preferably in an automated manner. However, there is currently a lack of methods to automatically generate tests to exercise GraphQL APIs. In this paper, we propose a method for automatically producing GraphQL queries to test GraphQL APIs. This is achieved using a property-based approach to create a generator for queries based on the GraphQL schema of the system under test. Our evaluation on a real world software system shows that this approach is both effective, in terms of finding real bugs, and efficient, as a complete schema can be covered in seconds. In addition, we evaluate the fault finding capability of the method when seeding known faults. 73% of the seeded faults where found, with room for improvements with regards to domain specific behavior, a common oracle challenge in automatic test generation.

扫码加入交流群

加入微信交流群

微信交流群二维码

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