# Automated Tests

Tests must have a well defined output, which is valid or not, and this will pass or fail the test.

{% hint style="info" %}
There must not be dependencies between tests, they must be able to be executed separately.
{% endhint %}

### Structure

A test can be separated in 3 steps.

#### Given (Arrange)

The definition of all necessary information to execute the behavior to be tested. *(Data input)*

#### **When (**&#x41;ct)

Where you execute the behavior.

#### **Then (**&#x41;ssert)

Where you compare the return information with the expected one. *(Basically is the* `expect`*)*

### Coverage

Coverage in tests means the amount of code that the tests run on. It is not related to `success` or `failure` percentage.

<figure><img src="https://1952965205-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8EYopyRu7bju4Fqmr45t%2Fuploads%2FcWXDSq87mQYtTrYNithG%2Fflow.png?alt=media&#x26;token=39f70481-2aaf-42b5-b009-4e45d37eda66" alt=""><figcaption></figcaption></figure>
