Páginas

sexta-feira, 28 de agosto de 2020

DICAS 3055 - WINDEV TUTORIAL 78 -04-09-2020 09Hrs- PROJETO OTIMIZAR E DEPURAR



https://youtu.be/jT504xmXnP0


Bom Dia/Boa Tarde/Boa Noite


Esse Ao Vivo vai estrear as 09:00 do dia 04/09/2020 

DICAS 3055 - WINDEV TUTORIAL 78 -04-09-2020 09Hrs- PROJETO OTIMIZAR E DEPURAR
Tutoriel WINDEV : Leçon 6.2. Optimiser et déboguer - Audits du projet

ASSUNTOS

MUITO TOP, NAO USAVA E AGORA VOU USAR
O QUE VAMOS APRENDER NESSA LICAO 
O QUE É UMA AUDITORIA ESTATICA E DINAMICA 
MOSTRANDO AUDITORIA ESTATICA 
ENTRANDO NO PROJETO OTIMIZA E ENTRANDO AUDITORIA 
ESCOLHENDO AUDITORIA TODO PROJETO
EXPLICANDO O QUE APARECEU NOS RESULTADOS DA AUDITORIA 
EXPLICANDO QUANDO TEM UM CODIGO QUE NAO SE USA MAIS 
MOSTRANDO ELEMENTO ORFAO, JANELA NUNCA CHAMADA
FAZENDO LIMPESA DE ARQUIVOS NAO UTILIZADOS NO PROJETO
ERRO DE VERSAO E ARRUMANDO
EXPLICANDO AUDITORIA DINAMICA
EXECUTANDO O TESTE 
EXPLICANDO O TESTE
EXPLICANDO COMO FAZER ESSA AUDITORIA EM CLIENTE


Video original da Franca

https://youtu.be/Nihd09vTHeY


Playlist Windev TUTORIAL

Repositorio Windev

https://repository.windev.com/


https://youtu.be/3DshsXJ8I2M

https://youtu.be/EqnYJFpvPAI




DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C













Lesson 6.2. Project audits
This lesson will teach you the following concepts
  • What is an audit and what is its purpose?
  • Starting and studying the static audit.
  • Starting and studying the dynamic audit.
Lesson duration

Estimated time: 15 mn
Previous LessonTable of contentsNext Lesson
What is an audit?
Audits provide a set of features that allow you to:
  • automatically improve the quality and performance of a project.
  • monitor the conditions in which it operates more precisely.
Two types of audits are available:
  • The static audit. The static audit performs a detailed analysis of a project and elements. This audit is performed from the project editor.
  • The dynamic audit. The dynamic audit analyzes the behavior of a project during its execution. This audit can be performed in test mode or in the production environment.
We are going to check these audits on the "WD Optimization" project.
Static audit
The static audit is an environment feature used to study the source codes of a project in order to detect different problems and to propose improvements.
  • To start the static audit on the "WD Optimization" project:
    1. On the "Project" pane, in the "Audit and performance" group, expand "Edition audit" and select "Trigger the audition audit".

      Remark

      The static audit of project can also be started from the project dashboard, via the "Static audit and Compilation" widget.
      To do so:
      • enable the Widget if necessary (click the link "Click here to re-enable").
      • click the arrow.
        Static audit Widget
    2. The wizard starts. We are going to define the target of static audit.
      Static audit
    3. Select "Run the static audit on the entire project".
    4. Validate the wizard.
    5. The audit report is displayed:
      Audit report
The static audit includes:
  • The static audit of project.
  • The audit for the content of application library.
  • The audit of setup content.
  • Let's study the topics presented by this report.

Procedure not run

In our project, the audit indicates that a procedure is never run.
In huge projects, you may want to create one or more procedures to perform a process then, further to a code reorganization, the procedure is no longer used but it remains in the project. The presence of unused procedures unnecessarily consumes the resources distributed to the end users.
  • To fix this problem:
    1. Click the [...] button to get more details. The window that lists the dead codes is displayed.
      Procedure not run - Dead code
    2. The "ObsoleteProcedure" procedure is never called. This window is used to:
      • specify that the procedure is still used ("Flag as useful"). In this case, the procedure will not be taken into account anymore during the audit.
      • delete the procedure if it is actually unused ("Delete").
      • see the procedure ("View").
      • find the use cases in the strings for example ("Search").
    3. In our case, this procedure is actually unused, click "Delete".
    4. A window is displayed, asking you to confirm the deletion. Click the "Delete" button to confirm the deletion.
    5. Close the window of dead code (click the cross in the top right corner).
  • In the window of static audit, click the "Refresh" button to update the audit report.

