Yes, though sometimes indirectly. Generally, I rely on the unit tests for the procedures in my main code base that calls on the stored procedure. For stored procedures that are custom written for the application, I know that as long as the applications unit tests pass the stored procedure functions propertly for all practical purposes. I know some would call this integration testing, but for that type of stored procedure it fulfills the same purpose.
When I have a stored procedure or UDF that is not amenable to testing that way (because it is a maintaince script, or will be used in numerous external programs) then I write unit tests just for the SQL code, but even then I tend to write the unit tests in a library like Python's Unittest rather than a SQL Specific test suite.
↧