The reporting of any particular violations is optional; and you can define violation
penalty marks. Thus static analysis will typically produce a total penalty award for the analyzed source
code. This information is listed in the management summary (see Figure 7.16) which also contains the
results from complexity analysis (see section 18.8.4), and dynamic analysis in a summary form. Figure
7.16 is a typical management summary report from static analysis: note the reported standards violations
and the associated penalty.
7.8.3 Test Path Analysis
Static analysis also produces an analysis of the test paths (sub paths) contained in the source code. Test
paths can be defined as LCSAJs (Linear Code Sequence & Jumps) and each is a sequence of code (a linear
code sequence) followed by a control-flow jump (see Figure 7.17).
LCSAJ coverage is used in dynamic analysis as a rigorous measure of program execution. The concept
is language-independent, requiring only that the program reformatting allows them to be expressed in
terms of unambiguous statement line numbers. This is undertaken by a static analysis reformatter. See
section 12.4 for more on this.
FIGURE 7.15 Example of a test tool reference listing
1 With TEXT IO
2 use TEXT IO
3
4 procedure TRIANGLE is
5 type MY INT is new INTEGER range 0. . 1000;
6
7 package INOUT INT is new TEXT IO. INTEGER I0(MY INT);
8 use INOUT INT;
9 I, J, K, MATCH: MY INT;
10
11 begin
12 loop
13 PUT(???input: THREE NUMBERS (O TO FINISH)???);
14 GET(I);
15 if
16 I = O
.
Pages:
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289