Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. SE-2, NO.4, DECEMBER 1976 308 THOMAS J. McCABE Abstract- This paper describes a graph-theoretic complexity measure and illustrates how it can be used to manage and control program com- plexity .The paper first explains how the graph-theory concepts apply and gives an intuitive explanation of the graph concepts in programming terms. The control graphs of several actual Fortran programs are then presented to illustrate the conelation between intuitive complexity and the graph-theoretic complexity .Several properties of the graph- theoretic complexity are then proved which show, for example, that complexity is independent of physical size (adding or subtracting functional statements leaves complexity unchanged) and complexity depends only on the decision structure of a program. The issue of using non structured control flow )s also discussed. A characterization of nonstructured control graphs is given and a method of measuring the "structuredness" of a program is developed. The re- lationship between structure and reducibility is illustrated with several examples. The last section of this paper deals with a testing methodology used in conjunction with the complexity measure; a testing strategy is de- fined that dictates that a program can either admit of a certain minimal testing level or the program can be structurally reduced. Index Temls-Basis, complexity measure, control flow, decomposi- tion, graph theory , independence, linear, modularization, programming, reduction, software, testing. II. A COMPLEXITY MEASURE In this sl~ction a mathematical technique for program mod- ularization will be developed. A few defmitions and theorems from graph theory will be needed, but several examples will be presented in order to illustrate the applications of the technique. The complexity measure approach we will take is to mea- sure and control the number of paths through a program. This approach, however, immediately raises the following nasty problem: "Any program with a backward branch potentially has an infinite number of paths." Although it is possible to defme a set of algebraic expressions that give the total number of possible paths through a (structured) program,l using the total number of paths has been found to be impractical. Be- cause of this the complexity measure developed here is defmed in terms of basic paths-that when taken in combinatio~ will generate every possible path. The following mathematical preliminaries will be needed, all of which can be found in Berge [I] . Definition 1: The cyclomatic number V(G) of a graph G with n vertices, e edges, and p connected components is v(G) = e -n + p. Theorem 1: In a strongly connected graph G, the cyclo- matic number is equal to the maximum number of linearly independent circuits. The applications of the above theorem will be made as
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/12/2010 for the course CIS 635 taught by Professor Mcintyre during the Spring '10 term at Cleary University.

Page1 / 13


This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online