
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.
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.
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.
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.
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.
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.
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.
Common tools include Playwright, Cypress
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.
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.
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:
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:
[Image comparing load testing vs stress testing graphs]
Further reading: