Data testing & continuous integration
Deploy fearlessly with routine testing and CI/CD
Go from reactive to proactive
Trust is sensitive - it builds slowly, and can be erased quickly. Data practitioners understand this more than most. dbt enables data teams to deploy with the same confidence of software engineers, with rapid, reliable testing and CI/CD.
Data testing in dbt
Teams using dbt typically verify data quality at four stages:
On source data
Use schema tests to verify raw data quality.
Avoid fan-outs or missed joins in your staging models.
Enable CI on dbt Cloud to execute tests against new PRs.
View analytic code inline
Pop into the data model itself for ad-hoc investigation while browsing docs.
Supported tests in dbt
dbt makes simple testing easy, and complex testing possible.
Validate essential data quality
Out of the box, dbt supports schema tests for uniqueness, null or accepted values, or referential integrity between tables.
These can be extended by writing your own custom schema tests.
Data value testing
Flag out-of-range values
Define data test failure conditions in simple code.
Implement complex testing logic
Packages like dbt-expectations, maintained by community member Claus Herther, supplement dbt’s native testing functionality.
This extends to statistical & distribution tests, or aggregate function tests - anything that can be written in SQL or Python can be tested in dbt.
CI on deployment
Validate your code before shipping
Avoid shipping low-quality analytics code, by validating every pull request prior to deployment. Each CI run builds your dbt project to a temporary schema in your warehouse.
Test your data where it lives
Whether your analytics data is stored in a cloud warehouse, data lake, lake house or beach house - you can transform and test it with dbt.
Data testing stories
Learn from data teams who’ve made testing a key part of their workflow.