Orphan element

The audit indicates that our project contains an orphan element.
As for the procedures run, you may create windows or reports in order to run a quick test, save them and forget everything about them. The presence of orphan elements in the executable unnecessarily consumes the resources distributed to the end users.
  • To fix this problem:
    1. Click the [...] button to get more details. The window that lists the orphan elements is displayed.
      Orphan element
    2. The "WIN_UnusedWindow" window is never called. The window that lists the orphan elements is used to:
      • specify that the element is still used ("Flag as useful"). In this case, the window will not be taken into account anymore during the audit. This option can be interesting when using a test window specific to the development for example.
      • delete the element if it is actually unused ("Delete").
      • see the element ("View").
      • find the use cases in the strings for example ("Search").
    3. In our case, this "WIN_UnusedWindow" window is actually unused, click "Delete".
    4. Close the window of orphan elements (click the cross in the top right corner).
  • In the window of static audit, click the "Refresh" button to update the audit report.

Cleaning the project

Our project contains several unused files. You have the ability to clean the project in order to keep the necessary elements only. The executable and the client setup is not weighted with images, external files, ... not used.
  • To fix this problem:
    1. Click the [...] button to get more details.
    2. The project cleanup wizard starts. This wizard indicates the unused files that can be deleted.
    3. Go to the next step.
    4. Select the type of cleanup to perform. You can:
      • create a zip file with the useless files.
      • move the useless files into a specific directory.
    5. Validate the option proposed by default and go to the next step.
    6. Finish the wizard.
Our project was optimized according to the tips given by the static audit.
The static audit is used to get an overall status on the source code of your project. Our advice: run it on a regular basis!
Let's see what happens at run time by starting the dynamic audit.
Dynamic audit
The dynamic audit is used to study the application execution. The audit is used to detect problems such as:
  • Excessive memory consumption,
  • Slowness of algorithms used,
  • Errors "hidden" at runtime,
  • ...
A dynamic audit can be performed in a test environment or on a live application.
The "WD Optimization" project contains a specific window triggering errors that can be detected by the dynamic audit.
The dynamic audit and the project test will be started at the same time.
  • To start the dynamic audit on the "WD Optimization" project:
    1. On the "Project" pane, in the "Test mode" group, expand "Test mode" and select "Debug the project while the audit is enabled". The project test is run.

      Remark

      The dynamic audit of the project can also be started from the project dashboard, via the "Execution" widget. To do so:
      • enable the Widget if necessary (click the link "Click here to re-enable").
      • expand the arrow and select "Detailed Go of project".
        Widget on the dashboard
      Remark: The dynamic audit is automatically run whenever the application is started by a project GO. A report is automatically displayed in the project dashboard:
      Widget on the dashboard
    2. Click the "Test window of dynamic audit" button.
    3. Click the different buttons found in the window. At the end of each process, a toast message is displayed to specify that the process is over. For the "Assertion and Exception" option, an assertion is displayed: click "Continue" in order for the message to appear in toast format.
    4. Stop the application test.
    5. The report window of the dynamic audit appears.
Report of the dynamic audit
  • Let's study this window:
    • The top section of this window is used to choose the display mode of data. You can:
      • choose a chronological display (respecting the order in which the events occurred) or an overall display, used to group the different types of problems. In this case, the chronological border allows you to see the position and importance of problems.
      • choose the type of problem to display (error, assertion, ...). This allows you for example to concentrate on the major errors, ...
    • The bottom section of this window displays the different events that occurred and that may cause problems in the application.
  • In this example, the dynamic audit detects several problems:
    • An excessively long caption that is assigned by programming,
    • A SWITCH loop for which no CASE is run,
    • An assertion is triggered instead of an exception,
    • The opening of a file that does not exist,
    • The assignment of a nonexistent image file to an Image control.
    For each problem, a "..." button is used to access the event details. If the event is linked to a specific line of code, the  button allows you to open the code editor directly at the corresponding location in order to fix the problem.
  • Close the window of dynamic audit.

Remark

The dynamic audit of a project can also be performed when an application is deployed on the user computers.
You can:
  • modify the application and use dbgEnableAudit to start the audit.
  • use a text file in the application directory. This solution allows you not to modify the executable. Simply create a file in the same directory and with the same name as the executable, but with a ".WX" extension.
The audit generates a ".wdaudit" file, this file must be loaded in the development environment in order to study the result.
See Dynamic audit for more details.

Nenhum comentário:

Postar um comentário