API testing verifies the functionality, usability, security, and performance of application programming interfaces (APIs). Key aspects to test include input parameters, error handling, response times, authentication, and documentation. Automated testing scripts should be created to regularly test APIs for bugs such as unhandled errors, security vulnerabilities, incorrect responses, and reliability issues. Thorough API testing requires considering parameter combinations, output validation across systems, and exception handling.
API testing…
Test Casesfor API Testing:
● Return value based on input condition
● Does not return anything
● Trigger some other API/event/interrupt
● Update data structure
● Modify certain resources
3
4.
What to testfor in API testing
● 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
4
5.
Types of Bugsthat API testing detects
● Fails to handle error conditions gracefully
● Unused flags
● Missing or duplicate functionality
● Reliability Issues. Difficulty in connecting and getting response from API.
● Security Issues
● Performance Issues. API response time is very high.
● Improper errors/warning to caller
● Incorrect handling of valid argument values
● Response Data is not structured correctly (JSON)
5
6.
Tools for APItesting
● SOAPUI
● Runscope
● Postman with jetpacks
● Postman with newman
● Curl
● Cfix
● Check
● CTESK
● dotTEST
● Eclipse SDK tool- Automated API testing
6
7.
Challenges of APITesting
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 required to be known to the testers
● Exception handling function needs to be tested
● Coding knowledge is necessary for testers
7
8.
Conclusion
API consists ofset of classes / functions / procedures which represent the business logic layer. If API is not
tested properly, it may cause problems not only the API application but also in the calling application.
8
9.
Thank You
Bikash KumarSharma
SoftwareArchitect
bikashsharma.bks@gmail.com
@bikashsharmabks
bikashkumarsharma
9