SlideShare a Scribd company logo
Automatic Generation of Test Cases for REST
APIs: a Specification-Based Approach
Hamza Ed-douibi, Javier L. Cánovas Izquierdo, Jordi Cabot
unsplash-chuttersnap
flickr/clark-tibbs
Motivation
API-Driven World
API-Driven World
API-Driven World
API-Driven World
API-Driven World
unsplash-rawpixel
Leveraging OpenAPI for testing REST APIs
Leveraging OpenAPI for testing REST APIs
Leveraging OpenAPI for testing REST APIs
OpenAPI Metamodel
OpenAPI Model
Leveraging OpenAPI for testing REST APIs
TestSuite Metamodel
Our Approach
• Straightforward from the OpenAPI Metamodel
• Special attention to JSON references
Model Extraction
Our Approach
• Simple parameter (examples, default values, enums)
• Dummy parameter
• Complex parameter (response of an operation)
Inference rules
Our Approach
Generation Rules
GR 1. Nominal test case GR 2. Faulty test case
Generation Rules
GR 1. Nominal test case GR 2. Faulty test case
Faulty cases
• Required missing
• Wrong datatypes
• Violated constraints
Our Approach
Our Approach
https://github.com/SOM-Research/test-generator
unsplash-Hello I'm Nick
Validation
Validation
RQ1
What is the coverage level of the generated test
cases?
RQ2
What are the main failing points in the definitions
and implementation of real world REST APIs?
Validation
RQ1
What is the coverage level of the generated test
cases?
RQ2
What are the main failing points in the definitions
and implementation of real world REST APIs?
Filtering Criteria A ― Free, open and available APIs which provide access to data models
Validation
RQ1
What is the coverage level of the generated test
cases?
RQ2
What are the main failing points in the definitions
and implementation of real world REST APIs?
Filtering Criteria A ― Free, open and available APIs which provide access to data models
Filtering Criteria B ― Remove incorrect or invalid OpenAPI definitions
Validation
RQ1
What is the coverage level of the generated test
cases?
RQ2
What are the main failing points in the definitions
and implementation of real world REST APIs?
ELEMENTS COUNT
COVERAGE COVERAGE(%)
ALL NOMINAL FAULTY ALL NOMINAL FAULTY
OPERATIONS 367 320 303 233 87% 82% 63%
PARAMETERS 949 595 485 476 62% 51% 50%
ENDPOINTS 356 289 81%
DEFINITIONS 313 239 76%
Validation
RQ1
What is the coverage level of the generated test
cases?
RQ2
What are the main failing points in the definitions
and implementation of real world REST APIs?
ELEMENTS COUNT
COVERAGE COVERAGE(%)
ALL NOMINAL FAULTY ALL NOMINAL FAULTY
OPERATIONS 367 320 303 233 87% 82% 63%
PARAMETERS 949 595 485 476 62% 51% 50%
ENDPOINTS 356 289 81%
DEFINITIONS 313 239 76%
TOTAL
NOMINAL TEST CASES FAULTY TEST CASES
4XX/500 SCHEMA 500 2XX
NUMBER OF APIS 37 9 11 11 20
40% 25% 30% 30% 55%
Conclusion
• Model-driven approach to automate
REST API testing based on Open API
• Plug-in implementing the approach
• Coverage over 75%
What we have shown
What we want to do next
Increase coverage levels
Support for OpenAPI v3.0
unsplash-Vek Labs
Except where otherwise noted, content on this presentation is licensed under a Creative Commons Attribution 4.0 International license.
Thanks!
Javier L. Cánovas Izquierdo
jcanovasi@uoc.edu
@jlcanovas
Hamza Ed-douibi
hed-douibi@uoc.edu
@mazamiz
Jordi Cabot
jordi.cabot@icrea.cat
@softmodeling
https://github.com/SOM-Research/test-generator

More Related Content

PPT
Crowd debugging (FSE 2015)
PPTX
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
PDF
[JS EXPERIENCE 2018] “Who watches the watchmen": Testando nossos testes - Mar...
PDF
The Death of Flaky Tests by Dave Haeffner
PDF
"Быстрое обнаружение вредоносного ПО для Android с помощью машинного обучения...
PPTX
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
PPTX
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)
PDF
MUBench - A Benchmark for API-Misuse Detectors - MSR '16
Crowd debugging (FSE 2015)
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
[JS EXPERIENCE 2018] “Who watches the watchmen": Testando nossos testes - Mar...
The Death of Flaky Tests by Dave Haeffner
"Быстрое обнаружение вредоносного ПО для Android с помощью машинного обучения...
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)
MUBench - A Benchmark for API-Misuse Detectors - MSR '16

