Why Unit tests?¶
We are testing our code to ensure it works as expected. Our data quality tests do check a lot of things, but we also need to make sure that our code is working as expected. Unit tests are a great way to do this, and give us a lot of assurance that our pipelines behave as expected.
It also enables us to start developing differently. Instead of writing code hoping it will deliver a result we are happy with, we can start to do test driven development. This allows us to first think about the expected output of our code, and then write the code and make changes to the business logic until we get the expected output. This is a better way to develop and might even save us time in the future.
We apply Unit Tests throughout the different layers of our pipelines: