Analyzing Test Coverage

Top  Previous  Next

How GuiProf Measures Test Coverage

The method GuiProf uses to measure GUI test coverage is explained in details in chapter What is GUI Test Coverage?. Here is a brief summary:

1.GuiProf assigns a list of events to every GUI object in the application under test (AUT). Each of these events must occur in order to consider the object as fully tested.
2.During profiling, GuiProf records all the events that actually occur.
3.During coverage analysis, GuiProf matches GUI objects with events that have occurred.
4.An event is considered tested if it occurred at least once.
5.Test coverage for a GUI object is the number of tested events divided by the number of possible events.
6.Test coverage for a GUI object with children is the total number of tested events for all children and the object itself, divided by the total number of possible events for all children and the object itself.

How GuiProf Displays Test Coverage

Simple Object

To illustrate how GuiProf shows test coverage, let's use a text box in the demo application as an example. After profiling you get the following picture on your screen:

sh_analyzing_test_coverage_object

Here we have selected the text box in the tree view. On the right, you see the detailed information about this object.

Let's look at the list of events. There are 2 events: Enter and TextChanged. Event Enter has occurred once and is considered tested. Event TextChanged has not happened yet and is shown in red.

In the Test Progress view you can see the event summary for this object: how many events it has and how many of them has been tested. The percentage shows the test coverage for this objects. The large test project bar displays the test coverage graphically. The small test progress bar in the tree view shows the same value as the large progress bar.

Object with Children

Now we can have a look at the main form of the demo application. After selecting it in the tree view you will see the following picture:

sh_analyzing_test_coverage_form

This form has 7 children. 2 of them are fully tested. 3 are not tested at all. One (the text box from the previous example) is partially tested. One object, a label, is non-testable: the user cannot do much with a label. In the Test Progress view on the right you will see the summary of this information. In the Tested events box you will now see the summary for the form itself and its children. Both small and large progress bars also display this summary.

Typical Tasks

Finding Untested Objects

You can use filters to find untested objects in your program. To do that, activate the filter for untested objects by pressing filter_untested on the toolbar, and deactivate the other filters. If you want to see also the objects that have been partially tested, activate the the corresponding filter filter_partially_tested.

Filtering Out Non-Testable Objects

A typical program contains many GUI objects that are static by nature. For instance, the label only displays a static text. The user cannot interact with it. Such objects are called non-testable. In a typical application about 25% are non-testable. They do not influence test coverage and distract your attention. You can filter them out by deactivating filter filter_non_testable.

Estimating Overall Test Progress

If you select the root node in the tree view, you will see the test progress summary for the whole program. You will know how many GUI objects are there and how many of them are testable. GuiProf displays the number of events to test. It roughly corresponds to the amount of work the tester has to do. GuiProf also displays how many events have already been tested, so that you can estimate the effort required for the rest of the tests.

See Also

What is GUI Test Coverage?

Profiling

Filters