[Paper Review] Morest: Model-based RESTful API Testing with Execution Feedback
Morest is a model-based blackbox testing technique for RESTful APIs that constructs and dynamically updates a RESTful-service Property Graph (RPG) to guide test generation. By integrating execution feedback into the RPG, Morest improves call sequence generation, achieving 152.66%-232.45% more API operations, 26.16%-103.24% higher code coverage, and 40.64%-215.94% more bug detection than state-of-the-art approaches.
RESTful APIs are arguably the most popular endpoints for accessing Web services. Blackbox testing is one of the emerging techniques for ensuring the reliability of RESTful APIs. The major challenge in testing RESTful APIs is the need for correct sequences of API operation calls for in-depth testing. To build meaningful operation call sequences, researchers have proposed techniques to learn and utilize the API dependencies based on OpenAPI specifications. However, these techniques either lack the overall awareness of how all the APIs are connected or the flexibility of adaptively fixing the learned knowledge. In this paper, we propose Morest, a model-based RESTful API testing technique that builds and maintains a dynamically updating RESTful-service Property Graph (RPG) to model the behaviors of RESTful-services and guide the call sequence generation. We empirically evaluated Morest and the results demonstrate that Morest can successfully request an average of 152.66%-232.45% more API operations, cover 26.16%-103.24% more lines of code, and detect 40.64%-215.94% more bugs than state-of-the-art techniques. In total, we applied Morest to 6 real-world projects and found 44 bugs (13 of them cannot be detected by existing approaches). Specifically, 2 of the confirmed bugs are from Bitbucket, a famous code management service with more than 6 million users.
Motivation & Objective
- To address the challenge of generating correct, meaningful sequences of API calls in blackbox testing of RESTful services.
- To overcome limitations of existing approaches—such as lack of global dependency awareness (Restler) or overreliance on static specifications (Resttestgen)—by enabling dynamic model refinement.
- To improve test effectiveness by combining high-level guidance from a model with adaptive feedback from actual API executions.
- To enable more comprehensive code coverage and higher bug detection rates in real-world RESTful services.
- To support practical, scalable testing of production-grade web services without requiring source code or instrumentation.
Proposed method
- Morest constructs a RESTful-service Property Graph (RPG) from OpenAPI specifications, encoding both schema and operation-level dependencies.
- The RPG models API operations as nodes and their dependencies (e.g., producer-consumer) as edges, enabling structured call sequence generation.
- Morest uses graph traversal over the RPG to generate valid, semantically correct API call sequences.
- Execution feedback from actual API calls is used to dynamically refine and update the RPG during testing, correcting inaccuracies from incomplete or incorrect specifications.
- The technique integrates feedback to prioritize and adapt test generation, improving coverage and fault detection over time.
- Morest combines model-based guidance with feedback-driven adaptation, offering a balance between top-down structure and bottom-up flexibility.
Experimental results
Research questions
- RQ1Can a dynamically updated model improve the effectiveness of blackbox RESTful API testing compared to static or purely heuristic approaches?
- RQ2To what extent can execution feedback refine the model to correct for inaccuracies in OpenAPI specifications?
- RQ3How does Morest’s approach compare to state-of-the-art techniques in terms of API operation coverage and fault detection?
- RQ4Can Morest detect bugs that existing tools miss, especially in real-world production services?
- RQ5Does the integration of feedback into a property graph model lead to more efficient and effective test generation?
Key findings
- Morest achieved an average of 152.66% to 232.45% more API operation calls compared to state-of-the-art techniques.
- It achieved 26.16% to 103.24% higher code coverage than existing methods across evaluated services.
- Morest detected 40.64% to 215.94% more bugs than baseline tools, including 13 previously undetected bugs.
- In total, 44 bugs were discovered across 6 real-world projects, including 2 confirmed critical bugs in Bitbucket, a widely used code management service.
- The dynamic feedback mechanism significantly improved model accuracy and test effectiveness, especially in services with poorly written OpenAPI specifications.
- Morest outperformed both Restler (bottom-up) and Resttestgen (top-down) by combining high-level guidance with adaptive learning from execution results.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.