Download χSuds Software Understanding System User`s Manual

Transcript
ATAC: Instrumenting Your Software
User’s Manual
The NOTTESTED comment may be inserted anywhere in the code that a comment is
allowed. ATAC will not report coverage for the block containing the comment (or the next
block if the comment is outside any block) nor for any following block that can only be
reached by passing through that block. If the NOTTESTED comment appears outside of
any subroutine, ATAC will not report coverage for the subroutine following the comment.
For example in the program dEcho.c:
/* dEcho program */
int dFlag, dCount;
/* NOTTESTED:debug */
dBug()
{
if (dFlag)
printf(“D: %d\n”, dCount);
}
main(int argc, char *argv[])
{
int i;
for (i = 1; i < argc; ++i) {
++dCount;
if (!strcmp(argv[i], “-d”)) {
dFlag = 1;
}
else printf(“%s ”, argv[i]);
}
putchar(‘\n’);
dBug();
return 0;
}
/* NOTTESTED:debug */
Coverage is not reported for the entire dBug function nor for the dFlag = 1 statement.
The -T option of the atac command may be used to include code marked NOTTESTED in
the coverage computation. The -R option may be used for code marked NOTREACHED.
For example the block coverage on the program above before any tests are run is given by:
prompt:> atac -s -mbT dEcho.atac
% blocks
------------0(0/8)
== total ==
5-11