Test levels¶
Unit tests¶
Unit tests are often called component tests or module tests. Their main goal is to find errors in the implementation of a given unit / component. The test objects are therefore individual components in isolation, and the basic documentation is a detailed design and sometimes other documents, i.e. requirements specification. The word component can be a function, a class, and sometimes an entire module.
-
Unit testing is performed at a very low level of the application, very close to the source code of the software
-
These tests consist in testing individual methods and functions of classes, components or modules used in the program.
-
Automating unit tests is generally quite cheap, and can be performed very quickly by the continuous integration server.
Integration tests¶
The next level are integration tests, they check whether the components work together correctly. PAn example can be cooperation between a web application and a database, but not only - an example can be cooperation between two classes. It can be concluded that integration testing is aimed at detecting errors during the interaction between systems or its parts.
-
Integration tests check whether the various modules or services used by the software work well together.
-
This level of testing can be used, for example, to check the interaction of the application with the database or to make sure that the micro-services work in accordance with the requirements and expectations.
-
This level of testing is more expensive than unit testing because it requires multiple application components to run.
System tests¶
We perform system tests when the system components have been integrated with each other. This is the moment when we check the functionality of the system. At this stage, we can run e2e (end to end) tests. E2e tests are tests carried out from the user's point of view, they cover entire test scenarios, e.g. starting from creating an account, including logging in to the system and performing an operation to finally log out. Thanks to these tests, we are able to find out to what extent our created system meets the original assumptions.
-
End-to-end testing simulates the behavior of the user using the software in the full application environment.
-
This level of testing checks that all elements of the application are working as intended.
-
They are characterized by the fact that some of them can be extremely simple and rely on loading a website or logging in, while more complex scenarios can include validation of e-mail notifications, online payments and much more, among others.
Acceptance tests¶
Usually, acceptance tests are performed on the client's side or by end users. For this type of testing - the tested application area must be fully operational. The main purpose of acceptance tests is not to find errors, but to make sure that the application meets the expectations of the customer and users.
-
Acceptance testing is formal software testing that is used to verify that a system meets business requirements.
-
They require the entire application to be started and run properly and consist in replicating user behavior.
-
These tests may also cover a slightly wider scope, which may include, inter alia, measuring system performance and rejecting changes in case they do not allow the achievement of the set goals and requirements.