P r o g r a m m e r s T o o l
|
|
The Haskell Program Coverage Toolkit |
| Status | Active | | Collaborators | Colin Runciman | | History | Started in 2006, during Colin's sabbatical at Galois | | Summary | Hpc is a tool-kit to record and display Haskell
Program Coverage. Hpc includes tools that instrument Haskell programs
to record program coverage, run instrumented programs, and display the
coverage information obtained.
Hpc works by applying a source-to-source transformation; this
transformation also generates as a by-product a program-index
file (.pix) and module-index files (.mix). The transformed
program is compiled with a library; in addition to its usual
run-time behavior the program generates a coverage record in
a program-ticks file (.tix). If the program is run more than
once, coverage data is accumulated to reflect all runs.
Hpc provides coverage information of two kinds: source
coverage and boolean-control coverage. Source coverage is the
extent to which every part of the program was used, measured
at three different levels: declarations (both top-level and
local), alternatives (among several equations or case
branches) and expressions (at every level). Boolean coverage
is the extent to which each of the values True and False is
obtained in every syntactic boolean context (ie. guard,
condition, qualifier).
Hpc displays both kinds of information in two different ways:
textual reports with summary statistics (hpc-report) and
sources with colour mark-up (hpc-source). For boolean
coverage, there are four possible outcomes for each guard,
condition or qualifier: both True and False values occur; only
True; only False; never evaluated. In hpc-source output,
highlighting with a yellow background indicates a part of the
program that was never evaluated; a green background indicates
an always-True expression and a red background indicates an
always-False one. |
| Resources |
[Hpc Home Page] [HPC Paper] |
|