API testing

Unit testing focuses on testing smaller portions of code, whereas API testing requires testing of interaction between several components such as the API itself, the app logic in the backend, and other backend elements such as databases. However, it typically does so in a "black box" fashion.

API testing includes:

  • Functional tests verifying that API calls and responses behave as expected, given a specification and/or a set of use cases.
  • Load testing to see if the API can handle the pressure given your specific use case.
    • e.g. see Apache Bench
  • Security testing to see if APIs are vulnerable to attacks, such as SQL Injection.
  • Fuzz testing to test the robustness of your API if out of the ordinary or invalid inputs are sent to the API.

Sources: