August 27, 2010

API Testing Tools


API Testing Tools: There are many testing tools available. Depending on the level of testing required, different tools could be used. Some of the API testing tools available are mentioned here.
JVerify: This is from Man Machine Systems.
JVerify is a Java class/API testing tool that supports a unique invasive testing model. The invasive model allows access to the internals (private elements) of any Java object from within a test script. The ability to invade class internals facilitates more effective testing at class level, since controllability and observability are enhanced. This can be very valuable when a class has not been designed for testability.
JavaSpec: JavaSpec is a SunTest's API testing tool. It can be used to test Java applications and libraries through their API. JavaSpec guides the users through the entire test creation process and lets them focus on the most critical aspects of testing. Once the user has entered the test data and assertions, JavaSpec automatically generates self-checking tests, HTML test documentation, and detailed test reports.
Here is an example of how to automate the API testing.
Assumptions: -
  1. Test engineer is supposed to test some API.
  2. The API’s are available in form of library (.lib).
  3. Test engineer has the API document.
There are mainly two things to test in API testing: -
  1. Black box testing of the API’s
  2. Interaction / integration testing of the API’s.
By black box testing of the API mean that we have to test the API for outputs. In simple words when we give a known input (parameters to the API) then we also know the ideal output. So we have to check for the actual out put against the idle output.
For this we can write a simple c program that will do the following: -
  • Take the parameters from a text file (this file will contain many of such input parameters).
  • Call the API with these parameters.
  • Match the actual and idle output and also check the parameters for good values that are passed with reference (pointers).
  • Log the result.
Secondly we have test the integration of the API’s.
For example there are two API’s say
Handle h = handle createcontext (void);
When the handle to the device is to be closed then the corresponding function
Bool bishandledeleted = bool deletecontext (handle &h);
Here we have to call the two API’s and check if they are handled by the created createcontext () and are deleted by the deletecontext ().
This will ensure that these two API’s are working fine.
For this we can write a simple c program that will do the following: -
  • Call the two API’s in the same order.
  • Pass the output parameter of the first as the input of the second
  • Check for the output parameter of the second API
  • Log the result.
The example is over simplified but this works because we are using this kind of test tool for extensive regression testing of our API library.

About the Author

Tomboy

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

Post a Comment

 
Iwebslog Blog © 2015 - Designed by Templateism.com