PC SOFT

WINDEV的在线文档

  • Overview
  • Performing a dynamic audit from the development environment
  • Starting a dynamic audit during the project test
  • Starting a dynamic audit during the automatic tests
  • Performing a dynamic audit in the deployed application
  • Overview
  • Starting a dynamic audit by programming
  • Starting a dynamic audit by using the ".WX" file
  • Starting a dynamic audit in an application currently run
  • Analyzing a dynamic audit
  • Opening the status report of the dynamic audit
  • Window for analyzing a dynamic audit
  • Types of events collected by the dynamic audit
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
The dynamic audit of an application is used to analyze its performances at run time. A dynamic audit can be performed in a test environment or on a live application. The audit is used to detect problems such as:
  • Excessive memory consumption.
  • Slowness of the algorithms used.
  • Errors "hidden" at run time.
  • ...
A dynamic audit can be performed:Then, the status report of the dynamic audit can be viewed and analyzed in the project editor.

Performing a dynamic audit from the development environment
The dynamic audit can be started:
  • during the project test.
  • 16版本和更高版本
    during the automatic tests.
    16新版本
    during the automatic tests.
    during the automatic tests.

Starting a dynamic audit during the project test

19版本和更高版本
1. Automatic dynamic audit
During each window or project GO, a dynamic audit is performed in background task, without slowing down the execution. When the test is ended, the number of problems that occurred is displayed in the "Dynamic audit" Widget of the Project dashboard.
To see the detailed status report, all you have to do is click the Widget.

To disable this automatic dynamic audit:

  1. Click the Widget arrow.
  2. Uncheck "Dynamic audit enabled".
In this case, no audit will be performed during a test via a simple GO: the dynamic audit will have to be explicitly started during the project test.
19新版本
1. Automatic dynamic audit
During each window or project GO, a dynamic audit is performed in background task, without slowing down the execution. When the test is ended, the number of problems that occurred is displayed in the "Dynamic audit" Widget of the Project dashboard.
To see the detailed status report, all you have to do is click the Widget.

To disable this automatic dynamic audit:

  1. Click the Widget arrow.
  2. Uncheck "Dynamic audit enabled".
In this case, no audit will be performed during a test via a simple GO: the dynamic audit will have to be explicitly started during the project test.
1. Automatic dynamic audit
During each window or project GO, a dynamic audit is performed in background task, without slowing down the execution. When the test is ended, the number of problems that occurred is displayed in the "Dynamic audit" Widget of the Project dashboard.
To see the detailed status report, all you have to do is click the Widget.

To disable this automatic dynamic audit:

  1. Click the Widget arrow.
  2. Uncheck "Dynamic audit enabled".
In this case, no audit will be performed during a test via a simple GO: the dynamic audit will have to be explicitly started during the project test.

2. Dynamic audit explicitly started
To explicitly start a dynamic audit during the project test:
  1. Open the project to analyze.
  2. Select "Project .. Test mode .. Debug the project while the audit is enabled". The project starts.On the "项目" pane, in the "测试模式" group, expand "测试模式" and select "Debug the project with the audit enabled". The project starts.
  3. Handle the project in order to use the features that must be audited.
  4. Close the application.
The editor opens the report window of the dynamic audit. The status report of the dynamic audit is also displayed in the "Debugger trace" pane.

16版本和更高版本

Starting a dynamic audit during the automatic tests

To start a dynamic audit during the automatic tests:
  1. Open the project to analyze.
  2. Select "Automatic tests .. Enable the dynamic audit during the automatic tests".On the "自动测试" pane, in the "测试" group, expand "运行" and select "Enable the dynamic audit during the automatic tests".
The dynamic audit will be performed when an automatic test is run. The report window of the dynamic audit is displayed at the end of the test. The status report of the dynamic audit is also displayed in the "Debugger trace" pane.
16新版本

Starting a dynamic audit during the automatic tests

To start a dynamic audit during the automatic tests:
  1. Open the project to analyze.
  2. Select "Automatic tests .. Enable the dynamic audit during the automatic tests".On the "自动测试" pane, in the "测试" group, expand "运行" and select "Enable the dynamic audit during the automatic tests".
The dynamic audit will be performed when an automatic test is run. The report window of the dynamic audit is displayed at the end of the test. The status report of the dynamic audit is also displayed in the "Debugger trace" pane.

Starting a dynamic audit during the automatic tests

To start a dynamic audit during the automatic tests:
  1. Open the project to analyze.
  2. Select "Automatic tests .. Enable the dynamic audit during the automatic tests".On the "自动测试" pane, in the "测试" group, expand "运行" and select "Enable the dynamic audit during the automatic tests".
The dynamic audit will be performed when an automatic test is run. The report window of the dynamic audit is displayed at the end of the test. The status report of the dynamic audit is also displayed in the "Debugger trace" pane.

Performing a dynamic audit in the deployed application

Overview

The dynamic audit can be started:
  • by programming.
  • WinDev via the WX file.
  • WinDev via a key combination.

Starting a dynamic audit by programming

To start a dynamic audit by programming, all you have to do is use 调试启用审核.

The audit generates a ".wdaudit" file. This file must be loaded in the development environment in order to analyze the result.

Note: To analyze the result of an application audit, the project corresponding to this application must be opened in WinDev, WinDev Mobile or WebDev.

WinDev

Starting a dynamic audit by using the ".WX" file

You also have the ability to audit an application in its production environment without modifying the executable: all you have to do is create, in the directory of the executable, a file named like the executable and whose extension is ".WX".

This file will have the following format:

[AUDIT]
ACTIVE = 1 (or 0 to disable the audit)
FILE = <path of the .waudit file to generate>
OPTION = <combination of the options of dbgEnableAudit>

In this file, the OPTION key can take the following values:
  • "CA": The audit comments are written into the dynamic audit.
  • "WA": The execution warnings regarding the detected anomalies are written into the dynamic audit.
  • "WP": The execution warnings regarding the performances are written into the dynamic audit.
  • "EA": The assertions are written into the dynamic audit.
  • "ER": The non-fatal errors not processed are written into the dynamic audit.
  • "EX": The fatal errors, processed by WHEN EXCEPTION or not processed, are written into the dynamic audit.

The audit generates a ".wdaudit" file, this file must be loaded in the development environment in order to analyze the result.

Note: To analyze the result of an application audit, the project corresponding to this application must be opened in WinDev or WebDev.

WinDev

Starting a dynamic audit in an application currently run

To start recording a runtime audit, press CTRL + ALT + A. This shortcut operates like the call to 调试启用审核.

Analyzing a dynamic audit

Opening the status report of the dynamic audit

The status report of the dynamic audit is a file whose extension is ".waudit".

To open this file, you can:

  • Open the file in the editor directly: on the "首页" pane, in the "常规" group, click "打开" and select the audit file.
  • 19版本和更高版本
    use the "Dynamic audit" Widget of the project dashboard: click the Widget arrow and select "Open an audit". Then, select the audit file.
    19新版本
    use the "Dynamic audit" Widget of the project dashboard: click the Widget arrow and select "Open an audit". Then, select the audit file.
    use the "Dynamic audit" Widget of the project dashboard: click the Widget arrow and select "Open an audit". Then, select the audit file.

Window for analyzing a dynamic audit

When loading a dynamic audit, the following window is displayed:
Result of a dynamic audit
  • 1: Name of the audit file currently analyzed.
  • 2: Period of time during which the audit was performed.
  • 3: Selecting the period of time to view. The range slider can be used to browse part of the audit when this one was performed on a long period of time. The range slider covers the entire duration of the audit. The active section of the control (modifiable with the arrow keys) is displayed below. This area can be clicked and it automatically selects the event closest to the moment that was clicked (in the list of events).
  • 4: Display mode of the audit events. The events of the audit can be displayed in in a chronological order in the list of events or they can be grouped by family of events.
  • 5: Filtering button used to choose the types of events that will be displayed.
  • 6: List of events displaying all the elements collected by the audit. On each table row:
    • a "..." button is used to access the details of the event.
    • if the event is linked to a specific code line, the "Code" button is used to to directly open the code editor at the corresponding location.
    • 19版本和更高版本
      the "-" button is used to disable the error. CAUTION: The error will no longer be displayed if it is disabled. It cannot be re-enabled.
      19新版本
      the "-" button is used to disable the error. CAUTION: The error will no longer be displayed if it is disabled. It cannot be re-enabled.
      the "-" button is used to disable the error. CAUTION: The error will no longer be displayed if it is disabled. It cannot be re-enabled.

Types of events collected by the dynamic audit

The different types of events collected by the dynamic audit are:
  • The exceptions: an exception is a fatal error of the application (unless it is intercepted in a WHEN EXCEPTION block). An exception can be voluntarily generated by 异常抛出.
    All the exceptions are reported by the dynamic audit (exceptions processed by programming or exceptions that have stopped the application). In most cases, an exception is the result of a programming error.
  • The errors: an error can be triggered by a WLanguage function to signal the failure of an operation (for example, 文件删除 returns an error if the deletion of the requested file failed). The errors can also be triggered by the developer via 错误抛出.
    In most cases, an error is caused by an invalid action of the application user or by a failure in the application environment.
  • The runtime warnings: these warnings are reported by some WLanguage functions to signal a potential problematic behavior but that causes no error. For example, if the WLanguage detects a performance problem in the code of the application.
    20版本和更高版本
    Example: using zip提取文件 in a loop to extract an important number of files from a Zip or 7z archive is not very efficient. We recommend that you use zip提取文件列表.
    20新版本
    Example: using zip提取文件 in a loop to extract an important number of files from a Zip or 7z archive is not very efficient. We recommend that you use zip提取文件列表.
    Example: using zip提取文件 in a loop to extract an important number of files from a Zip or 7z archive is not very efficient. We recommend that you use zip提取文件列表.
  • The assertions: the runtime audit reports all the calls to 调试断言 in which the condition turned out to be False.
  • The debugging events: these events are triggered by the call to the debugging functions (调试保存内存泄露 for example).