|
|
|
|
Browse by Tags
All Tags » T-SQL » Unit testing (RSS)
-
Once we have a considerable amount of unit tests, their maintenance begins to take noticeable time. If we need to change a module covered by unit tests, it may take less time to make the change itself than to change the corresponding tests accordingly.
This post continues the series on unit testing, the previous posts are
How to Benefit from ...
-
Ideally unit test harness should run very fast. Because all unit testing involving a database is quite slowish, we need to apply some effort to ensure that our tests finish in acceptable time.
This slowness might not be a concern when we try out a cool new technology against a tiny set of objects and tests, but it surely does become an issue ...
-
Unit tests provide a very accurate snapshot of what we were thinking about (and what we were missing) when we were writing them. In fact, they are working examples of how we think our code should be used. More to the point, unit tests must be up-to-date, otherwise they would not pass.Fro example, if the signature of a method changes, or we add ...
-
Well-written unit tests should succeed only when the module being tested meets the requirements completely.If the test fails, it can do much better than just indicate failure. If the test has managed to provide a clear and comprehensive report of what is wrong, that can save us a lot of time troubleshooting.
We shall see a few examples ...
-
In this post we shall see how to incorporate a typical manual test in an automated test harness with minimal effort.
Because our goal is
to benefit from unit testing, and not to develop as many features as we can think of, we shall concentrate on the most common use cases. In fact, just one use case is so common that is happens more often all ...
-
Ideal unit tests are easy to roll out, easy to maintain, run fast, and make a difference: without them making changes and troubleshooting are more difficult.Some common examples of unit tests do not grade well against this criteria. For instance, writing unit tests to verify that a database or a table exists is surely easy, and is a nice ...
-
When we write articles, blog posts, and books, our examples must be simple. On the other hand, when we write automated tests in real life, the most complex modules need automated tests much more than simple ones.
Consider, for example, the following trivial stored procedure:
CREATE PROCEDURE ...
-
Unit testing may be extremely useful if we do it right – if. On the other hand, if unit testing
is being used inefficiently, it can be a huge waste of time and effort.
When we were beginning to unit test our T-SQL more than
three years ago, we wrote a series of articles describing how to do it with C#
and NUnit. This approach worked out ...
-
How do you unit test your T-SQL? Which libraries/tools do you use?
What percentage of your code is covered by unit tests and how do you measure it?
Do you think the time and effort which you invested in your unit testing harness has paid off or not?
If you do not use unit testing, can you explain why not?
|
|
|
|
|