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

被引:26
作者
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
相关论文
共 48 条
[21]   CovDroid: A Black-Box Testing Coverage System for Android [J].
Yeh, Chao-Chun ;
Huang, Shih-Kun .
IEEE 39TH ANNUAL COMPUTER SOFTWARE AND APPLICATIONS CONFERENCE WORKSHOPS (COMPSAC 2015), VOL 3, 2015, :447-452
[22]   A Comparative Study on Black-Box Testing with Open Source Applications [J].
Xu, Shaochun ;
Chen, Lichao ;
Wang, Chunning ;
Rud, Oleksandr .
2016 17TH IEEE/ACIS INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ARTIFICIAL INTELLIGENCE, NETWORKING AND PARALLEL/DISTRIBUTED COMPUTING (SNPD), 2016, :527-532
[23]   BET: Black-Box Efficient Testing for Convolutional Neural Networks [J].
Wang, Jialai ;
Qiu, Han ;
Rong, Yi ;
Ye, Hengkai ;
Li, Qi ;
Li, Zongpeng ;
Zhang, Chao .
PROCEEDINGS OF THE 31ST ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2022, 2022, :164-175
[24]   Applying black-box testing to UML/OCL database models [J].
Harith Aljumaily ;
Dolores Cuadra ;
Paloma Martínez .
Software Quality Journal, 2014, 22 :153-184
[25]   Applying black-box testing to UML/OCL database models [J].
Aljumaily, Harith ;
Cuadra, Dolores ;
Martinez, Paloma .
SOFTWARE QUALITY JOURNAL, 2014, 22 (02) :153-184
[26]   Robotic Testing of Mobile Apps for Truly Black-Box Automation [J].
Mao, Ke ;
Harman, Mark ;
Jia, Yue .
IEEE SOFTWARE, 2017, 34 (02) :11-16
[27]   Application of black-box testing technologies to command and control subsystem software testing [J].
Zhang, Min ;
Zhao, Ping ;
Zhang, Rong .
Qiangjiguang Yu Lizishu/High Power Laser and Particle Beams, 2013, 25 (SUPPL.1) :87-90
[28]   An algorithm for detecting SQL injection vulnerability using black-box testing [J].
Aliero, Muhammad Saidu ;
Ghani, Imran ;
Qureshi, Kashif Naseer ;
Rohani, Mohd Fo'ad .
JOURNAL OF AMBIENT INTELLIGENCE AND HUMANIZED COMPUTING, 2020, 11 (01) :249-266
[29]   A TEST CASE GENERATION METHOD FOR BLACK-BOX TESTING OF CONCURRENT PROGRAMS [J].
ARAKAWA, N ;
SONEOKA, T .
IEICE TRANSACTIONS ON COMMUNICATIONS, 1992, E75B (10) :1081-1089
[30]   Equivalence, identity, and unitarity checking in black-box testing of quantum programs [J].
Long, Peixun ;
Zhao, Jianjun .
JOURNAL OF SYSTEMS AND SOFTWARE, 2024, 211