I am looking for a unitttest and code-coverage tool for TSQL sprocs. Can anyone recommend a good one? Commercial or free.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With