What comes to mind when thinking of automation? Robots making robots, large factories producing products, vehicles driving themselves, or maybe some other thing far into the future? Well, automation is already far more than this.

Automation means that we are making some sort of machine do the work with minimal human assistance. The most common example of automation that might come to the mind of most people would be that of a factory. Where a number of machines are working in a synchronous fashion with a great number of conveyor belts going all around the facility.

Image for post

This image has led many people to believe that soon all factories will be run like this. However, automation is far broader than this narrow vision. The most important automation is happening all day in our lives and we don’t even pay much attention to it.

What Is API and Why Do We Even Need It?

Let us take an example of a social media application. You might have seen the name of places in social media posts. When we click on them, they will take us to a map that will point us to a particular place. Now the social media company may have a map service of its own. However, more often than not, it will be using a third-party map service.

This third-party map service may be providing services to many other applications. If it allows all the applications to use its original database, it might lead to the corruption of data at the very least. And complete destruction of data (along with some hefty lawsuits) at worst. Hence, to allow any app to use its database without any restrictions is a very bad and impractical approach.

Nor is it possible for this service provider to send a copy of data to all the applications, since every app may need only a very small subset of the data. Also, the data has to be updated as soon as possible. Then there is the problem of astronomical bandwidths required to send so much data regularly.

How can we overcome these issues so that the map service can send the data to the social media application?

How about — The map service provides a set of functions, tools, and rules for communication with proper documentation to the social media app. Using these services the social media app can get the data it needs without endangering the security of the map service provider (Of course some authentication system must be required).

This _package of functions, tools, and rules is called an _API or Application Programming Interface since it provides an interface to interact applications.

Image for post
I like to think of an API as a set of buttons on a complex machine (let us say a computer with a keyboard :) ). You may want this machine to do something for you. What you have to do is to use those buttons to direct it to do your work.

For example, let the machine contain a database of maps. Now we might ask the machine to provide us the information about a particular coordinate and it would slip out the information, without us bothering much about its inner workings or what other data it has. This is a relatively secure way to communicate with the machine.

Apart from providing the above advantages and services, an API is usually cross-platform and is available to be used with a number of programming languages. This is important since more than one application might request data from one service.

For example, let us consider our map service again. Let us say another application wants to use its data. However, this application uses a different language and platform than our social media app. How might it use the data from the map service provider?

Here again, an API comes in. An API should be able to work with multiple languages and platforms hence it should help overcome this issue.

#api-testing #web-development #software-development #automation #testing

Diving Into Automated API Tests
1.15 GEEK