Prev | Current Page 280 | Next

Peter Farrell-Vinay

"Manage Software Testing"

A standard template is often supplied with
structured programming verification tools which describes the constructs defined by or appropriate to
the language, and you can alter it to recognize those used by your group. Templates may contain simple
and optional graphs. Figure 7.19 shows some ADA constructs.
Using the templates, all acceptable types of language constructs contained in the program are recognized.
The program is said to be properly structured if its graph reduces to a single node after these acceptable
constructs have been removed.
Some test tools will also report McCabe??™s Essential Complexity metric, which will exceed unity if the
subject program is not properly structured. McCabe??™s Essential Complexity metric is obtained by applying
the formula (see section 18.8.4) to the residual graph.
The number of Essential knots is also given as a measure of unstructuredness. A structured program
will have no essential knots.
Figure 7.20 is an example of a complexity analysis summary.
FIGURE 7.19 Structured program verification definition (ADA)
FIGURE 7.20 Example of complexity analysis output
PROGRAMMING VERIFICATION WILL USE THE FOLLOWING STRUCTURES
---------------------------------------
SIMPLE COLLAPSE
REPEAT
CASE
WHILEDO
IF THEN
IF THEN ELSE
FORLOOP
PROCEDURE
TRIANGLE
TOTAL
COMPLEXITY ANALYSIS PRODUCES THE FOLLOWING TABLE OF RESULTS
THE PROGRAM CONTAINS l PROCEDURE
THE ESSENTIAL MCCABE MEASURE OF 1 INDICATES THAT THE PROGRAM IS
PROPERLY STRUCTURED
LINES
ANLSD
BASIC
BLOCKS
AVGE
LENGTH
ORD1
INTRVLS
MAX
ORD
INTRVLS
REDUCE MCCABE KNOTS ESSNL
KNOTS
ESSNL
MCCABE
56 19 2.


Pages:
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292