Types of API Testing

30/5/2025
Testing is an important aspect of software development. In which, everyone should take part in to ensure the product is well-made. However, there are so many myths in testing and this easily leads to many confusing questions, e.g. What is this test for? Who is in charge? How to setup a test suite? When to run a test suite? etc. This article introduces about some common types of test, specilized in API testing, to clear up the myths.

Types of API Testing

Testing is an important aspect of software development. In which, everyone should take part in to ensure the product is well-made. However, there are so many myths in testing and this easily leads to many confusing questions, e.g. What is this test for? Who is in charge? How to setup a test suite? When to run a test suite? etc. This article introduces about some common types of test, specilized in API testing, to clear up the myths.

Smoke/Sanity Test

It is time consuming to complete a test suite. It can be as quick as a few minutes, or it can be as long as a few hours, or it can even take a whole day to finish a test suite. Thus, we want the test to fail as quick as possible.

Smoke test is a short test suite just for checking if the build is functioning normally, simply by checking if API endpoints are correct and they are returning responses. In another word, we run smoke test to know if the build is ready for further testing.

  • Written by: Dev or QA
  • Run by: Dev or QA
  • When to run: before any time-consuming tests
  • Time to finish: about 10-15 mins

Basically, Smoke test is to ensure if the functionalities are working. While as, a related-test, Sanity test, is more in dept, which check if the functionalities are working correctly.


Functional Test

Just as it name states, Functional test is to test a specific functionality. Whenever a feature request comes in, it will be broken down into functionalities. And a dev/group of dev will develop them. After the development complete, the dev will do self-testing. If self-testing is good, the dev will create a PR, merge to an approriate branch and deploy that branch into a test enviroment so that testers can participate in testing.

  • Written by: Dev or QA
  • Run by: Dev and QA
  • When to run: after a feature is merged
  • Time to finish: depends on usecase

Functional test is very generic, which means it does not enforce the compleness of system. One can mock some part of the system to check just the changed part or one can use actual external services to stimulate near-production enviroment. Both is acceptable.


Integration Test

While Functional test allow use mocked services, Integration test requires actual services to be used, or at least a stimulated service which acts almost the same with the real one. Furthermore, it test the whole system or a specific part of a system instead of just one functionality.

  • Written by: QA
  • Run by: QA
  • When to run: on release
  • Time to finish: hours, days

End-to-end Test

E2E test is commonly mistaken with UI test, but it is actually not. E2E is testing the whole app, but from user point of view, which means testers have to executed the test by interacting with actual UI.

  • Written by: Dev
  • Run by: Dev or QA
  • When to run: on PR merge or on release
  • Time to finish: hours, days

Common tools include Playwright, Cypress


Regression Test

As the purpose of checking if the system is healthy or not after merging a new feature. Regression test is a kind of requent checking.

  • Written by: QA
  • Run by: QA
  • When to run: frequently to ensure a healthy system
  • Time to finish: N/a

Load/Stress Test

Load test is very common in API testing and should always be included on pre-release. The purpose of the test is to know much of a workload the system can perform. Thus, there requires a staging environment which has a same infrastructure with production environment.

  • Written by: Dev
  • Run by: Dev or QA
  • When to run: on release
  • Time to finish: N/a

Common tools include K6, Locust, JMetter, Artillery, Azure Load Testing

For this type of test, a set of metrix must be defined, which satisfies some questions such as:

  • How many Request Per Seconds (RPS) it can handle?
  • Which services are bottle-neck?

Stress test has a similar setup with Load test, but with the different purpose in mind. It is to find out how the system behave on high workload. For example:

  • Failure rates
  • Which services will down first?
  • How services recovers and if they can recover or not?

[Image comparing load testing vs stress testing graphs]


Further reading:

Dropdown icon

Blog liên quan

Dropdown icon
Contact Us