# Testing

## What & Why?

What is testing? Why do we need tests.

![Manual vs Automated Testing](https://2068594424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MZvh-eMIQtgB00n2d-q%2F-M_UKVBB-l828yN2W4Rd%2F-M_UN0GpxQxWR3QBE2z8%2FScreenshot%202021-05-12%20at%2012.29.38.png?alt=media\&token=729b464a-cf72-432a-9fcb-e55e073f84b9)

## Types of Automated Tests

There are 3 basic categories of automated tests:

1. Unit Tests
2. Integration Tests
3. End-to-end (e2e) Tests

![Types of Automated Tests](https://2068594424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MZvh-eMIQtgB00n2d-q%2F-M_UPVW4XsLzLrgwHi-h%2F-M_URUH5hsLR5aJCAE17%2FScreenshot%202021-05-12%20at%2012.49.14.png?alt=media\&token=f40e69f4-9b78-49cc-9dca-18e1a82a3ae8)

### Unit Tests

These are the most common and important type of tests. Unit tests are basically the ones that test the **individual building blocks** (functions, components) of the app **in isolation**.

A typical app contains dozens and hundreds of unit tests.

### Integration Tests

Integration tests usually test the **combination** of multiple building blocks. Projects typically contain a couple of integration tests. These are also important, but the focus is more on unit tests.

### E2E Tests

These automated tests test the complete scenarios in our app as the user would experience them. Projects typically contain a few end-to-end tests. These types of test are important, but can also be done manually (*partially*).

## What & How to Test?

We'll be working with unit tests, so typically we will be testing the smallest building blocks of our code.

![What & How to test our app.](https://2068594424-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MZvh-eMIQtgB00n2d-q%2F-M_URj-qhEwvXcAcnHLF%2F-M_UTdKG1PfyYQewK-8Y%2FScreenshot%202021-05-12%20at%2012.58.38.png?alt=media\&token=9ec5c1ec-6cb9-4631-b16b-ee7b84c8d08c)
