Test Coverage

Official Content
This documentation is valid for:

This feature is usefull to see what coverage a test does of his called objects for a particular test execution.

Set up

To use it, the first thing to do is enable Code Coverage for your environment.

Once it's enabled, the test objects may need to be rebuilt. You can perform a "Rebuild All Tests" operation under "Test" menu to achieve that. 

Test Coverage information

Finally you can run the tests and, after the execution is finished, you should see something like the image above.

image_20191217161017_1_png

Coverage percentage shown in column Coverage (%) is calculated as follows:

Given a test, coverage information about all it's called objects (Procedures and Data Providers) is summarized and calculated taking into account only direct relative objects (the ones called directly by the test).

When a test doesn't call any other testable object, a minus sign is shown (e.g. test AssertXMLs in previous image).

Example

There is a test X that calls to procedure A and data provider B. 

If during execution of test X, 8 of 10 lines of object A and 2 of 10 lines of object B were executed, the coverage for that test for that execution will be 50% ( ((8 + 2) /(10 + 10)) * 100); regardless of any other object that could be called by objects A or B.

Note: In case you want to view even more details about coverage, you always can open Code Coverage window and load the file from file system. Note that the path of the generated code coverage file by GXtest is logged in GeneXus IDE log.

Availability

This feature is available since GeneXus 16 upgrade 8.