The 3 levels of automated testing

Test

Once an application has a lot of features, manual testing gets slow and repetitive. Every new feature forces you to retest everything to check nothing broke.

Automated tests fix that: the existing tests run on their own, and you concentrate on the new features.

The 3 types

Unit tests: they check that a function, a class, or a component does what you expect. Fast to run.

Integration tests: they check that modules work together. A service that inserts a user in the database, for example, covering validation and the database interaction.

Functional tests (end-to-end): they simulate a real user working through the interface. Very useful, but slow and expensive to run.

What to take away

Prioritize unit tests, then integration tests, then functional ones. The faster the test, the faster you iterate. Don't rely on functional tests alone: as they grow, you can end up waiting half a day for a result.