> For the complete documentation index, see [llms.txt](https://kdongs.gitbook.io/kdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kdongs.gitbook.io/kdocs/tests/automated-tests.md).

# 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&amp;token=39f70481-2aaf-42b5-b009-4e45d37eda66" alt=""><figcaption></figcaption></figure>
