Instrumenting an Executable File
LiveCoverage uses a patented technology which inserts probes into your
program as it is running to monitor test coverage. As a result, it is not
necessary to "instrument" your program in the way other test coverage
tools would.
There is still an option to instrument your program. But with
LiveCoverage, this refers only to adding a tiny slice of code that "wakes
up" LiveCoverage whenever your program starts running. Without it,
LiveCoverage must launch your program (at least indirectly) to monitor
test coverage.
Tips on Choosing
If you will be running tests manually or semi-manually, it is usually
simplest to have LiveCoverage start your program for you without using
instrumentation.
If you have a fully automated test suite of significant complexity,
then instrumentation is the surest way to get test coverage working
quickly.
Here are the pros and cons of using and not using instrumentation:
Using Instrumentation
Advantages
- No changes are needed in any part of your
test process. Simply start up LiveCoverage's test coverage monitoring,
then start your tests. Each time your program is run, LiveCoverage will
automatically "hook up" and start monitoring it for test coverage.
- If your program is launched by the system, as in the case of an
out-of-process COM server, LiveCoverage will still monitor it.
Disadvantages
- The instrumentation process modifies your
executable file. This essentially creates a new "version" of your
program that must be kept distinct from a version you would release to
your users.
- LiveCoverage will not know when your testing is
complete. It will continue to monitor for test coverage until it is
stopped manually.
- The executable file is never enlarged by
instrumentation; the added code is fit into unused space in the file.
This leaves at least the theoretical possibility that a file cannot be
instrumented because there isn't enough unused space within it.
- Only .EXE files can be instrumented, not .DLL files. All DLL's
running with an instrumented EXE are automatically monitored for test
coverage. However, a DLL running with an uninstrumented EXE will not be
monitored.
No Instrumentation
Advantages
- There are no modifications made to your
executable files, and no additional "versions" to keep track of.
- Because LiveCoverage starts the test process, it knows when it
finishes. At completion, LiveCoverage will automatically stop coverage
monitoring and save the results.
Disadvantages
- LiveCoverage must launch your program, at least
indirectly. LiveCoverage can monitor through a chain of launches, such
as a batch file launching a VB test driver which repeatedly launches your
program. However, each step in the chain must be a 32-bit
program. For example, the Windows 95/98 command line processor
COMMAND.COM is a 16-bit program, and LiveCoverage cannot monitor any
program it might launch. This could require a change in your testing
process.
- An out-of-process COM server is launched by the system, not
LiveCoverage, and cannot be monitored without instrumentation.
Once You've Chosen
Once you have chosen whether or not to use instrumentation, you must
set the project's properties accordingly. By default, a new project will
not be set to use instrumentation.
Use the Properties command on the Test menu to display the project's
Properties dialog. The dialog contains one page for the Project Properties, plus one page of Executable File Properties
for each executable file in the project. Make the following changes:
To Use Instrumentation
Not Using Instrumentation
- On the Project
Properties page, set the Command Line
text box to the program you want LiveCoverage to launch, including
any command line parameters. By default, LiveCoverage will have filled
in the name of one your executable files.
- Also on the Project
Properties page, fill in the Initial Folder
text box with the initial folder for the program being launched. If this
is left blank, the program will launch in the folder of its
executable file.