Skip to main content

What is API testing?


Today let’s talk about what is API testing, and what exactly do we test when we perform API testing?
To start from the very beginning lets understand what API is.

 What Is API?

API – Application Programming Interface.
This is a functional piece of a system that sits usually between a data source and a front end presentation to the user. In other words if we take a simple example of a web application the nice looking web site will be using API calls to retrieve data from the back-end database.
It is important to understand that API can mean different things in different systems, for example for web application an API can be a SOAP or a REST web service, but for a desktop application API can be a set of known functions that allow retrieve or modify data within that application.

 What Do We Test With API?

When we talk about API testing we talk about testing some specific functionality that is described in the requirements for that API, and our verification points might change drastically based on what required, but we can group our verifications for all APIs into 3 main categories:

  •         Verify that the expected data is received in response
  •         Verify that the expected action was performed
  •         Verify that additional APIs functions were triggered (nothing was performed yet but a job might have started to execute action in a future)
At this point we usually differentiate between a specific API testing and an End-To-End API testing.  
During the specific API testing we make sure that the API can be called in every possible way and that the proper results are being received or if not then a proper error is returned. For example if we have an API that return weather information for a specific city we will try if it can give information for several cities at once, no city at all, and a city that does not exist in addition to a proper city name.
During the End-to-End API testing we verify that a proper series of calls is trigged by calling some entry point API, so for example if we have online registration form submitted that should generate a temporary password and email that to customer, we will call a form submission API, that in turn expected to call a password generation API and both results will be passed over to an email generating API  

 What Tools We Use?

There is a lot of popular tools that are being used to test different types of APIs but this is beyond the scope of this article. What is important to mention at this point is the fact that we cannot test APIs without a proper tools or an environment setup. In difference to a GUI testing this type of testing requires a setup of a tool and an environment to access the component that is under test as direct access without special coding and tools is usually not possible


Comments

Popular posts from this blog

Proper QA estimation in Agile project

  Today, I want to chat about a common issue in Agile development – story point estimation. You see, it's easy to get caught up in estimating how long a feature will take to develop and forget about the crucial Quality Assurance (QA) effort.  It happens to often: your team is in the middle of sprint planning. New user stories are being discussed, and estimations are given, but there's a catch. You've estimated the development time perfectly, but you've barely even glanced at how much effort QA will take. Why? Agile talks about Development Team and you mistakenly thought that it is all about DEVELOPMENT. Sound familiar? Trust me; it's a more common scenario than you might think. So, what's the big deal? Well, when you leave QA effort out of the equation, several not-so-great things can happen: Vilocity can suffer: You might think you can squeeze more into a sprint than is humanly possible, setting your team up for disappointment and overcommitment. Quality can de

Performance testing vs Load testing vs Stress testing

Today I want to discuss a popular topic regarding a difference between Load and Performance testing. Those two types of testing are commonly used together but there are several key differences between the two. To get a better understanding of the topic lets have a real life example from one of my clients and use it to explain the difference. I have worked for a client that was building an in-house web application that provides its customers with an option to select and order different products and services. The request was, before the up-coming release, to test the performance of their product. We started the task by trying and understand what they expect from performance point of view and then went through an exercise of defining what is captured by what test. The client said that they are looking to have about 900-1300 active users on the site at a given moment, and the expected response time (for a page to load) should be less than 5 seconds. With those details what are the t

What is the velocity of an Agile scrum methodology?

Let's discuss some of the important measurements in Agile, and that is the Velocity of the Scrum team work. Based on Wikipedia definition Velocity is " ...the rate of change of its position with respect to a frame of reference and is a function of time...", which when transferred to the scrum world can be summarized as: The amount of work that the scrum team completed in a single measure of time - in a sprint. How we Calculate Velocity? Velocity is actually a very simple to calculate, it is done but totaling the number of story points of fully completed user stories from the sprint backlog. So if a current sprint included 4 user stories: 2 with 8 story points each, one with 3 story points and one with 32 story points. and by the end of the sprint the 32 one was not fully done the velocity calculation will be: 8+8+3=19 Note: the 32 story points are not part of the velocity calculation as this user story was not completed. What Velocity is used for? The v