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

被引:22
|
作者
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
相关论文
共 50 条
  • [1] RESTTESTGEN: Automated Black-Box Testing of RESTful APIs
    Viglianisi, Emanuele
    Dallago, Michael
    Ceccato, Mariano
    [J]. 2020 IEEE 13TH INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VALIDATION AND VERIFICATION (ICST 2020), 2020, : 142 - 152
  • [2] RESTest: Automated Black-Box Testing of RESTful Web APIs
    Martin-Lopez, Alberto
    Segura, Sergio
    Ruiz-Cortes, Antonio
    [J]. ISSTA '21: PROCEEDINGS OF THE 30TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, 2021, : 682 - 685
  • [3] RestTestGen: An Extensible Framework for Automated Black-box Testing of RESTful APIs
    Corradini, Davide
    Zampieri, Amedeo
    Pasqua, Michele
    Ceccato, Mariano
    [J]. 2022 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2022), 2022, : 504 - 508
  • [4] Automated Black-box Testing of Mass Assignment Vulnerabilities in RESTful APIs
    Corradini, Davide
    Pasqua, Michele
    Ceccato, Mariano
    [J]. 2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 2553 - 2564
  • [5] RESTest: Black-Box Constraint-Based Testing of RESTful Web APIs
    Martin-Lopez, Alberto
    Segura, Sergio
    Ruiz-Cortes, Antonio
    [J]. SERVICE-ORIENTED COMPUTING (ICSOC 2020), 2020, 12571 : 459 - 475
  • [6] Automated Black- and White-Box Testing of RESTful APIs With EvoMaster
    Arcuri, Andrea
    [J]. IEEE SOFTWARE, 2021, 38 (03) : 72 - 78
  • [7] Empirical Comparison of Black-box Test Case Generation Tools for RESTful APIs
    Corradini, Davide
    Zampieri, Amedeo
    Pasqua, Michele
    Ceccato, Mariano
    [J]. IEEE 21ST INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM 2021), 2021, : 226 - 236
  • [8] foREST: A Tree-based Black-box Fuzzing Approach for RESTful APIs
    Lin, Jiaxian
    Li, Tianyu
    Chen, Yang
    Wei, Guangsheng
    Lin, Jiadong
    Zhang, Sen
    Xu, Hui
    [J]. 2023 IEEE 34TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING, ISSRE, 2023, : 695 - 705
  • [9] Black-Box and White-Box Test Case Generation for RESTful APIs: Enemies or Allies?
    Martin-Lopez, Alberto
    Arcuri, Andrea
    Segura, Sergio
    Ruiz-Cortes, Antonio
    [J]. 2021 IEEE 32ND INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE 2021), 2021, : 231 - 241
  • [10] Generating expected results for automated black-box testing
    Schroeder, PJ
    Faherty, P
    Korel, B
    [J]. ASE 2002: 17TH IEEE INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, 2002, : 139 - 148