Types of tests

Types of tests

3m

Prelude

We grouped our tests into functionalities, and now we need to understand how to divide tests by the context that they verify.

What are the types of tests?

Taking into account the area we are testing, the test can be divided into the following types:

  • Unit tests

  • Integration tests

  • E2e tests

Unit tests are fast and precise. They are focused on a specific thing and answer concrete questions.

In the context of a pizza creation it will be the following situations:

Loading

Integration tests verifies cooperation. They are also quite fast. When we write them, we don't focus on specific things as in unit tests but on checking that "something" has been used as intended.

Instead of checking if the pizza size, color, and other, we can check if it was made according to the recipe in the book. Below is an example of such tests:

Loading

E2e tests focus on the user's perspective, not the implementation. They are technologically agnostic and usually execute for a long time (they operate on the finished application, not code fragments) .

Instead of checking what's going on in the kitchen, how the pizza is made and based on what recipe - we simply ask the customer what he thinks about the taste (the customer is our application).

Loading

Summary

As you might have noticed, mainly the context changes. We started with a single employee (code file), we moved to a communication perspective (several code files), and at the very end we left the implementation behind and simply asked the customer (application) what he thinks about our product.

That's the difference between the different types of tests. Don't worry, it will get into your blood in the next lessons.

If you enjoyed it, be sure to visit us on Linkedin where we regularly upload content from programming.