Article
Metamorphic Testing of RESTful Web APIs
Author/s | Segura Rueda, Sergio
Parejo Maestre, José Antonio Troya Castilla, Javier Ruiz Cortés, Antonio |
Department | Universidad de Sevilla. Departamento de Lenguajes y Sistemas Informáticos |
Publication Date | 2017 |
Deposit Date | 2018-04-25 |
Published in |
|
Abstract | 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 ... 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. |
Funding agencies | Comisión Interministerial de Ciencia y Tecnología (CICYT). España Junta de Andalucía |
Project ID. | TIN2015-70560-R
P12-TIC-1867 |
Citation | Segura Rueda, S., Parejo Maestre, J.A., Troya Castilla, J. y Ruiz Cortés, A. (2017). Metamorphic Testing of RESTful Web APIs. IEEE Transactions on Software Engineering, October 2017 |
Files | Size | Format | View | Description |
---|---|---|---|---|
TSE2017_REST_prePrint.pdf | 2.834Mb | [PDF] | View/ | |