简体   繁体   中英

How to test APIs

I've started unit testing and I'm trying to perform unit tests on an API wrapper I built for a WSDL Resource I'm using.

I can unit test my classes just fine, but what are the best practices for testing the external API? Should I ever bother testing it? Aside from the tests I to verify connection and parameters and stuff, what are the best methods for making sure my data got properly updated(if I should even be doing that)?

What your seeking is called Blackbox Testing which stands basically for testing functionallity of the API instead of its structure.

What you normally look for is:

  • Incorrect or missing functions
  • Interface errors
  • Errors in data structures or external database access
  • Behaviour or performance errors
  • Initialization and termination errors

Google for Equivalence Partitioning and Boundary Value Analysis . That should give you an idea of what to test and how.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM