Pluralsight Review: Unit Testing T-SQL Code With tSQLt

I recently completed Dave Green’s Pluralsight course entitled Unit Testing T-SQL Code with tSQLt.  I think the material was solid and Green does a good job presenting it, as well as Red Gate’s add-on tool called SQL Test.

I did learn a lot about tSQLt from this course.  I had played with tSQLt a little bit a few years back, and it looks like the product has matured since then.  One of the big reasons I was interested in checking out this course is to see how tSQLt handles isolating dependencies, and Green has an entire section on the topic.

My main problem with the course has nothing to do with Green or the way he presented the topic; rather, I think it’s a flaw in the product itself.  It seems like a lot of the tests that Green walked through did more testing of tSQLt than actual business or procedure logic.  For example, to test a check constraint, the tests weren’t really checking the constraint, but rather a mocked constraint.  This seems like an artificial attempt to force unit testing in a place where integration testing is appropriate.  Again, I don’t blame Green for this; rather, I think it’s a disagreement I have with the product itself.

Advertisements

2 thoughts on “Pluralsight Review: Unit Testing T-SQL Code With tSQLt

  1. Hi Kevin,

    Thanks for the review; I’m glad you enjoyed the course material. You make an interesting point about the border between unit and integration testing, and one that has been a tension previously; the need to avoid testing S

    • (Sorry – Clicked send too soon..) To continue my train of thought, there is a need to avoid testing SQL Server functionality itself (which one hopes that Microsoft have done sufficiently), and actually test for potential weaknesses in your database.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s