Bob The Janitor Bob The Janitor - 1 month ago 17
SQL Question

Is Unit Testing your SQL taking TDD Too far?

There is an article out on www.sqlservercentral.com about unit testing your SQL.

The TDD Guy in me said good, we can test the database stuff.

The System Architect in me said, what logic are we testing? There shouldn't be any logic in the database, the only thing you should be doing in the data base is selecting, updating, or inserting.

So if you feel the need to unit test your SQL, are you just being really thorough, being overly pragmatic, or is it a sign of design smell?

Answer

I agree with the System Architect, too much business logic is making its way into databases these days.