Automated black-box testing of nominal and error scenarios in RESTful APIs

被引:30
作者
Corradini, Davide [1 ]
Zampieri, Amedeo [1 ]
Pasqua, Michele [1 ]
Viglianisi, Emanuele [2 ]
Dallago, Michael [3 ]
Ceccato, Mariano [1 ]
机构
[1] Univ Verona, Dept Comp Sci, Verona, Italy
[2] Bruno Kessler Fdn, Secur & Trust Res Unit, Trento, Italy
[3] Univ Trento, Dept Informat Engn & Comp Sci, Trento, Italy
关键词
automatic test case generation; black-box testing; REST APIs; test oracle;
D O I
10.1002/stvr.1808
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
RESTful APIs (or REST APIs for short) represent a mainstream approach to design and develop web APIs using the REpresentational State Transfer architectural style. Black-box testing, which assumes only the access to the system under test with a specific interface, is the only viable option when white-box testing is impracticable. This is the case for REST APIs: their source code is usually not (or just partially) available, or a white-box analysis across many dynamically allocated distributed components (typical of a micro-services architecture) is computationally challenging. This paper presents RestTestGen, a novel black-box approach to automatically generate test cases for REST APIs, based on their interface definition (an OpenAPI specification). Input values and requests are generated for each operation of the API under test with the twofold objective of testing nominal execution scenarios and error scenarios. Two distinct oracles are deployed to detect when test cases reveal implementation defects. While this approach is mainly targeting the research community, it is also of interest to developers because, as a black-box approach, it is universally applicable across different programming languages, or in the case external (compiled only) libraries are used in a REST API. The validation of our approach has been performed on more than 100 of real-world REST APIs, highlighting the effectiveness of the approach in revealing actual faults in already deployed services.
引用
收藏
页数:33
相关论文
共 41 条
[1]  
[Anonymous], 2000, ARCHITECTURAL STYLES
[2]  
[Anonymous], 2004, ACM SIGSOFT Software Engineering Notes, DOI DOI 10.1145/1022494.1022537
[3]   Testability Transformations For Existing APIs [J].
Arcuri, Andrea ;
Galeotti, Juan P. .
2020 IEEE 13TH INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VALIDATION AND VERIFICATION (ICST 2020), 2020, :153-163
[4]   RESTful API Automated Test Case Generation with EvoMaster [J].
Arcuri, Andrea .
ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2019, 28 (01)
[5]   Checking Security Properties of Cloud Service REST APIs [J].
Atlidakis, Vaggelis ;
Godefroid, Patrice ;
Polishchuk, Marina .
2020 IEEE 13TH INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VALIDATION AND VERIFICATION (ICST 2020), 2020, :387-397
[6]   RESTler: Stateful REST API Fuzzing [J].
Atlidakis, Vaggelis ;
Godefroid, Patrice ;
Polishchuk, Marina .
2019 IEEE/ACM 41ST INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2019), 2019, :748-758
[7]  
Bai XY, 2005, SOSE 2005: IEEE INTERNATIONAL WORKSHOP ON SERVICE-ORIENTED SYSTEM ENGINEERING, P207
[8]  
Borvid, HTTPMASTER
[9]  
Bozkurt M., 2011, TR1001 KINGS COLL LO
[10]   Testing services and service-centric systems: Challenges and opportunities [J].
Department of Computer Science, Faculty of Engineering ;
不详 ;
不详 ;
不详 .
IT Prof, 2006, 2 (10-17) :10-17