The purpose of unit testing in software development is to validate that each unit of the software performs as designed. It is usually part of a CI/CD process, in which units are tested continually and automatically.
Unfortunately, in many organizations, the database is not part of those CI/CD processes, and database unit testing is not even a thing.
In reality, the database is no different, and there are clear advantages to using database unit testing. It allows us to test individual and programmable parts of database objects such as stored procedures, functions and triggers, and find bugs and errors early in the process.
Visual Studio provides a rich framework for unit testing, and SQL Server Data Tools (SSDT), which is an extension to Visual Studio, provides a rich framework for database development via the Database project type. Combining these two features together brings us an excellent tool for database unit testing, whether it's SQL Server or Azure SQL.
In this session, Sagi Vaknin demonstrates how to effectively plan and implement database unit testing using SSDT.
Learn about various test types, and discuss how this process can be automated and used as part of CI/CD.