What's hot (18)

PPTX
LSRepair: Live Search of Fix Ingredients for Automated Program Repair
PPTX
A Closer Look at Real-World Patches
PDF
VST2022.pdf
PPT
Tech Days 2015: A quick tour of Ada 2012
PDF
150412 38 beamer methods of binary analysis
PPTX
You Cannot Fix What You Cannot Find! --- An Investigation of Fault Localizati...
PDF
Experimental design
PDF
SBLint
PDF
Analyzing the State of Static Analysis: A Large-Scale Evaluation in Open Sour...
PDF
A Survey on Automatic Software Evolution Techniques
PDF
Defect localization
PDF
Unit testing in swift 2 - The before & after story
PDF
Lecture5 2
PDF
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
PPTX
A Conceptual Framework for the Comparison of Fully Automated GUI Testing Tech...
PDF
DataScience Lab 2017_Обзор методов детекции лиц на изображение
PDF
Mining Fix Patterns for FindBugs Violations
PDF
Impact Analysis of Granularity Levels on Feature Location Technique
LSRepair: Live Search of Fix Ingredients for Automated Program Repair
A Closer Look at Real-World Patches
VST2022.pdf
Tech Days 2015: A quick tour of Ada 2012
150412 38 beamer methods of binary analysis
You Cannot Fix What You Cannot Find! --- An Investigation of Fault Localizati...
Experimental design
SBLint
Analyzing the State of Static Analysis: A Large-Scale Evaluation in Open Sour...
A Survey on Automatic Software Evolution Techniques
Defect localization
Unit testing in swift 2 - The before & after story
Lecture5 2
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
A Conceptual Framework for the Comparison of Fully Automated GUI Testing Tech...
DataScience Lab 2017_Обзор методов детекции лиц на изображение
Mining Fix Patterns for FindBugs Violations
Impact Analysis of Granularity Levels on Feature Location Technique
Ad

Similar to Automatic Generation of Test Cases for REST APIs: a Specification-Based Approach (20)

PDF
Effective and Efficient API Misuse Detection via Exception Propagation and Se...
PDF
Clean & Dirty Acceptance Tests with Cucumber & Watir
PDF
To Mock or Not To Mock
PDF
Hands-on Experience Model based testing with spec explorer
PDF
Next-Level API Automation Testing Techniques – Part 2
PDF
SSBSE 2020 keynote
PDF
5 challenges of api testing and how to overcome
PDF
Automated Testing for SQL Injection Vulnerabilities: An Input Mutation Approach
PDF
2020 Testing Trends: Top Predictions for QA Teams to Watch, Join, and Lead
PPTX
AVATAR : Fixing Semantic Bugs with Fix Patterns of Static Analysis Violations
PPT
Dill may-2008
PDF
High-throughput and Automated Process Development for Accelerated Biotherapeu...
PPT
Orthogonal array approach a case study
PDF
AQA_You are_Soaking_In_It_DevNexus2020
PPTX
B4USolution_API-Testing
PDF
An exploratory study of the state of practice of performance testing in Java-...
PPTX
Model-driven Round-trip Engineering of REST APIs
PPT
Robustness testing
PDF
Manual Testing Syllabus By KRN Informatix
PDF
Zen and the Art of REST API documentation - MuCon London 2015
Effective and Efficient API Misuse Detection via Exception Propagation and Se...
Clean & Dirty Acceptance Tests with Cucumber & Watir
To Mock or Not To Mock
Hands-on Experience Model based testing with spec explorer
Next-Level API Automation Testing Techniques – Part 2
SSBSE 2020 keynote
5 challenges of api testing and how to overcome
Automated Testing for SQL Injection Vulnerabilities: An Input Mutation Approach
2020 Testing Trends: Top Predictions for QA Teams to Watch, Join, and Lead
AVATAR : Fixing Semantic Bugs with Fix Patterns of Static Analysis Violations
Dill may-2008
High-throughput and Automated Process Development for Accelerated Biotherapeu...
Orthogonal array approach a case study
AQA_You are_Soaking_In_It_DevNexus2020
B4USolution_API-Testing
An exploratory study of the state of practice of performance testing in Java-...
Model-driven Round-trip Engineering of REST APIs
Robustness testing
Manual Testing Syllabus By KRN Informatix
Zen and the Art of REST API documentation - MuCon London 2015
Ad

