AGORA: Automated Generation of Test Oracles for REST APIs

被引:4
|
作者
Alonso, Juan C. [1 ]
Segura, Sergio [1 ]
Ruiz-Cortes, Antonio [1 ]
机构
[1] Univ Seville, SCORE Lab, I3US Inst, Seville, Spain
关键词
REST APIs; test oracle; invariant detection; automated testing;
D O I
10.1145/3597926.3598114
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Test case generation tools for REST APIs have grown in number and complexity in recent years. However, their advanced capabilities for automated input generation contrast with the simplicity of their test oracles, which limit the types of failures they can detect to crashes, regressions, and violations of the API specification or design best practices. In this paper, we present AGORA, an approach for the automated generation of test oracles for REST APIs through the detection of invariants-properties of the output that should always hold. In practice, AGORA aims to learn the expected behavior of an API by analyzing previous API requests and their corresponding responses. For this, we extended the Daikon tool for dynamic detection of likely invariants, including the definition of new types of invariants and the implementation of an instrumenter called Beet. Beet converts any OpenAPI specification and a collection of API requests and responses to a format processable by Daikon. As a result, AGORA currently supports the detection of up to 105 different types of invariants in REST APIs. AGORA achieved a total precision of 81.2% when tested on a dataset of 11 operations from 7 industrial APIs. More importantly, the test oracles generated by AGORA detected 6 out of every 10 errors systematically seeded in the outputs of the APIs under test. Additionally, AGORA revealed 11 bugs in APIs with millions of users: Amadeus, GitHub, Marvel, OMDb and YouTube. Our reports have guided developers in improving their APIs, including bug fixes and documentation updates in GitHub. Since it operates in black-box mode, AGORA can be seamlessly integrated into existing API testing tools.
引用
收藏
页码:1018 / 1030
页数:13
相关论文
共 50 条
  • [1] Automated Generation of Test Oracles for RESTful APIs
    Alonso, Juan C.
    PROCEEDINGS OF THE 30TH ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2022, 2022, : 1808 - 1810
  • [2] Automated Test Generation for REST APIs: No Time to Rest Yet
    Kim, Myeongsoo
    Xin, Qi
    Sinha, Saurabh
    Orso, Alessandro
    PROCEEDINGS OF THE 31ST ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2022, 2022, : 289 - 301
  • [3] On the Faults Found in REST APIs by Automated Test Generation
    Marculescu, Bogdan
    Zhang, Man
    Arcuri, Andrea
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2022, 31 (03)
  • [4] Automated Generation of Realistic Test Inputs for Web APIs
    Alonso, Juan C.
    PROCEEDINGS OF THE 29TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (ESEC/FSE '21), 2021, : 1666 - 1668
  • [5] Automated Test Oracles: A Survey
    Pezze, Mauro
    Zhang, Cheng
    ADVANCES IN COMPUTERS, VOL 95, 2014, 95 : 1 - 48
  • [6] Automated generation of test oracles using a model-driven approach
    Perez Lamancha, Beatriz
    Polo, Macario
    Caivano, Danilo
    Piattini, Mario
    Visaggio, Giuseppe
    INFORMATION AND SOFTWARE TECHNOLOGY, 2013, 55 (02) : 301 - 319
  • [7] Improving Test Case Generation for REST APIs Through Hierarchical Clustering
    Stallenberg, Dimitri
    Olsthoorn, Mitchell
    Panichella, Annibale
    2021 36TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING ASE 2021, 2021, : 117 - 128
  • [8] MockRest-A Generic Approach for Automated Mock Framework for REST APIs Generation
    Soni, Anshu
    Ranga, Virender
    Jadhav, Sandeep
    INVENTIVE COMMUNICATION AND COMPUTATIONAL TECHNOLOGIES, ICICCT 2019, 2020, 89 : 237 - 255
  • [9] ARTE: Automated Generation of Realistic Test Inputs for Web APIs
    Alonso, Juan C.
    Martin-Lopez, Alberto
    Segura, Sergio
    Garcia, Jose Maria
    Ruiz-Cortes, Antonio
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2023, 49 (01) : 348 - 363
  • [10] Automatic Generation of Test Cases for REST APIs: a Specification-Based Approach
    Ed-douibi, Hamza
    Canovas Izquierdo, Javier Luis
    Cabot, Jordi
    2018 IEEE 22ND INTERNATIONAL ENTERPRISE DISTRIBUTED OBJECT COMPUTING CONFERENCE (EDOC 2018), 2018, : 181 - 190