Definition-use graph static analysis example

De Software testing
Revisão de 19h39min de 18 de setembro de 2009 por Magsilva (discussão | contribs)
(dif) ← Edição anterior | Revisão atual (dif) | Versão posterior → (dif)
Ir para: navegação, pesquisa

Consider the graph below:

DUG - Example 1.svg

Examining the define-use-kill patterns along the control flow paths in the DUG and considering the variable x as we traverse the left and then the right path, as shown in the graphs below, we have the following life-cycles of x: ~d (correct), dd (suspicious) and du (correct).

DUG static analysis - Example 1 - Variable x - Path 1.svg DUG static analysis - Example 1 - Variable x - Path 2.svg

Examining the define-use-kill patterns along the control flow paths in the DUG and considering the variable y as we traverse the left and then the right path, as shown in the graph below, we have the following life-cyles of y: ~u (major blunder), ud (acceptable), du (correct), uk (acceptable), dk (probable programming error).

DUG static analysis - Example 1 - Variable y - Path 1.svg

Examining the define-use-kill patterns along the control flow paths in the DUG and considering the variable z as we traverse the left and then the right path, as shown in the graphs below, we have the following life-cycles of y: ~k (programming error), ku (major blunder), uu (correct), ud (acceptable), kk (probably a programming error), kd (acceptable), du (correct).

DUG static analysis - Example 1 - Variable z - Path 1.svg DUG static analysis - Example 1 - Variable z - Path 2.svg

In performing a static analysis on this data flow model, the following problems have been discovered:

Variable Operation
x define-define (dd)
y ~-use (~u)
y define-kill (dk)
z ~-kill (~k)
z kill-use (ku)
z kill-kill (kk)