Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are people using to unit test their stored procedures ,etc

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.

like image 830
scarpacci Avatar asked Apr 04 '11 03:04

scarpacci


People also ask

What are the methods of unit testing?

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.


2 Answers

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.

like image 68
KP Taylor Avatar answered Oct 08 '22 20:10

KP Taylor


We've had a lot of success with DbFit

like image 27
Ed Harper Avatar answered Oct 08 '22 20:10

Ed Harper