Metamorphic Testing of RESTful Web APIs

被引:95
|
作者
Segura, Sergio [1 ]
Parejo, Jose A. [1 ]
Troya, Javier [1 ]
Ruiz-Cortes, Antonio [1 ]
机构
[1] Univ Seville, Dept Comp Languages & Syst, Seville 41004, Spain
关键词
Metamorphic testing; REST; RESTful Web services; web API; SERVICES;
D O I
10.1109/TSE.2017.2764464
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Web Application Programming Interfaces (APIs) allow systems to interact with each other over the network. Modern Web APIs often adhere to the REST architectural style, being referred to as RESTful Web APIs. RESTful Web APIs are decomposed into multiple resources (e.g., a video in the YouTube API) that clients can manipulate through HTTP interactions. Testing Web APIs is critical but challenging due to the difficulty to assess the correctness of API responses, i.e., the oracle problem. Metamorphic testing alleviates the oracle problem by exploiting relations (so-called metamorphic relations) among multiple executions of the program under test. In this paper, we present a metamorphic testing approach for the detection of faults in RESTful Web APIs. We first propose six abstract relations that capture the shape of many of the metamorphic relations found in RESTful Web APIs, we call these Metamorphic Relation Output Patterns (MROPs). Each MROP can then be instantiated into one or more concrete metamorphic relations. The approach was evaluated using both automatically seeded and real faults in six subject Web APIs. Among other results, we identified 60 metamorphic relations (instances of the proposed MROPs) in the Web APIs of Spotify and YouTube. Each metamorphic relation was implemented using both random and manual test data, running over 4.7K automated tests. As a result, 11 issues were detected (3 in Spotify and 8 in YouTube), 10 of them confirmed by the API developers or reproduced by other users, supporting the effectiveness of the approach.
引用
收藏
页码:1083 / 1099
页数:17
相关论文
共 50 条
  • [1] Metamorphic Testing of RESTful Web APIs
    Segura, Sergio
    Parejo, Jose A.
    Troya, Javier
    Ruiz-Cortes, Antonio
    [J]. PROCEEDINGS 2018 IEEE/ACM 40TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2018, : 882 - 882
  • [2] Testing of RESTful Web APIs
    Martin-Lopez, Alberto
    Alonso, Juan C.
    [J]. SERVICE-ORIENTED COMPUTING - ICSOC 2022 WORKSHOPS, 2023, 13821 : 411 - 413
  • [3] Combinatorial Testing of RESTful APIs
    Wu, Huayao
    Xu, Lixin
    Niu, Xintao
    Nie, Changhai
    [J]. 2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2022), 2022, : 426 - 437
  • [4] 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
  • [5] Testing RESTful APIs: A Survey
    Golmohammadi, Amid
    Zhang, Man
    Arcuri, Andrea
    [J]. ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2024, 33 (01)
  • [6] A Framework for Semantic Description of RESTful Web APIs
    Salvadori, Ivan
    Siqueira, Frank
    [J]. 2014 IEEE 21ST INTERNATIONAL CONFERENCE ON WEB SERVICES (ICWS 2014), 2014, : 630 - 637
  • [7] A Maturity Model for Semantic RESTful Web APIs
    Salvadori, Ivan
    Siqueira, Frank
    [J]. 2015 IEEE INTERNATIONAL CONFERENCE ON WEB SERVICES (ICWS), 2015, : 703 - 710
  • [8] Test Coverage Criteria for RESTful Web APIs
    Martin-Lopez, Alberto
    Segura, Sergio
    Ruiz-Cortes, Antonio
    [J]. PROCEEDINGS OF THE 10TH ACM SIGSOFT INTERNATIONAL WORKSHOP ON AUTOMATING TEST CASE DESIGN, SELECTION, AND EVALUATION (A-TEST '19), 2019, : 15 - 21
  • [9] 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
  • [10] Online Testing of RESTful APIs: Promises and Challenges
    Martin-Lopez, Alberto
    Segura, Sergio
    Ruiz-Cortes, Antonio
    [J]. PROCEEDINGS OF THE 30TH ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2022, 2022, : 408 - 420