jbarker7 / sqlcc

SQL Code Coverage - SQLCC is a code coverage tool that allows developers the ability to track which lines of code within stored procedures, functions, and triggers have been tested in SQL server by integration tests written by the developer.
BSD 4-Clause "Original" or "Old" License
26 stars 22 forks source link

Check out these DLLs #6

Closed curarepilot closed 9 years ago

curarepilot commented 11 years ago

I was implementing the SQLCC code (actually rewriting in Java) and trying to understand the code. I wasn't a fan of the regexp steps and started to look for an alternative. I ran into two .NET dlls: Microsoft.Data.Schema.ScriptDom.dll and Microsoft.Data.Schema.ScriptDom.Sql.dll. These can parse the source from a stored procedure and will tokenize it. From those tokens I build a list of statements that should get executed. Then from the trace I get the executed statements. From those two lists I calculate the statement coverage percentage. No regexp anymore. I also changed the output format to look more like Java's code coverage tool Cobertura. See this link for a rough idea of the summary page: http://www.ibm.com/developerworks/library/j-cobertura/

All in all, thanks for a great idea!!

jbarker7 commented 9 years ago

The reason I did not use these is for a few reasons.

1) adds a dependency on that assembly. Isn't a small assembly. 2) tried to make it somewhat generic so that other providers could be built for Postgres, MySql, etc.