From the course: API Testing Foundations

Introduction to web services - Postman Tutorial

From the course: API Testing Foundations

Introduction to web services

- [Instructor] APIs rule the internet. Several different companies that help route internet traffic have analyzed the requests that they get. And estimates are that between 60 and 80% of traffic on the internet is from API calls. But where are these calls coming from? And more importantly, as a tester, how do you get involved in analyzing these calls? In order to understand that, let's talk for a minute about web services. You may have heard about web services or service oriented architecture or things like microservices, but what exactly are these things? It can be hard to pin down terms like this, but for the purposes of this course, let's define web services as a function that we can access over the web. Let's look at the implications that this definition has for testing. So to do that, I want to take a step back to something I learned in grade school when the concept of mathematical functions was introduced to me. And don't worry, we're not going to get into deep math here or anything, but we can think about it this way. A function takes in an input, performs an action on the input, and then produces an output. Sticking with the math theme, we'll look at the Math JS service. As it's input, this service takes in API calls that specify a mathematical formula and then it will do the necessary calculations and return the answer back to you. So you can see we've got a formula here. If I click on this, it gives us the answer for that formula. So this API is what allows us to send the inputs to the service. And in this case, the inputs are this mathematical expression. And then the service takes care of figuring out what we want to do, and then it gives us back an answer. To us sending the API calls, the service itself is a black box. We don't know how it's doing its calculation or what language it's using, et cetera. All we do is give it a certain input and it gives us back a response. In this course, we will treat services as black boxes. That means that we'll try to use some black box testing techniques when we're trying to find problems with them. We'll explore what that means and how it works. So there are many different kinds of services on the internet. We've got cloud providers that are made up of different services that you can interact with through APIs. Some services are just small and targeted, so Math JS is an example of this although sometimes services are even smaller than that. Sometimes a service is an entire application and can have lots of different interrelated functionality available. Some services will be internal to your company, they'll belong to your company, and some are external to your company. You'll want to take different testing approaches in these situations, and so we'll dig into some of that as we go through this course. Web services are all around us and APIs are the glue that hold them together. Let's take a look at some of the different kinds of APIs and how we can go about testing them.

Contents