Test coverage is a standard measure used to evaluate the completeness of a test suite. Coverage is typically computed on source code, by assessing the extent of source code entities (e.g., statements, data dependencies, control dependencies) that are exercised when running test cases. When considering REST APIs, an alternative perspective to assess test suite completeness is with respect to the service definition. This paper presents Restats, a test coverage tool for REST APIs that supports eight state-of-the-art test coverage metrics with a black-box perspective, i.e., only relying on the OpenAPI interface specification of the REST API under test. In fact, metrics are computed by only observing the HTTP requests and responses occurring at testing time, and no access to source/compiled code of the REST API is required. These coverage metrics come in handy for: (i) developers and test engineers working at development and maintenance tasks; (ii) stakeholders and customers who want to evaluate the completeness of acceptance tests; (iii) researches interested in comparing different automated test case generation strategies.
翻译:测试范围是用来评价测试套件完整性的标准措施。通常根据源码计算覆盖范围,方法是评估运行测试案件时使用的源代码实体的范围(例如报表、数据依赖性、控制依赖性)。在审议REST API时,评估测试套件完整性的另一种观点是服务定义。本文介绍了Restats,这是REST API的测试范围工具,它支持8个最先进的测试范围指标,带有黑盒视角,即仅依靠测试中的REST API的开放API接口规格。事实上,衡量尺度的计算方法只是观察HTTP的要求和测试时间里发生的响应,而不需要查阅REST API的源代码/合成代码。这些覆盖范围指标有助于:(一) 从事开发和维护任务的开发者和测试工程师;(二) 想要评价接受测试完整性的利益攸关方和客户;(三) 研究对比较不同自动测试案例生成战略感兴趣的。