Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a code-coverage tool for the TSQL sproc unit tests? [closed]

I am looking for a unitttest and code-coverage tool for TSQL sprocs. Can anyone recommend a good one? Commercial or free.

like image 865
Yuri Avatar asked Oct 29 '09 23:10

Yuri


People also ask

How do you find the code coverage of a unit test?

To calculate the code coverage percentage, simply use the following formula: Code Coverage Percentage = (Number of lines of code executed by a testing algorithm/Total number of lines of code in a system component) * 100.

What is the tool used for to check test coverage?

TestMonitor. TestMonitor is an efficient tool for creating a visual appeal on the Test Coverage progression in the test management process and testing lifecycle. It is a well-known tool for its minimalism and perceptive move towards the test execution activities.


1 Answers

For unit testing you can't really get better than tSQLt - the mocking functionality via FakeTable and SpyProcedure are really first rate and second to none.

If you use SSDT then you can use this to measure your code coverage:

https://the.agilesql.club/blog/Ed-Elliott/2016-01-14/T-SQL-Code-Coverage-In-SSDT

(I wrote it but that is exactly what it is for and is OSS)

I've got a version now that does not rely on ssdt and can be used as part of a build process:

https://the.agilesql.club/blogs/Ed-Elliott/2016-04-08/SQLCover-Code-Coverage-For-SQL-Server-T-SQL

ed

like image 178
Ed Elliott Avatar answered Sep 27 '22 16:09

Ed Elliott