$ mkdir tutorial $ gzip -dc /usr/local/tutti/etc/tutorial.tgz | tar xvf -
$ make $ ./test_addressAfter execution, we see that the program issues some addresses to the screen. First we analyse the code with QAC:
$ make clean $ make CC=qac_compiler $ qac_scan address.c,85:++ WARNING ++: <=8=(0179) Argument type does not match conversion specifier number TEXT address.c,170:++ WARNING ++: <=8=(0748) [U] 'TEXT()' has a result type of 'int' but no 'return' statement specifies an expression - the returned value is undefined. address.c,195:++ WARNING ++: <=3=(3321) The variable 'TEXT' may be unset at this point. address.c,203:++ WARNING ++: <=3=(3321) The variable 'TEXT' may be unset at this point. address.c,219:++ WARNING ++: <=8=(0179) Argument type does not match conversion specifier number TEXT Verdict : failFrom the output we conclude that the code has some serious problems (although the code seems to behave correct!). In a `real-life'' software project it would be recommended to first solve these problems before continuing. We can analyse the dynamic behavior using insure as follows:
$ make clean $ make CC=insure_compiler $ ./test_address $ insure_scan address.c:28: LEAK_ASSIGN address.c:195: COPY_WILD address.c:195: READ_UNINIT_MEM(copy) address.c:12: LEAK_FREE VERDICT: FailThe results indicate a few errors. With gcov we analyse the quality of the test design based upon code coverage:
$ make clean $ make CC=gcov_compiler $ ./test_address $ gcov_scan In file : address.c 63% (statement) coverage Verdict : failIt can be conluded that only 63% statement coverage is achived by the current test.