Question

API Testing. Give me some real world examples of these kinds of testing. Tell me the...

API Testing. Give me some real world examples of these kinds of testing. Tell me the intent, the tools used, the reason for the tests and how it was tested

0 0
Add a comment Improve this question Transcribed image text
Answer #1

--> API: An API or Application programming Interface is an interface OR intermediary between two applications to send and receive the data from each other. It is a protocol which can be used to establish communication between client and the server application over the internet. An API can be software application, functions, database etc. The software application can have local API as well as 3rd Party API to perform the certain actions in the application.

Web Applications Backend Systems client Application Programming Interface Server Mobile Applications client 3rd Party systems

--> Real Life Examples: In current internet era, every person is using API directly or indirectly for his day to day work establishment. Consider below some examples:

  1. Google Map Mobile Application: Google map application on the mobile phones is an example of API. Whenever user searches for the nearby restaurant, café, school or any location, the request is sent to Google Map API. The API response with the locations available as per the search criteria. The mobile application displays the same on the screen for the end user.
  2. Weather Forecast: While searching for the weather on specific location, the request is sent to the weather forecast API and result is returned to the client application. The client application puts the result for the user.
  3. Hotel Booking applications: There are few hotel booking applications e.g. Trivago which retrieves the result from different websites of hotels. Whenever user provides the hotel search criteria, the application goes to different available hotel websites which is done by using the API. The API returns the different hotels available on different websites and displays the result to the user.

-->Why the API is used: The API is used to reduce the coding work and use the available package of classes, functions, abstractions, implementations already available on the internet rather than writing the same again and again.

Consider the example of Google Map, if the company is about to create an application which will show the current location of any object on the map. Rather than writing the whole Google Map coding again, it will be advisable to use the existing Google Map API and integrate the same with the software application which is being implemented currently.

-->API Testing: API testing is performed to make sure that the client and server application are interacting correctly with each other. It ensures that the server is providing an expected response for the client’s input.

-->Intention of API Testing: There are certain commands and functions which are used to communicate between the client and server. The API testing includes the testing of each and every command and functions in the application and make sure that the software is working as expected with API integration.

Consider an example of Google, it can have various functions e.g. Search, translate, dates, mails, drives etc. The API testing makes sure that all the functions available in the Google API are working as expected.

An API generally includes the below method to communicate between the server and client:

1. GET: This method is used to get some information from sever using GET function from the client. The API returns some data as a result of this function. E.g. Get the location on map for some specified criteria.

2. POST: This method is used to send some information to sever using PUT function from the client application. The API adds some values to the application as a result of this function. E.g. Put client’s details on the API server and plot a visualisation using highcharts API.

3. PUT: This method is used to create a new entity e.g. customer in the application.

4. Delete: This method is used to delete the data passed in the parameters of the methods.

Intention of API Testing is to make sure that each and every method is working as expected and returning the correct result to the client application.

-->Tools to test API: There are various free and pro tools available to test the API. Few are listed as below:

  1. SoapUI: This is an open source with some basic features in it whereas the pro version of the tool gives the wide variety and support to test the API.
  2. Postman: This is an add-ons in Google chrome which is used to test REST application. It is an easy to use open source tool.
  3. Katalon Studio: This is currently emerging as a leading tool for API and Web services testing. It is one of the free tools to be used for the testing.
  4. JMeter: this tool was originally designed to performance testing. It is a paid tool which is now days used for application API testing.

-->Reasons to test API: There are below reasons to test the API in software development lifecycle:

  1. Test API integration is correct: The API is testing to make sure that it has been integrated with the software application correctly and returning the expected results after the integration.
  2. Security of API: The API is testing to make sure that the data shared between the server and client is secure and cannot be accessed by the hackers on the internet.
  3. API load handling: The API is tested to make sure that it can handle the expected load on it. It includes the testing with bulk data, concurrent users etc.
  4. Cross-platform support: The API is tested to make sure that is behaviour is same for different supported platforms for the application. E.g. API is responding correctly for Chrome, Firefox, Windows, and Mobile Applications etc.
  5. Risks: The API testing is performed to identify the risks involved in the API integration. It may include the handling of client’s request when the API gets upgraded OR is down due to certain issues on the internet.

--> How to test API: The API is a collection of classes, data structures, implementations and abstraction which does not has the user interface. Thus the API is tested using the various tools available and listed above.

Consider the API which deals with storing the data of customer and the transaction made by the customer. The API testing will be performed by following the below strategy:

  1. Select the API testing tool: API testing is performed using one or more tools available. The testing team selects the appropriate tool to test the API.

  1. Test all Get methods: To Test the API, all GET methods is tested with different parameters to be passed to get the data.

Example: Let’s consider method to get the customer’s information. It can be done using Customer’s Name, Date of transaction, email address. Testing will include the test cases for all the GET methods.

  1. Test all PUT methods: To Test the API, all PUT methods are tested with different parameters to be passed to put the data.

Example: Let’s consider method to create customer record. It will require customer’s name, date of transaction, amount, payment method etc. Testing will include the test cases for all the PUT methods.

  1. Test Delete methods for different entities: The API testing will include all the methods to be used to deleting the data or entities.

Example: Consider the example, where the client application can delete the customer record. Test Delete method to delete the data of customer.

  1. Test POST method for different entities: To Test the API, all POST methods is tested with different parameters to be passed to put the data in entities.

Example: Let’s consider method to create or update customer record. It will require customer’s name, date of transaction, amount, payment method along with new information to be added in the record. Testing will include the test cases for all the PUT methods.

Add a comment
Know the answer?
Add Answer to:
API Testing. Give me some real world examples of these kinds of testing. Tell me the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT