Version 4 of Coverage Analysis

Updated 2003-07-28 13:31:46

An advanced feature of Dynamic Debuggers.

While executing application the debugger collects information which source commands were exected (files, lines). After the run this is used to display which paths of the application have been covered by the run and which not.

This is especially useful when writing a testsuite, as execution of the testsuite allows the developer to determine if all parts of the tested application or package have been exercised by the tests.

This is related to Hotspot Analysis. The latter is an extension of this analysis, by not only remembering which lines were executed, but also how often.

has this type of analysis ever been done on the tcl and tk source distributions, to determine how much of the code is being tested by the test suites?

KBK - In what sense do you mean that question? If you're asking whether coverage analysis is available for Tcl scripts, the answer is yes: Tcl Dev Kit, among others, offers it. If you're asking whether coverage analysis has been done on Tcl/Tk's own source code, I'm not sure about the answer. The maintainers don't do it routinely, as far as I know. I tried running PureCoverage on Tcl/Tk with the test suite a few years ago, and the coverage was quite good.

Coverage analysis is only a guide. It's not wise to obsess about it as Dilbert's boss sometimes does. Insisting upon 100% test coverage is contrary to "defensive programming", where it's common to put in code to report, if not handle, "impossible" cases.

[ Category Concept

Category Debugging ]