A method, apparatus and article of manufacture for collecting coverage
data. In one embodiment, a method is provided for collecting coverage
data for a code portion which, when compiled and linked, becomes a module
of a program. The method comprises configuring the code portion settings
such that when the module is instrumented coverage data will be gathered
for the module; and instrumenting the code portion according to the
settings and only for those statements for which no coverage data exists.
Coverage data can then be collected, for example, each instance the
module is executed, each instance the module is executed as part of a
particular program, or each instance the module is executed by a
particular user.