> ## Documentation Index
> Fetch the complete documentation index at: https://elementary-devin-1782754750-bigquery-permissions-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Elementary Data Tests

Elementary provides anomaly tests for detection of data quality issues.
Elementary data tests are configured and executed like native tests in your dbt project.

Elementary tests can be used in addition to dbt tests, packages tests (such as dbt-expectations), and custom tests.
All of these test results will be presented in the Elementary UI and alerts.

The Elementary dbt package offers two test types:

* **Pipeline tests:** Monitor the health of data pipelines, ensuring timely and smooth data ingestion, transformation, and loading.
* **Data quality tests:** Validate data accuracy, completeness, and correctness, detect anomalies and schema changes, and ensure the data meets predefined business rules.

Together, these tests ensure reliable pipelines and trusted data.

In addition to the mentioned dbt package tests, the [Elementary Cloud Platform](https://docs.elementary-data.com/cloud/introduction) offers **automated pipeline tests.** While traditional tests query the dbt tables directly, automated pipeline tests analyze **query history metadata**. This method is both **faster and more cost-efficient**, as it eliminates the need to query large datasets, focusing solely on the metadata layer. Learn more about [automated tests](https://docs.elementary-data.com/features/anomaly-detection/automated-monitors).

<CardGroup cols={3}>
  <Card title="Anomaly detection" icon="chart-line" icontype="solid" href="/data-tests/introduction#anomaly-detection-tests">
    * Volume
    * Freshness
    * Event freshness
    * Column anomalies
    * Dimensions
  </Card>

  <Card title="Schema tests" icon="table" href="/data-tests/introduction#schema-tests">
    * Schema changes
    * Baseline schema
    * JSON schema
    * Exposure schema
  </Card>

  <Card title="Other tests" icon="python" href="/data-tests/introduction#other-tests">
    * Python tests
  </Card>
</CardGroup>

## Anomaly detection tests

Tests to detect anomalies in data quality metrics such as volume, freshness, null rates, and anomalies in specific dimensions.

<Tooltip tip="Anomaly detection test result example from Elementary report">
  <img src="https://mintcdn.com/elementary-devin-1782754750-bigquery-permissions-docs/zLPVq6zLYCQB7e8x/pics/anomalies/anomaly-example.png?fit=max&auto=format&n=zLPVq6zLYCQB7e8x&q=85&s=fa2f17716bd558fd5213319df84921b3" alt="Demo" width="2372" height="508" data-path="pics/anomalies/anomaly-example.png" />
</Tooltip>

<Tip>
  [How Elementary anomaly detection tests
  work?](/data-tests/how-anomaly-detection-works)
</Tip>

<Card title="Volume anomalies" href="/data-tests/anomaly-detection-tests/volume-anomalies">
  Monitors table row count over time to detect drops or spikes in volume.
</Card>

<Card title="Freshness anomalies" href="/data-tests/anomaly-detection-tests/freshness-anomalies">
  Monitors the latest timestamp of a table to detect data delays.
</Card>

<Card title="Event freshness anomalies" href="/data-tests/anomaly-detection-tests/event-freshness-anomalies">
  Monitors the gap between the latest event timestamp and its loading time, to
  detect event freshness issues.
</Card>

<Card title="Dimension anomalies" href="/data-tests/anomaly-detection-tests/dimension-anomalies">
  Monitors the row count per dimension over time, and alerts on unexpected
  changes in the distribution. It is best to configure it on low-cardinality
  fields.
</Card>

<Card title="Column anomalies" href="/data-tests/anomaly-detection-tests/column-anomalies">
  Monitors a column for anomalies in metrics such as null rate, length, max and
  min, and more. Read more about [specific column
  metrics](/data-tests/anomaly-detection-configuration/column-anomalies).
</Card>

<Card title="All columns anomalies" href="/data-tests/anomaly-detection-tests/all-columns-anomalies">
  Activates the column anomalies test on all the columns of the table. It's
  possible to exclude specific columns.
</Card>

## Schema tests

<Card title="Schema changes" href="/data-tests/schema-tests/schema-changes">
  Fails on changes in schema: deleted or added columns, or change of data type
  of a column.
</Card>

<Card title="Schema changes from baseline" href="/data-tests/schema-tests/schema-changes-from-baseline">
  Fails if the table schema is different in columns names or column types than a
  configured baseline (can be generated with a macro).
</Card>

<Card title="JSON schema" href="/data-tests/schema-tests/json-schema">
  Monitors a JSON type column and fails if there are JSON events that don't
  match a configured JSON schema (can be generated with a macro).
</Card>

<Card title="Exposure schema" href="/data-tests/schema-tests/exposure-tests">
  Monitors changes in your models' columns that break schema for downstream
  exposures, such as BI dashboards.
</Card>

## Other tests

<Card title="Python tests" href="/data-tests/python-tests">
  Write your own custom tests using Python scripts.
</Card>

## dbt tests outcomes

In dbt, there are three possible outcomes when running models or tests: errors, failures, and warnings.

* An **error** means dbt could not run the SQL at all (e.g., syntax mistake, missing table, broken macro). This stops execution (on `dbt build`).
* A **failure** happens when a test runs successfully but its condition isn’t met, and if the test’s severity is set to error, it will fail the pipeline.
* A **warning** is the same as a failure in terms of data quality, but with severity: warn, dbt exits successfully and does not break pipelines.
