当前位置: X-MOL 学术Empir. Software Eng. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Resource and dependency based test case generation for RESTful Web services
Empirical Software Engineering ( IF 4.1 ) Pub Date : 2021-06-02 , DOI: 10.1007/s10664-020-09937-1
Man Zhang , Bogdan Marculescu , Andrea Arcuri

Nowadays, RESTful web services are widely used for building enterprise applications. REST is not a protocol, but rather it defines a set of guidelines on how to design APIs to access and manipulate resources using HTTP over a network. In this paper, we propose an enhanced search-based method for automated system test generation for RESTful web services, by exploiting domain knowledge on the handling of HTTP resources. The proposed techniques use domain knowledge specific to RESTful web services and a set of effective templates to structure test actions (i.e., ordered sequences of HTTP calls) within an individual in the evolutionary search. The action templates are developed based on the semantics of HTTP methods and are used to manipulate the web services’ resources. In addition, we propose five novel sampling strategies with four sampling methods (i.e., resource-based sampling) for the test cases that can use one or more of these templates. The strategies are further supported with a set of new, specialized mutation operators (i.e., resource-based mutation) in the evolutionary search that take into account the use of these resources in the generated test cases. Moreover, we propose a novel dependency handling to detect possible dependencies among the resources in the tested applications. The resource-based sampling and mutations are then enhanced by exploiting the information of these detected dependencies. To evaluate our approach, we implemented it as an extension to the EvoMaster tool, and conducted an empirical study with two selected baselines on 7 open-source and 12 synthetic RESTful web services. Results show that our novel resource-based approach with dependency handling obtains a significant improvement in performance over the baselines, e.g., up to + 130.7% relative improvement (growing from + 27.9% to + 64.3%) on line coverage.



中文翻译:

为 RESTful Web 服务生成基于资源和依赖关系的测试用例

如今,RESTful Web 服务被广泛用于构建企业应用程序。REST 不是一个协议,而是定义了一套指导方针,指导如何设计 API 以通过网络使用 HTTP 访问和操作资源。在本文中,我们通过利用处理 HTTP 资源的领域知识,提出了一种增强的基于搜索的方法,用于为 RESTful Web 服务自动生成系统测试。所提出的技术使用特定于 RESTful Web 服务的领域知识和一组有效的模板来构建进化搜索中个体内部的测试操作(即 HTTP 调用的有序序列)。动作模板是基于 HTTP 方法的语义开发的,用于操作 Web 服务的资源。此外,对于可以使用这些模板中的一个或多个的测试用例,我们提出了五种新颖的抽样策略和四种抽样方法(即基于资源的抽样)。在考虑到这些资源在生成的测试用例中的使用的进化搜索中,这些策略得到了一组新的、专门的变异算子(即,基于资源的变异)的支持。此外,我们提出了一种新颖的依赖处理来检测被测试应用程序中资源之间可能的依赖关系。然后通过利用这些检测到的依赖项的信息来增强基于资源的采样和突变。为了评估我们的方法,我们将其作为对 进化搜索中的专门变异算子(即,基于资源的变异)考虑到这些资源在生成的测试用例中的使用。此外,我们提出了一种新颖的依赖处理来检测被测试应用程序中资源之间可能的依赖关系。然后通过利用这些检测到的依赖项的信息来增强基于资源的采样和突变。为了评估我们的方法,我们将其作为对 进化搜索中的专门变异算子(即,基于资源的变异)考虑到这些资源在生成的测试用例中的使用。此外,我们提出了一种新颖的依赖处理来检测被测试应用程序中资源之间可能的依赖关系。然后通过利用这些检测到的依赖项的信息来增强基于资源的采样和突变。为了评估我们的方法,我们将其作为对 然后通过利用这些检测到的依赖关系的信息来增强基于资源的采样和突变。为了评估我们的方法,我们将其作为对 然后通过利用这些检测到的依赖项的信息来增强基于资源的采样和突变。为了评估我们的方法,我们将其作为对EvoMaster工具,并使用两个选定的基线对 7 个开源和 12 个合成 RESTful Web 服务进行了实证研究。结果表明,我们新的基于资源的依赖处理方法在性能上比基线获得了显着的改进,例如,在线覆盖率的相对改进高达 + 130.7%(从 + 27.9% 增长到 + 64.3%)。

更新日期:2021-06-02
down
wechat
bug