Beruflich Dokumente
Kultur Dokumente
Some program
properties are too hard
to test for, e.g., race
conditions
Optimistic inaccuracy
(testing)
Perfect
verification
Pessimistic inaccuracy
(analysis, proofs)
Easier properties
Analysis of Models
proc foo ( )
x: integer;
y: char;
begin
xxlskd ;
Property
of interest
?P
xxl;
Derive
models of
software for
analysis
Implication
Algorithmic check of
derived model for
related property P
Property
of model
? P
SW Testing and Analysis
Backward
Any
path
Reaching definitions
Live variables
Variables whose current
values may be used later
All
paths
Available expressions
Computed expressions
whose values have not
changed
Precision is costly
Static analyses summarize results to obtain
results in practical time (often O(n3) in theory, O(n)
in practice). Precise results often require
exponential time and space.
Conservative Analysis
Flow analysis considers all program paths
both directions at every branch
includes some unexecutable paths
Aspect analysis
[Jackson 93]
Classical data dependence analysis
with three differences
User-specified dependence properties
Compositional: Specs can be used in lieu of code
Dependence between abstract components (finer than
dependence between concrete objects)
Non-standard analyses
Flow analysis doesnt have to be about data
flow
the formal requirements dont say anything about
data flow; they just describe a set of equations
about approximate values
10
Concrete
Interpretation
Collect
all possible
values
Collecting
Interpretation
Abstract to
sets of values
Abstract
Interpretation
11
12
14
15
16
Semaphore analysis
in the call graph
First pass: Build up Gen/Kill sets of
semaphores for each procedure in the call
graph
Gen: All P operations
Kill: All V operations
17
18
19
{ -1 } { 0 }
{}
(non-constant)
{ 1 } . . . (constants)
(no values)
20
where Merge(x,x) = x
21
22
?E
!E
accept E do
...
...
Extract
Combine
Check
23
(one of many)
Domain-specific analysis
limited proof of simple but critical properties in a
limited domain
24
25
Static
Analysis
Testing
Program
Property
of interest
Design model
verified for
difficult-to-test
properties
Oracles
derived from
design model
26