Just trying to figure out what others are using to test their database procedures / queries, etc. Are you using the new Visual Studio extensions, custom code, etc? I need to some how formulate some unit tests, but not quite sure how I am going to build the tests so that we can easily regression test the procedures.
Unit Testing Techniques: Black Box Testing - Using which the user interface, input and output are tested. White Box Testing - used to test each one of those functions behaviour is tested. Gray Box Testing - Used to execute tests, risks and assessment methods.
You have lots of options--as you've already mentioned--but for true unit testing you always want to get as close to the actual unit under test as possible in order to avoid letting integration concerns intefere with your tests. For database objects, this means using the Visual Studio database unit test projects and writing SQL to unit test the database objects, or using some sort of 3rd party SQL-based testing framework like DBUnit.
In some cases you may want to use Linq-to-SQL to perform some database unit tests more concisely/easily than can be done in SQL, but this should be avoided unless absolutely necessary for true unit testing; Linq-to-SQL (and any other custom code) introduces integration issues and extra layers, and so if you encounter an error, you will first have to make sure it truly is an error in your database and not in your Linq-to-SQL database connection, C# code (for example), etc.
We've had a lot of success with DbFit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With