July 9, 2008

...Learn TDD with Codemanship

Finding Untested New Or Changed Methods Using NDepend

NDepend users may be pleased to hear that they can indeed look for untested new or changed code. According to Patrick Smacchia:

Yes you can play with both comparison and test coverage.
Btw, we added a set of default rules/queries about that,
in Diff / Changes / Evolution -> Test Coverage of Changes Summary
and personally it is my favourites queries

...

// Method changed partially covered by tests
SELECT METHODS WHERE
PercentageCoverage < 100 AND PercentageCoverage > 0 AND
CodeWasChanged
ORDER BY PercentageCoverage DESC , NbLinesOfCodeCovered ,
NbLinesOfCodeNotCovered


// Method added partially covered by tests
SELECT METHODS WHERE
PercentageCoverage < 100 AND PercentageCoverage > 0 AND
WasAdded
ORDER BY PercentageCoverage DESC , NbLinesOfCodeCovered ,
NbLinesOfCodeNotCovered


// Method changed not covered at all
SELECT METHODS WHERE PercentageCoverage == 0 AND CodeWasChanged ORDER
BY NbLinesOfCode DESC


// Method added not covered at all
SELECT METHODS WHERE PercentageCoverage == 0 AND WasAdded ORDER BY
NbLinesOfCode DESC







Posted 3 days, 20 hours ago on July 9, 2008