ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Test
  • Overview
  • How to view the code coverage?
  • Project dashboard
  • Project explorer
  • Code editor
  • Configuration of data displayed by code coverage
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The code coverage is the measure regarding the coverage of tests run on an application or site. Each line of code run is considered as being "checked". The "manual" tests (lines of code run during a GO for example) and the automated tests are taken into account.
Caution: The code coverage does not allow you to find out whether tests are successful: it only allows you to find out whether the line of code was run.
The code coverage is used to detect the lines of code of an application that have never been run.
These lines of code are found in all application elements:
  • window,
  • control,
  • procedure,
  • method,
  • "code section",
  • ...
The code coverage gives a good idea of test level regarding the application code.
Remark: The code coverage collects:
  • individual data in a ".wdcoverage" file found in the project directory.
  • team data in the database of Control Centers. Therefore, it is shared between the different users of Control Centers. This allows you to get statistics regarding the team that is working on the same project.
How to view the code coverage?
The code coverage can be viewed from several locations:
  • Project dashboard,
  • Project explorer,
  • Code editor.

Project dashboard

The code coverage is viewed in the project dashboard via a specific widget named "Coverage".
This widget displays a chart showing the percentages of tested and untested code.
A click on the widget arrow is used to expand the widget menu. This menu is used to:
  • Display the result of last GO. In this case, only the code coverage regarding the last GO of current configuration is displayed.
  • Display personal results. In this case, the code coverage regarding the current developer on the current configuration is displayed. The data of GO and automated tests is taken into account.
  • Display team results. In this case, the code coverage regarding all the developers working on the current configuration is displayed. The data of GO and automated tests is taken into account.
  • Enable or disable the widget (to display or not the data of code coverage in the project dasboard.
  • Display coverage in the code. Used to display the lines whose test was run in the code editor.
Remark: These actions can also be performed from the "Automated tests" tab. For more details, see Configuration of data displayed by code coverage.

Project explorer

The project explorer displays the code coverage for each element found in the explorer. A chart is displayed for each element corresponding to the percentage of code run for this element.
A specific information is displayed in a tooltip when this chart is hovered by the mouse cursor.
The information displayed in the project explorer relates to the current configuration..
You have the ability to configure the information displayed. For more details, see Configuration of data displayed by code coverage.

Code editor

In the code editor, you have the ability to see the code whose test was run. To enable this feature:
  • from the "Coverage" widget, selectionnez "Display the coverage in the code".
  • on the "Automated tests" tab, in the "Code coverage" group, click "Display in the code". If this option is highlighted, the display in the code is enabled.
The code whose test was run is displayed on a blue background.
Remark: The display in the code depends on:
Configuration of data displayed by code coverage
The data displayed by the code coverage is configured via the "Automated tests" tab in the ribbon.
To select the type of data to display:
  1. On the "Automated tests" tab, in the "Code coverage" group, expand the first option.
  2. Select the data to display:
    • Last GO. In this case, only the code coverage regarding the last go of current configuration is displayed.
    • Personal total. In this case, the code coverage regarding the current developer on the current configuration is displayed. The data of GO and automated tests is taken into account.
    • Team total. In this case, the code coverage regarding all the developers working on the current configuration is displayed. The data of GO and automated tests is taken into account.
    • None. The code coverage is not displayed.
  3. The displayed data is automatically refreshed.
To reinitialize the data:
  • Personal data: On the "Automated tests" tab, in the "Code coverage" group, click "Reinitialize personal data". The personal data is deleted for the project and the current configuration.
  • Team data: On the "Automated tests" tab, in the "Code coverage" group, click "Reinitialize personal data". The team data is deleted from the database of Control Centers for the project and the current configuration.
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help