If you write code to SQL Server then you might be interested in this: I have written a tSQLt tdd training course which has helped over 500 people learn both tSQLt and how to apply TDD practices to their SQL Server T-SQL development, you can join the course at https://courses.agilesql.club.
I have released a new version of SQLCover which is a code coverage tool for T-SQL (let’s you identify where you need to focus when writing tests).
This includes a few minor fixes but also support for SQL Azure so if you run your test in a v12 database or higher you can now get an idea of code coverage from that.
If you are interested in using this but don’t know where to start, there is a powershell script in the download (https://the.agilesql.club/SQLCover/download.php) and if you also get reportgenerator (https://github.com/danielpalme/ReportGenerator/releases/tag/v188.8.131.52):
Once you have downloaded SQLCover, extract the files and right click “SQLCover.dll” go to properties and click “Unblock”
Then in powershell run:
$result = Get-CoverTSql "path\to\SQLCover.dll" "connection string" "database name" "query"
$outputFolder = "C:\some\path"
Export-OpenXml $result "$outputFolder"
Start-ReportGenerator "$outputFolder" "c:\path\to\ReportGenerator.exe"
Change the path to SQLCover, the connection string, database name, query (tSQLt.RunAll), output path and path to report generator (phew) then run it and it should create an “out” directory under the output folder - open index.html and see the awesomeness of the reportgenerator output:
If you want to run mstest tests or nunit or something else completely then have a look in the SQLCover.ps1 which includes some examples at the bottom but Get-CoverExe is probably your friend.
Any questions please shout!
September 1, 2016 - 00:07
I was looking at sqlCover.dll code and found that you have defaulted command timeout to 30 sec which is very less to run all test classes for large databases. Are you planning to change it in future version?