More from Javier Canovas (20)

PDF
On the Analysis of Non-Coding Roles in Open Source Development
PDF
Open Source Software Governance Guide: Developing a Matrix of Leading Questio...
PDF
A Model-based Chatbot Generation Approach to Converse with Open Data Sources
PPTX
Chatbots to Democratize the Access to Information and Internet Services
PPTX
Analysis and Modeling of the Governance in General Programming Languages
PPTX
A UML Profile for Privacy Enforcement
PPTX
The Role of Foundations in Open Source Projects
PPTX
An Empirical Study on the Maturity of the Eclipse Modeling Ecosystem
PPTX
Example-driven Web API Specification Discovery
PPTX
Software Modernization Revisited: Challenges and Prospects
PPTX
Findings from GitHub. Methods, Datasets and Limitations
PPTX
Enabling the Definition and Enforcement of Governance Rules in Open Source Sy...
PPTX
Exploring the Use of Labels to Categorize Issues in Open-Source Software Pro...
PPTX
Composing JSON-based Web APIs
PPTX
Retos Actuales en el Desarrollo de Lenguajes Específicos del Dominio
PPTX
Discovering Implicit Schemas in JSON Data
PPTX
Enabling the Collaborative Definition of DSMLs
PPTX
Domain-Specific Languages
PDF
Modernization in Eclipse
PDF
Software Modernization
On the Analysis of Non-Coding Roles in Open Source Development
Open Source Software Governance Guide: Developing a Matrix of Leading Questio...
A Model-based Chatbot Generation Approach to Converse with Open Data Sources
Chatbots to Democratize the Access to Information and Internet Services
Analysis and Modeling of the Governance in General Programming Languages
A UML Profile for Privacy Enforcement
The Role of Foundations in Open Source Projects
An Empirical Study on the Maturity of the Eclipse Modeling Ecosystem
Example-driven Web API Specification Discovery
Software Modernization Revisited: Challenges and Prospects
Findings from GitHub. Methods, Datasets and Limitations
Enabling the Definition and Enforcement of Governance Rules in Open Source Sy...
Exploring the Use of Labels to Categorize Issues in Open-Source Software Pro...
Composing JSON-based Web APIs
Retos Actuales en el Desarrollo de Lenguajes Específicos del Dominio
Discovering Implicit Schemas in JSON Data
Enabling the Collaborative Definition of DSMLs
Domain-Specific Languages
Modernization in Eclipse
Software Modernization

Recently uploaded (20)

PDF
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
PPT
POSITIONING IN OPERATION THEATRE ROOM.ppt
PDF
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
PPTX
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
PPTX
Comparative Structure of Integument in Vertebrates.pptx
PDF
lecture 2026 of Sjogren's syndrome l .pdf
PPTX
2. Earth - The Living Planet Module 2ELS
PDF
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
PPTX
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
PPTX
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
PPT
protein biochemistry.ppt for university classes
PDF
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
PPTX
2Systematics of Living Organisms t-.pptx
PPTX
Introduction to Fisheries Biotechnology_Lesson 1.pptx
PDF
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
PPTX
2. Earth - The Living Planet earth and life
PPT
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
PPTX
Classification Systems_TAXONOMY_SCIENCE8.pptx
PDF
Phytochemical Investigation of Miliusa longipes.pdf
PPTX
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
POSITIONING IN OPERATION THEATRE ROOM.ppt
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
Comparative Structure of Integument in Vertebrates.pptx
lecture 2026 of Sjogren's syndrome l .pdf
2. Earth - The Living Planet Module 2ELS
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
protein biochemistry.ppt for university classes
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
2Systematics of Living Organisms t-.pptx
Introduction to Fisheries Biotechnology_Lesson 1.pptx
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
2. Earth - The Living Planet earth and life
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
Classification Systems_TAXONOMY_SCIENCE8.pptx
Phytochemical Investigation of Miliusa longipes.pdf
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.

Automatic Generation of Test Cases for REST APIs: a Specification-Based Approach