API Testing
API Testing
Overview
What is API Testing? Why should we do API testing? Whats the difference between Unit and API Tests? How to we approach API testing? What types of bugs will we find?
@esconfs #esconfs
www.eurostarconferences.com
http://www.faqs.org/faqs/ software-eng/testingfaq/section-14.html
Cloud Services
@esconfs #esconfs
www.eurostarconferences.com
@esconfs #esconfs
www.eurostarconferences.com
API Testing
Owned by test Broader in scope Mocked and real dependencies Does it play well with others Pre-check-in suites Ran after build is created
www.eurostarconferences.com
Its not either black box or white box; its both black and white!
@esconfs #esconfs
www.eurostarconferences.com
OUTPUT VALUE
Returns the number of characters retrieved in the locale data buffer if successful and cchData is a nonzero value. The function returns 0 if it does not succeed. Error codes ERROR_INSUFFICIENT_BUFFER ERROR_INVALID_FLAGS ERROR_INVALID_PARAMETER
int GetLocaleInfoEx( _In_opt_ LPCWSTR lpLocaleName, _In_ LCTYPE LCType, _Out_opt_ LPWSTR lpLCData, _In_ int cchData );
@esconfs #esconfs
www.eurostarconferences.com
@esconfs #esconfs
www.eurostarconferences.com
Fault injection
Break points, resource constraints, system failures
Traces
Trace statements useful for debugging
@esconfs #esconfs
www.eurostarconferences.com
Execution
Steps to exercise API or scenario, also logging
Verification
Oracles to evaluate execution outcome
Reporting
Pass, Fail, or Blocked
Clean up
Pre-test state
@esconfs #esconfs
www.eurostarconferences.com
Fails to handle error conditions gracefully Missing or duplicate functionality Unused flags Not implemented errors Stress Reliability Security Multi-threading issues Inconsistent error handling Performance Improper errors/warnings to caller Incorrect handling of valid argument values
www.eurostarconferences.com
Key Points
API testing benefits both the development and testing organization. API testing is both a black box and white box activity Finds some types of bugs more efficiently; butcant find all bugs! Doesnt evaluate look and feel Can change focus of GUI automation Requires testers with additional skills Not for everyone!
@esconfs #esconfs
www.eurostarconferences.com
Questions or Comments
For more thoughts on API testing see
www.testingmentor.com/imtesty
@esconfs #esconfs
www.eurostarconferences.com
@esconfs #esconfs
www.eurostarconferences.com