Static Analysis Tutorial: 3 - Exploring Links Between Routines and Classes

Applies to AQTime 8.81, last modified on January 18, 2022

Besides displaying such information about routines as size of binary code, size in source code lines, code type, etc. the Static Analysis profiler also traces and displays information on links between routines and links between classes. For example, let's find which routines call the DoActionC routine in our sample application and which routines DoActionC calls:

  • Make certain that the Routines Data category is selected in the Explorer panel.
  • Locate DoActionC in the Report panel. You can do this, for example, by focusing the Routine Name column in the Report panel and typing Form1::DoActionC (if the Routine name with class name button on the Report toolbar is not pressed, skip the class name, that is, type DoActionC). AQTime will search for the routine while your are typing. You can also find the routine by using the Find dialog. For more information, see Searching Results.
  • After DoActionC is found in the Report panel, AQTime will update other panels so that will displaying information concerning DoActionC. Switch to the Details panel. The Parents table in this panel displays routines which call DoActionC. The Children table shows routines which DoActionC calls.
    Child functions of the Form1::DoActionC routine

    Click the image to enlarge it.

    Child functions of the Form1::DoActionC routine

    Click the image to enlarge it.

    Child functions of the Form1::DoActionC routine

    Click the image to enlarge it.

    As you can see, besides routine names, these tables show information that will help you locate parent and child routines in source code. The Call Count column of the Parents table shows the number of times a parent routine call DoActionC and the Call Count column of the Children table shows the number of times DoActionC calls each child routine.

Note that these are potential calls. The actual number of calls can be measured only during application execution. The Static Analysis profiler does not launch the application under test, so it can report about potential calls only. If a child function, is called in a loop or within the if then statement, the actual and potential number of calls will differ.

If you double-click a routine in the Parent or Children table, AQTime will update its panels so that they will display information for the clicked routine. For instance, the Details panel will show information on parent and children functions for that routine.

To browse the hierarchy of function calls, you can use the Call Graph and Call Tree panels. For example:

Parent-child relationships in the Call Graph panel

Click the image to enlarge it.

Parent-child relationships in the Call Graph panel

Click the image to enlarge it.

Parent-child relationships in the Call Graph panel

Click the image to enlarge it.

To view call relationship between classes (what methods of a class call methods of another class):

  • Select the Classes Data category in the Explorer panel.

  • Select the desired class in Report and then switch to the Details panel.

  • The Class Callers table of the Details panel  contains classes whose methods call methods of the selected class. The Caller Routines table contains the names of caller methods. The Class Callees table contains classes whose methods are called by methods of the selected class, and the Callee Routines table contains the names of callee methods.

    Information about classes in the Details panel

    Click the image to enlarge it.

    Information about classes in the Details panel

    Click the image to enlarge it.

    Information about classes in the Details panel

    Click the image to enlarge it.

The Static Analysis profiler offers two result views, Leaf routines (classes) and Non-leaf routines (classes), and that let you easily see only those routines or classes that have or have no callees. To apply a view, simply select it from the View > Result Views menu or from the Result Views dropdown list on the Standard toolbar.To apply a view, select the AQTime > Views menu item and then choose the desired view in the ensuing Result Views dialog.To apply a view, click the Result Views button and then choose the desired view in the ensuing Result Views dialog. Note that this button does not reside on any toolbar by default. However, you can add the button to any RAD Studio’s toolbar via the Toolbar Customization dialog. In this dialog, switch to the Commands page, select the View.AQTime category in the Categories list, drag the Result Views command from the Commands list and drop it on the needed toolbar.

Prev

See Also

Static Analysis Profiler

Highlight search results