Sunday 23 December 2012

API Testing - Part 2

API Testing - Part 2

      Hi to all,  In last post we had a introduction, best practices and challenges of API testing. In todays post we also want to focus on other aspects of API testing.

Test cases for API Testing:
Test case of API testing are based on the output.
API Test Development.
API test case specification.

1. Create / Select the Suite in which you want to add the API test case(s).
2. Choose Test Development Mode ( Isolation or Sequence ).
3. Develop Test case(s) for the desired API methods.
4. Configure Application Control Parameters.
5. Configure Test Conditions.
6. Configure Method Validation.
7. Execute API test.
8. View Test Reports.
9. Filter API test cases.
10. Sequence API test cases.

While API tests should strive for a high level of code coverage (structural testing) a more important goal is test coverage. For example API tests of this same method might include a series of data-driven tests that:
  • test every known alpha-numeric character defined.
  • test character casing
  • test pan grams, and special signals (e.g. end of message, attention, received, etc)
  • test boundary conditions.
  • test strings with invalid or characters that are not defined.
  • test strings with non-ASCII letters.
  • test performance to provide baseline measures of individual methods
More complex APIs such as this MessageBox.Show method that have several parameters with variable argument values might benefit from additional testing techniques such as combinatorial testing.

 You can also test the API's through some automation tolls and observe the input and expected output.

1. Xocean tool.
2. Soup UI
3. Jmeter.