Unit testing is a known methodology among developers around the world, be they Java, C#, VB.NET, or C++ programmers. Unit testing helps you produce code with fewer bugs and achieve a higher degree of quality. Although this has become a well-known practice, when it comes to databases, we haven’t seen the same adoption rate.
The objective of this chapter is to introduce some basic concepts of unit testing that you can apply when programming with T-SQL, without using any third-party tool or external framework. I’ll show you how to make the necessary adjustments and bend some rules to adapt unit tests to databases.