This tutorial demonstrates identifying unused code in an application. The example application has some code in it that is deliberately unused, so that we can demonstrate how to identify unused code.
Launch the sample application. Click on the launch icon on the toolbar. Alternatively to relaunch the most recently launched application, click the launch icon with a green recycle arrow around it
If the launch icon is selected the Launch application dialog is displayed.
Select the sample application nativeExample.exe using the Browse… button, or select a previously executed application from the list at the bottom of the dialog.
Click the Go! button to launch the application.
The nativeExample.exe application is started.
If the relaunch icon is selected the most recently started application is started (for this tutorial we will assume this is nativeExample.exe).
Exercise as much of the application as possible. For this tutorial, the following actions should be peformed:
Help menu, About Coverage Validator Tester….
Test menu, Test 1.
Test menu, Test 2.
File menu, Exit.
At the end of the test it can be seen that one of the source code files has had no lines visited. This file is TestMemoryDialog.cpp.
Further examination of this file shows that it contains the class CTestMemoryDialog. Searching the source code for the application shows that this class is not used anywhere. This indicates this class is most likely surplus to requirements and can be removed from the build.
Why is Coverage Testing Important?
Why Coverage Testing should be a vital part of your software quality process.
Working with statically linked applications.
Working with dynamically linked applications.
Profiling the sample application.
Profiling the sample application, take two.
Wizard Mode/Dialog Mode.
Using visual results to guide testing
Combining multiple sets of coverage results.
Combining multiple sets of coverage results without human interaction.
Running from the command line.
Running and merging from the command line.
Automatically identifying untested code.
Identifying unused code using Coverage Validator.
Improve your software quality.
Application, Service or Webserver? Native, .Net or Mixed Mode?
Interactive, command line, build server or test suite?
Debug your hardest problems using our software tools.