API Testing: Real Time Bidding System Testing
- October 14, 2013
eaAn API is actually a software-to-software interface which enables different software applications to communicate with each other. For a better understanding, lets use the example of one of the most famous Kit Project on which our QA team recently worked. The Kit was a real-time bidder framework designed for use on advertising exchanges such as the Rubicon, Nexage, App Nexus, The Google Ad Exchange and Mopub etc. A lot of APIs were used in this project which enabled different components to communicate and share data with each other.
Besides that we can also take the examples of APIs released by Twitter, Facebook, LinkedIn, Youtube and Amazon etc so that the third party applications developers can easily access specific information available on these websites.
It is important to specifically test the APIs as bugs within the APIs may cause problems not only to the API application but to the calling application as well. Testing the APIs is different from other testing types as GUI is rarely involved in it. APIs’ functions are tested by sending requests and checking responses returned against them. To send these requests and to verify the responses we may need to do some coding. But despite the fact that API testing involves coding, it is usually considered beyond the scope of development team. Testing team should own this activity, along with the support of the development team whenever required. To test APIs we go through the following phases:
1) System & API Requirements Review:
We need to develop a basic understanding of the overall system as well as the API before moving on to actually testing them. API specification documents, use cases and requirements can be used to develop an understanding of the API. This activity will not only prepare you for the later stages of testing but also help you in uncovering numerous errors that may occur in the implementation stage before a single test case is written.
2) API Testing Tool Selection:
Testing the APIs with automation tools and selection of such tools largely depends on factors like type of API, testing requirements and resources availability etc. Some of the major automation tools available for API testing are SoapUI, RESTClient, Apigee and Jmeter.
3) Test Case & Test Data Development:
Traditional testing techniques like equivalence classes, boundary analysis, error guessing etc. can be used for writing test cases for APIs. Different test cases can be designed for different scenarios e.g. for getting data, updating data, calling another API or event, changing data structure and modifying resources etc.
4) Test Environment Setup:
Before executing the test cases, we may first need to setup the test environment. Setting up the test environment can be a little complex procedure because of the absence of GUI. Setting up the test environment can involve activities like database configuration and server installations etc.
5) Test Execution & Reporting:
When the setup is ready, test cases are executed and bug reports are generated by comparing the actual results with the expected results.
Although the testing teams might need to learn few new tools to do the API testing but the basic concepts of testing remain the same. Testing the APIs is as important as testing any other component or module of Application is and testing teams should give it equal importance in order to improve the overall product quality.