Resource and dependency based test case generation for RESTful Web services

被引:0
作者
Man Zhang
Bogdan Marculescu
Andrea Arcuri
机构
[1] Kristiania University College,
[2] Oslo Metropolitan University,undefined
来源
Empirical Software Engineering | 2021年 / 26卷
关键词
Search-based software testing; RESTful APIs; Web services; Test case generation;
D O I
暂无
中图分类号
学科分类号
摘要
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.
引用
收藏
相关论文
共 25 条
[1]  
Ali S(2010)A systematic review of the application and empirical investigation of search-based test-case generation IEEE Trans Softw Eng (TSE) 36 742-762
[2]  
Briand L(2006)Search-based software test data generation for string data using program-specific search operators Softw Test Verification Reliab 16 175-203
[3]  
Hemmati H(2018)Test suite generation with the Many Independent Objective (MIO) algorithm Inform Softw Technol (IST) 104 195-206
[4]  
Panesar-Walawege R(2019)Restful api automated test case generation with evomaster ACM Trans Softw Eng Methodol (TOSEM) 28 3-250
[5]  
Alshraideh M(2014)A hitchhiker’s guide to statistical tests for assessing randomized algorithms in software engineering Softw Testing Verif Reliab (STVR) 24 219-31
[6]  
Bottaci L(2020)Handling sql databases in automated system test generation ACM Trans Softw Eng Methodol (TOSEM) 29 1-313
[7]  
Arcuri A(2013)Testing and verification in service-oriented architecture: a survey Softw Test Verif Reliab (STVR) 23 261-37
[8]  
Arcuri A(2012)Search-based software engineering: trends, techniques and applications ACM Comput Surv (CSUR) 45 11-893
[9]  
Arcuri A(1998)Algorithms for bigram and trigram word clustering Speech Commun 24 19-undefined
[10]  
Briand L(2017)A detailed investigation of the effectiveness of whole test suite generation Empir Softw Eng (EMSE) 22 852-undefined