This document discusses API testing and tools for API test automation. It begins with an overview of APIs and their history, then defines API testing and discusses considerations for API testing today and in the future. Top concerns for API testing are listed as functionality, performance, security, and availability. RESTful web services and their use of HTTP requests and JSON format are covered. Finally, the document introduces Postman, SoapUI, and Robot Framework as examples of tools for API test automation and provides brief descriptions of each tool.
API History 1960s APIsused as libraries in the first operating systems 1970s Distributed Systems - remote access to APIs 1990s Message Oriented Middleware Service Oriented Architecture SOAP – Simple Object Access Protocol 2000s REST – Representational state transfer or RESTful 2010s MicroServices 4
5.
API Testing “A setof subroutine definitions, protocols, and tools for building application software. In general terms, it is a set of clearly defined methods of communication between various software components.” 5 ISTQB Glossary http://glossary.istqb.org/search/API%20Testing
6.
API Testing “Testing performedby submitting commands to the software under test using programming interfaces of the application directly.” 6 ISTQB Glossary http://glossary.istqb.org/search/API%20Testing
7.
API Testing …today! “The majority of testers are responsible for both API and UI Testing” 7 The State of Testing 2017 - SmartBear https://smartbear.com/resources/ebooks/the-state-of-testing-2017-industry-report/
8.
API Testing …tomorrow? Agility DevOps practices Continuous Delivery > Continuous Deployment Continuous Automated Testing Test Automation and Shift left Microservices Architecture migrations Internet Of Things Exponential growth of available APIs! 8
9.
API Testing …top concerns? 1. Functionality Is my API returning the correct response every time 2. Performance How the API responds under different load conditions 3. Security Is it safe from hackers and attacks 4. Availability Is always available to the users 9 The State of Testing 2017 - SmartBear https://smartbear.com/resources/ebooks/the-state-of-testing-2017-industry-report/
RESTful Web Services ApplicationProgram Interface (API) Uses HTTP requests (POST, GET, PUT and DELETE) Based on representational state transfer technology No state is retained between calls (call are stateless) Lighter than the more robust SOAP JSON vs XML 11
12.
RESTful Web Services- Constraints 1. Decouples consumers from producers 2. Stateless existence 3. Able to leverage a cache 4. Leverages a layered system 5. Leverages a uniform interface 12
13.
RESTful Web Services- IoT JSON great for data interchange: Schemaless (valid if is well-formed) Minimal set of data types Human-readable Easily parseable Parsers are widely available in different languages … but… 13
14.
RESTful Web Services- IoT IoT devices typically need to optimize: Network traffic (small and fast) Amount of computation Memory, storage and power consumption REST vs optimized IoT protocols… Solution? IoT hubs that act as man-in-the-middle 14
#2 In our days, it’s almost impossible to find a modern application that doesn’t provide or consumes an API in the form of a web service. With SOA or microservices, between layers or between server and client, internal or external services, SOAP or REST, IoT or web apps, no matter what, web service APIs are everywhere. Designed to allow a programmatic interaction between systems, APIs also need to be tested, and they are one of the first and natural candidates for test automation. In this workshop, we will go through 3 different tools to demonstrate how to do API Test Automation applying also different testing techniques (like Data-Driven Testing, Keyword-Driven Testing or Behaviour-Driven Testing).