computer motherboard

Interactive Profiling

This tutorial demonstrates the use of the “Dialog Mode” Launch Dialog, launching the sample application, inspection of coverage results whilst an application is running, choosing options within the test program to increase coverage results, closing the application and inspecting the coverage results.

  • Change the user interface mode to “Dialog Mode”. Select User Interface Mode… on the Configure menu.
    Coverage Validator settings menu
  • The user interface mode dialog is displayed.
    Coverage Validator user interface mode dialog
  • Select the Dialog Mode radio box and click OK.
  • 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
    Coverage Validator re-launch icon
  • If the launch icon is selected the Launch application dialog is displayed.
    Coverage Validator launch dialog

    • 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).
  • Whilst Coverage Validator is instrumenting the application various progress dialogs are displayed. The display of Coverage Validator updates to show the names of source code files and statistics about each file.
    Coverage Validator coverage display
  • Inspect the coverage results for testsvw.cpp.
    Coverage Validator No Hook Control
  • Notice that many points in the function test() have a red cross next to them and a brown background. These lines cannot be instrumented because the machine instructions for these lines are too short for Coverage Validator to intercept. Fortunately Coverage Validator can use more aggressive hooking measures and calculate synthetic results for some lines that are not hookable. Close the test application and open the settings dialog, showing the Hook Control tab.
    Coverage Validator Hook Control
  • Select all the check boxes and click OK.
  • Relaunch the example application. You will notice that coverage results from now on show much more coverage.
  • Inspect the coverage results for testsvw.cpp.
    Coverage Validator interactive code coverage display
  • Examining the coverage results in the source code viewer we can see that OnTestPerformTest()OnTestTest2()test()test2()test3()test4() and test5() have not been tested. Click the Test menu entry for Test1.
  • Inspect the coverage results for testsvw.cpp. Notice that the function relating to the menu entry Test1 now contains coverage results indicating the function has been visited. You may need to click the Refresh button on the display for force Coverage Validator to update the display before the display interval.
    Coverage Validator interactive code coverage display
  • Examining the coverage results in the source code viewer we can see that OnTestTest2()test4() and test5() have not been tested. Click the Test menu entry for Test2.
  • Inspect the coverage results for testsvw.cpp. Notice that the function relating to the menu entry Test2 now contains coverage results indicating the function has been visited. You may need to click the Refresh button on the display for force Coverage Validator to update the display before the display interval.
    Coverage Validator interactive code coverage display
  • Inspect the coverage results for nativeExample.cpp.
    Coverage Validator interactive about code coverage display
  • We can see from the source code viewer for nativeExample.cpp that the “About Box” has not been tested. Click the Help menu entry Help About Coverage Validator Tester…. The “About Box” for nativeExample is displayed. Click OK to dismiss the dialog box.
  • Inspect the coverage results for nativeExample.cpp. Notice that the CAboutDlg methods now contain coverage results indicating various methods of CAboutDlg have been visited. You may need to click the Refresh button on the display for force Coverage Validator to update the display before the display interval.
    Coverage Validator interactive about code coverage display
  • Close nativeExample.exe using the File menu Exit command. The application closes. Coverage Validator processes any remaining data and displays the final results.
  • The coverage results are displayed on the CoverageFunctions and Files and Lines tabs.
    • The Coverage tab displays information relating to the coverage of each source file. Selecting a source file causes the source code for the file to be displayed in the right-hand pane of the splitter window.
    • The Functions tab displays information relating to each class and/or function in the application. Selecting a method causes the source code for the method to be displayed in the right-hand pane of the splitter window.
    • The Files and Lines tab displays information relating to the coverage of each file and line. This allows more detailed analysis than the Coverage tab. Selecting a source file causes the source code for the file to be displayed in the right-hand pane of the splitter window.

The source code display indicates the lines that are instrumented by highlighting the background colour of the line according to its visited, non-visited, or non-instrumentable status. Visit counts are displayed to the left handside of the source code (and optionally in tooltips for each line). A red cross indicates a line that could not be instrumented, a green tick indicates an instrumented line that has been visited.

Fully functional, free for 30 days