Skip to main content

What is API & API Testing ?


An application programming interface (API) is a set of routines, protocols, and tools for building software applications. An API expresses a software component in terms of its operations, inputs, outputs, and underlying types. An API defines functionalities that are independent of their respective implementations, which allows definitions and implementations to vary without compromising each other. A good API makes it easier to develop a program by providing all the building blocks.
                API Testing is entirely different from GUI Testing and mainly concentrates on the business logic layer of the software architecture. This testing won't concentrate on the look and feel of an application.
Instead of using standard user inputs(keyboard) and outputs, in API Testing, you use software to send calls to the API, get output, and note down the system's response.
API Testing requires an application to interact with API. In order to test an API, you will need to
  • Use Testing Tool to drive the API
  • Write your own code to test the API

Test Cases for API Testing-
  • Return value based on input condition: it is relatively easy to test, as input can be defined and results can be authenticated
  • Does not return anything: When there is no return value, behavior of API on the system to be checked
  • Trigger some other API/event/interrupt: If output of an API triggers some event or interrupt, then those events and interrupt listeners should be tracked
  • Update data structure: Updating data structure will have some outcome or effect on the system, and that should be authenticated
  • Modify certain resources: If API call modifies some resources then it should be validated by accessing respective resources
What to test for in API testing-
API testing should cover atleast following testing methods apart from usual SDLC process
  • Discovery testing: The test group should manually execute the set of calls documented in the API like verifying that a specific resource exposed by the API can be listed, created and deleted as appropriate
  • Usability testing: This testing verifies whether the API is functional and user-friendly. And does API integrates well with another platform as well
  • Security testing: This testing includes what type of authentication is required and whether sensitive data is encrypted over HTTP or both
  • Automated testing: API testing should culminate in the creation of a set of scripts or a tool that can be used to execute the API regularly
  • Documentation: The test team has to make sure that the documentation is adequate and provides enough information to interact with the API. Documentation should be a part of the final deliverable
Challenges of API Testing-
Challenges of API testing includes:
  • Main challenges in API testing is Parameter Combination, Parameter Selection, and Call Sequencing
  • There is no GUI available to test the application which makes difficult to give input values
  • Validating and Verifying the output in different system is little difficult for testers
  • Parameters selection and categorization is required to be known to the testers
  • Exception handling function needs to be tested
  • Coding knowledge is necessary for testers
Advantages of API Testing-
Putting more effort into API testing leads to a much healthier final product. Ensuring that all data access (read and write) goes only through the API significantly simplifies security and compliance testing and thereby certification, since there is only one interface. 
Ensuring that all the required business rules are being enforced at the API tier allows time for much more complete user-experience tests once the UI is released, and not having to concentrate on testing every single business rule and path through the application near the end of the project. Ensuring that the API offers complete functionality allows for easy future expansion of the application as new business needs arise.

Comments

Popular posts from this blog

Mobile Application Testing Checklist

1. DEVICE SPECIFIC CHECKS 1.1  Can the app be installed on the device? 1.2 Does the app behave as designed/desired if there is an incoming call? 1.3 Does the app behave as designed/desired if there is an incoming SMS? 1.4 Does the app behave as designed/desired if the charger is connected? 1.5 Does the app behave as designed/desired if the charger is disconnected? 1.6 Does the app behave as designed/desired if the device goes to sleeping mode 1.7 Does the app behave as designed/desired if the device resumes from sleeping mode 1.8  Does the app behave as designed/desired if the device resumes from lock screen? 1.9    Does the app behave as designed/desired if the device is tilted? 1.10  Does the app behave as designed/desired if the device is shaken? 1.11 Does the app behave as designed/desired if a local message is coming from another app (think   of: calendar reminders, to-do task etc.). 1.12 Does the app behave as designed/desired if a push message i...

ERP Domain Knowledge

What is ERP ? ERP is an industry acronym for Enterprise Resource Planning. Broadly speaking, ERP refers to automation and integration of a company's core business to help them focus on effectiveness & simplified success.The Information Technology industry is renowned for its adoption of acronyms, which are often widely used, but not fully understood.  The term 'ERP' itself is not self-explanatory and refers to the business software that has been designed to record and manage your enterprise data. Main Purpose of ERP: The main objective of an ERP domain is to combine information and processes from all divisions of an organization and merge them to create a structured working system. It can either reside on a centrally placed server or on individual servers that are combined on a separate server. Use of ERP: ERP specifically describes software that is used to connect many aspects of a business together. One major use for ERP software is controlling a supply chain. Busine...

Test Scenarios for Excel Export Functionality

1. The file should get exported in the proper file extension. 2. The file name for the exported Excel file should be as per the standards e.g. if the file name is using the timestamp, it should get replaced properly with an actual timestamp at the time of exporting the file. 3. Check for date format if exported Excel file contains the date columns. 4. Check number formatting for numeric or currency values. Formatting should be the same as shown on the page. 5. The exported file should have columns with proper column names. 6. Default page sorting should be carried in the exported file as well. 7. Excel file data should be formatted properly with header and footer text, date, page numbers etc. values for all pages. 8. Check if the data displayed on a page and exported Excel file is the same. 9. Check export functionality when pagination is enabled. 10. Check if export button is showing proper icon according to the exported file type E.g . Excel file icon for xls files 11. ...