When building with Insure++, the source code is instrumented and mutation testing is performed. Insure++ then compiles and links the instrumented code with your native compiler. Test results are reported in the Insra interface (see Working with Results in Insra). Insure++ is also able to report code coverage data with TCA (see Analyzing Coverage with TCA). 

Recompile your program with Insure++ instead of your normal compiler and run the program under Insure++. The Insra component will report errors and include details that help you track down and correct problems. 

Instrumenting and building your project with Insure++ provides thorough error detection. When you run non-instrumented code under Insure++, however, Insure++ is still able to perform less-thorough error detection on that code. For the most thorough checking possible, compile and link source code with Insure++. You can then run the program as normal. For example commands, see Example Compilation and Linking Commands.

When you do not have the time to build and run an instrumented application, re-link your code with Insure++ and run the program as normal. This provides a basic level of checking for heap corruption, errors in calls to common C functions, and memory leaks. For example commands, see see Example Compilation and Linking Commands.

Compiling with Insure++ creates a version of your code that includes calls to the Insure++ library. The instrumented code is passed to your normal compiler. During the compilation an execution, Insure++ detects and reports various programming errors. See Errors Detected for an exhaustive description of the types of errors detected. For each error reported, you will see the source line that appears to be incorrect and an explanation of what type of error occurred. Normally, Insure++ sends its output to stderr, but it can send its output to Insra, a graphical tool for viewing error messages. For more information, see Working with Results in Insra.

Example Compilation and Linking Commands

The simplest way to compile and link source code with Insure++ is to prepend your normal compile and link command lines with insure. The following table shows some examples:

Without Insure++With Insure++
gcc -c foo.cinsure gcc -c foo.c
g++ -c bar.ccinsure g++ -c bar.cc
/usr/local/gcc-3.4.0/bin/g++ -c bar.ccinsure g++ -o bar foo.o bar.o

Refer to the Configuration Options (psrc) section for details about controlling the behavior of Insure++ and programs compiled with Insure++.

You can use the same options that you normally use to compile and link your program. For example, you would use the following command to to build bubble1.c:

insure cc -g -o bubble1 bubble1.c

If you have a makefile that uses the variable CC to define the compiler name, you can build your program with Insure++ by using the command make CC=’insure.cc.