Software Complexity: Measures and Methods 9783110866087, 9783110122268


222 104 35MB

English Pages 620 [624] Year 1991

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Preface
Acknowledgements
Contents
1. Introduction
2. Problems in Evaluating the Complexity of Programs
2.1. Difficulties in Interpreting the Results of Software Complexity Measurement
2.2. Problems in Interpreting Numerical Values
2.3. Problems in Determining the Complexity of Programs
2.4. Problems in Calculating the Arithmetic Mean
2.5. Problems in Selecting Appropriate Software Complexity Measures
3. Discussion about Software Measurement and Measures
3.1. What is Software Measurement?
3.2. An Overview of Software Measurement
3.3. What are Software Metrics/Measures?
3.4. Classification of Software Complexity Measures
3.5. Verbal Definitions of the Term Complexity
3.6. Limits to the Values of Software Measures
3.7. Remarks About Measures in Relationship to Measurement Theory and Scales
3.8. Summary
4. Measurement Theory and Criteria for Scales
4.1. The Definition of the Empirical Relational System and the Formal Relational System
4.2. The Definition of Scales and Meaningfulness
4.3. Criteria for Ordinal and Ratio Scales
4.4. Description of Measures as an Ordinal and Ratio Scale
4.5. Characterization of the Measure of McCabe
4.6. Summary
5. Models of Programs and their Definitions
5.1. Definitions of Control Flowgraphs
5.2. Definitions of Subflowgraphs and Primes
5.3. Definitions and Notation for Decomposition of Flowgraphs, Sequence and Nesting
5.4. Definitions of Structuredness of Flowgraphs
5.5. Definition of Intervals and Reducibiiity
5.6. Definition of Loops
5.7. Definition of Unstructuredness of Flowgraphs
5.8. Notations Used in this Book
6. Ideas Behind the Complexity of Programs
6.1. Desirable Properties of Measures by Tsai, Lopez, Rodriguez and Volovik
6.2. Desirable Properties of Measures by Evangeiisti
6.3. Ideas of Complexity by McCabe
6.4. Ideas of Complexity by Belady
6.5. Axioms of Complexity by Piwowarski
6.6. Axioms of Complexity by Bache
6.7. Desireable Properties of Complexity Measures by Weyuker
6.8. Required Properties for Measures by Jayaprakash, Lakshmanan and Sinha
6.9. Summary
7. Our Investigation of Software Complexity Measures
7.1. Overview of our Investigation of the Measures
7.2. The "Measure Demonstration System" MDS
7.3. Atomic Modifications, Partial Properties and the Ordinal Scale
7.4. Extensive Structure and Binary Operations between Programs
7.5. Conditions for the Use of Measures as an Ordinal and a Ratio Scale in Practice
7.6. Summary
8. Characterization of Software Complexity Measures
8.1. Selection of the Software Complexity Measures
8.2. Measures of Halstead
8.3. Measure Lines of Code
8.4. Measures of McCabe and Modifications
8.5. Measures "Relative and Absolute Logical Complexity" of Gilb
8.6. Measure "Control Flow Density" of Szentes and Potier
8.7. Measures of Szentes and Gras
8.8. Measure of Oviedo
8.9. Measure PATH of Schneidewind
8.10. Measures of Whitworth and Szulewski
8.11. Measures of Hecht and Extensions
8.12. Measure of Moawad and Hassan and Extensions
8.13. Measure "Reachability" of Schneidewind
8.14. Measures of Chen
8.15. Measures Based on the Prime Decomposition of Flowgraphs
8.16. Measure of Schmidt and Gong and Extensions
8.17. Measures Based on Ranges
8.18. Measures for Analyzing the Unstructuredness of Flowgraphs
9. Results and Research in the Future
9.1. List of the Investigated Measures
9.2. Partial Properties of the Measures
9.3. Properties of Measures Related to the Extensive Structure
9.4. Set of Measures to Measure the Intra-Modular Complexity
9.5. Measurement Process of Restructure and Software Reuse
9.6. Wrong and Correct Calculation of the Arithmetic Mean
9.7. Complexity In Comparison to Reference Programs and Program Versions
9.8. Validation of a Measure
9.9. Correlation between Software Complexity Measures
9.10. Open Problems and Research in the Future
10. Glossary of Terms
11. References
Name Index
Subject Index
Measure Index
Definition Index
Recommend Papers

Software Complexity: Measures and Methods
 9783110866087, 9783110122268

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

Programming Complex Systems 4 Edited by Fevzi Belli and Hinrich E. G. Bonin

Horst Zuse

Software Complexity Measures and Methods

w DE

G

Walter de Gruyter Berlin • New York 1991

Dr. Ing. Horst Zuse Wissenschaftlicher Angestellter am Rechnerbetrieb des Fachbereich Informatik der Technischen Universität Berlin

The book contains 498 figures.

Library of Congress Cataloging-in-Publication

Data

Zuse, Horst, 1945Software complexity : measures and methods / Horst Zuse. p. cm.--(Programming complex systems : 4) Includes bibliographical references. I S B N 3-11-12226-X (Berlin : acid free p a p e r ) . - I S B N 0-89925-640-6 ( N e w York : acid free paper) 1. Computer software—Evaluation. 2. Computational complexity. I. Title. II. Series. QA76.76.E93Z87 1991 90-22892 005.3'028'7-dc20 CIP

Deutsche Bibliothek

Cataloging in Publication

Data

Zuse, Horst: Software complexity : measures and methods / Horst Zuse. - Berlin ; New York : de Gruyter, 1991 (Programming complex systems ; 4) ISBN 3-11-012226-X NE: Programmierung komplexer Systeme

© Printed on acid free paper which falls within the guidelines of the ANSI to ensure permanence and durability. © Copyright 1990 by Walter de Gruyter& Co., D-1000 Berlin 30. All rights reserved, including those of translation into foreign languages. No part of this book may be reproduced in any form - by photoprint, microfilm or any other means - nor transmitted nor translated into a machine language without written permission from the publisher. Typsetting and Printing: WB-Druck, Rieden - Binding: Luderitz & Bauer, Berlin. - Cover Design: Johannes Rother, Berlin. -Textillustrations: David Andersen, Berlin. - Printed in Germany.

Preface The central goal of this textbook is to provide readers with the necessary knowledge and tools for critically evaluating existing and future software complexity measures. This book shall help teachers to understand software measurement, it shall help students to understand measurement theory and software measurement, and it shall help people to apply standardized software complexity measures in practice. An additional goal is to prepare the reader for a detailed study of the methods of application of measurement theory, the definition and use of scales, the description of measures as an ordinal or ratio scale, the methods to analyze the static complexity of programs, the types of complexity measures used to analyze the static complexity of programs, and applications of software complexity measurement in practice. The book presents two ways to discuss software complexity measures, the first one is a theoretical foundation of the measurement of software complexity, and the second one is a detailed discussion of more than ninety software complexity measures and their application to software complexity measurement. The discussion of these measures is illustrated with many examples supported by the Measure Demonstration System MDS. Further goals of this book are to show methods that will help the reader to use a measure sensibly, to compare, discuss, and select software complexity measures more easily. It also should help to perform meaningful statistical analysis with the resulting numbers. The first discussions about measurement in computer science started at the department of computer science at the "Technische Universität Berlin" in the middle of the seventieth by Cherniavsky. The work of Cherniavsky was an important step forward to recognize the connections between the measure and what to measure. The work of Cherniavsky in analyzing measures was proceeded by that of Bollmann, also at the "Technische Universität Berlin", in the research field of evaluation measures for information retrieval systems. In 1981 E. Konrad suggested the investigation of software complexity measures. The result of this suggestion was the 1985 dissertation by Horst Zuse: "Meßtheoretische Analyse von Statischen Softwarekomplexitätsmaßen" (Measurement Theoretic Analysis of Static Software Complexity Measures). From 1987 to 1988 the work in software complexity measurement was continued by the author at the "IBM Thomas J. Watson Research Center" in Yorktown Heights, USA. The work on software measures was extended and the first version of the software system MDS was developed and implemented. Back at the "Technische Universität Berlin" in 1988, the author intensified his research on software complexity measures. The results of this research are presented in this book. Horst Zuse Berlin (West) September 1990

Acknowledgements

Too many people, like colleagues, friends, students, etc. have contributed to the development of my ideas for me to acknowledge them all individually. However, I would like especially to thank some people. I thank P. Bollmann for the very helpful and detailed suggestions on this book and the constructive discussions over many years. I thank IBM for giving me the opportunity to stay at the IBM Thomas J. Watson Research Center in Yorktown Heights/New York, USA, from May 1987 to April 1988 and to do research in software measures. Tom Corbi deserves much appreciation for his support and encouragement ensuring that my work on software complexity measures could be presented at several universities in the USA. I thank F.Belli for his idea to publish a book about software complexity. I also thank the reviewers Samuel Cooke (University of Southern California), Karin Drabe, Helen Jannasch (DDR), Michael Plathoff (Siemens Corporate Research, Princeton/New Jersey, USA) and Claus Wichmann. Finally, I would like to thank my colleagues at the scientific computer center "Rechnerbetrieb des Fachbereich Informatik" at the department of computer science at the "Technische Universität Berlin" for their support to complete this book. Horst Zuse Berlin (West) September 1990

Dedication

To my parents Gisela and Konrad Zuse and to Karin Drabe

Contents 1 Introduction

1

2 Problems in Evaluating the Complexity of Programs

7

2.1

Difficulties in Interpreting the Results of Software Complexity Measurement

2.2

Problems in Interpreting Numerical Values

7 21

2.3

Problems in Determining the Complexity of Programs

22

2.4

Problems in Calculating the Arithmetic Mean

22

2.5

Problems in Selecting Appropriate Software Complexity Measures

. . . .

3 Discussion about Software Measurement and Measures

23 25

3.1

What is Software Measurement?

3.2

An Overview of Software Measurement

27

3.3

What are Software Metrics/Measures?

28

3.3.1

The Difference of Measure and Metric

28

3.3.2

Term Software Measure

29

3.4

25

Classification of Software Complexity Measures

31

3.4.1

Computational and Psychological Complexity

31

3.4.2

Basili's Classification of Complexity Measures

32

3.4.3

Sherif's Classification of Software Measures

32

3.4.4

Fenton's and Kaposi's Classification of Software Measures

3.4.5

Program Change-Measures

. . . .

32 33

3.4.6

GMD's Classification

33

3.4.7

Sheppard's Classification of Software Complexity Measures . . . .

33

3.4.8

METKITs Classification of Software Measures

34

3.5

Verbal Definitions of the Term Complexity

34

3.6

Limits to the Values of Software Measures

35

3.7 3.8

Remarks About Measures in Relationship to Measurement Theory and Scales

36

Summary

37

4 Measurement Theory and Criteria for Scales 4.1 The Definition of the Empirical Relational System and the Formal Relational System 4.1.1

39 40

The Difference Between the Measurement of the Length of Wooden Boards and the Complexity of Software

4.2 The Definition of Scales and Meaningfulness

41 42

4.2.1

Examples of Scale Types

43

4.2.2

Examples of Meaningfulness

45

4.3 Criteria for Ordinal and Ratio Scales

46

X

Contents

4.3.1

Weak Order and Ordinal Scale 4.3.1.1

47

The Empirical Relation "Equal or More Complex Than"

4.3.2 4.4

49

Extensive Structure and the Ratio Scale

49

Description of Measures as an Ordinal and Ratio Scale

51

4.4.1

Empirical Subrelation

51

4.4.2

Atomic Modification

51

4.4.3

Partial Property of a Measure

52

4.4.4

Property s of a Measure

54

4.4.5

Empirical Subrelation of a Measure

54

4.4.6

The Choice of an Appropriate Software Complexity Measure

4.4.7

Partial and Complete Description of the Property s of a

. . .

Measure

56

4.4.7.1

Partial Description of the Property s of a Measure

4.4.7.2

Complete Description of the Property s of a Measure

4.4.8

Summary of Partial Properties and Atomic Modifications

4.4.9

Modified Axioms of the Extensive Structure

4.4.10 4.5

4.6

55

Binary Operations between Programs

. . .

56 56 56 57 58

Characterization of the Measure of McCabe

62

4.5.1

The Measure of McCabe as an Ordinal Scale

62

4.5.2

The Measure of McCabe as a Ratio Scale

64

Summary

5 Models of Programs and their Definitions

65 67

5.1

Definitions of Control Flowgraphs

67

5.2

Definitions of Subflowgraphs and Primes

72

5.3

Definitions and Notation for Decomposition of Flowgraphs, Sequence and Nesting

5.4

77

Definitions of Structuredness of Flowgraphs

78

5.4.1

D-Structures

79

5.4.2

D'-Structures

80

5.4.3

BJn-Structures

81

5.5

Definition of Intervals and Reducibility

81

5.6

Definition of Loops

82

5.7

Definition of Unstructuredness of Flowgraphs

82

5.8

Notations Used in this Book

84

6 Ideas Behind the Complexity of Programs

87

XI

Contents 6.1

Desirable Properties of Measures by Tsai, Lopez, Rodriguez and Volovik

87

6.2

Desirable Properties of Measures by Evangelisti

88

6.3

Ideas of Complexity by McCabe

89

6.4

Ideas of Complexity by Belady

89

6.5

Axioms of Complexity by Piwowarski

89

6.6

Axioms of Complexity by Bache

90

6.7

Desireable Properties of Complexity Measures by Weyuker

92

6.8 6.9

Required Properties for Measures by Jayaprakash, Lakshmanan, Sinha

96

Summary

98

7 Our Investigation of Software Complexity Measures 7.1

Overview of our Investigation of the Measures

7.2

The "Measure Demonstration System" MDS

99 99 100

7.2.1

Measures Implemented in M D S and Treated in this Book

7.2.2

Representation of Flowgraphs in MDS

. . . .

7.2.3

Nested Flowgraphs for the Investigation of the Measures

7.2.4

Interpreting the Numbers of Measurement

106

7.2.4.1

Interpreting Numbers for the Measure MCC-V with MDS

108

7.2.4.2

Interpreting Numbers for the Measure MCC-V-Q with MDS

109

7.2.4.3

Interpreting Numbers for the Measure MCC-V2 with MDS

110

7.2.4.4

Interpreting Numbers for the Measure LOC with MDS

112

7.2.4.5

Interpreting Numbers for the Measure A L P H A with MDS

113

7.2.4.6

Interpreting Numbers for the Measure BAND with

. . . .

MDS 7.2.5 7.2.6

102 103 103

114

Selection of Measures with MDS

115

Examples and Counterexamples for the Extensive Structure

115

7.2.6.1

Axiom of Associativity

116

7.2.6.2

Axiom of Commutativity

117

7.2.6.3

Axiom of Monotonicity

118

7.2.6.4

Archimedian Axiom

120

7.3

Atomic Modifications, Partial Properties and the Ordinal Scale

120

7.4

Extensive Structure and Binary Operations between Programs

127

XII

Contents 7.5

Conditions for the Use of Measures as an Ordinal and a Ratio Scale in Practice 7.5.1

MCC-V2 as an Ordinal and a Ratio Scale 7.6

Summary

130 131

8 Characterization of Software Complexity Measures 8.1

128

Conditions for the Use of the Measures MCC-V, C2 and

133

Selection of the Software Complexity Measures

138

8.1.1

138

Software Complexity Measures not treated in this Book

8.2

Measures of Halstead

8.3

Measure Lines of Code

146

8.4

Measures of McCabe and Modifications

151

8.4.1

152

Explanations by McCabe

142

8.4.2

Examples of the Measures

153

8.4.3

Cyclomatic Number of a Graph and a Flowgraph

154

8.4.4

Comments from the Literature

159

8.4.5

Discussion of the Measures of McCabe

161

8.4.6

Extensive Structure and Ratio Scale

165

8.4.7

Final Remarks

167

8.5

Measures "Relative and Absolute Logical Complexity" of Gilb

170

8.6

Measure "Control Flow Density" of Szentes and Potier

176

8.7

Measures of Szentes and Gras

179

8.8

Measure of Oviedo

195

8.9

Measure PATH of Schneidewind

200

8.10 Measures of Whitworth and Szulewski

206

8.11 Measures of Hecht and Extensions

221

8.12 Measure of Moawad and Hassan and Extensions

234

8.13 Measures "Reachability" of Schneidewind

242

8.14 Measures of Chen

250

8.14.1 Measure Maximal Intersection Number (MIN)

251

8.14.2 Measure Z

252

8.14.3 Measure Z'

252

8.14.4 Discussion of the Measures

253

8.14.4.1 Revised and Improved Definition of the Measure MIN by the Author

254

8.14.5 Examples

255

8.14.6 Discussion of the Measures

260

8.14.7 Extensive Structure and Ratio Scale

262

8.14.8 Final Remarks

263

Contents

XIII

8.15 Measures Based on the Prime Decomposition of Flowgraphs

265

8.15.1 Measures of Dunsmore and Gannon

269

8.15.2 Measure of Prather

281

8.15.3 Measures of the Project "Structured-Based Software Measurement"

296

8.15.3.1 Structural Measures Based on the Fenton-Whitty Scheme 8.15.3.2 Definition of Structural Measures

297 299

8.15.3.3 The Axioms of Structure

300

8.15.3.4 Assigning of Values to Primes

301

8.15.3.5 The Measures VINAP-PD and VINAP-SUM

301

8.15.3.6 New Primes

302

8.15.3.7 Examples

303

8.15.3.8 Explanations by Bache and Fenton

309

8.15.3.9 Discussion of the Measures

309

8.15.3.10 Extensive Structure and Ratio Scale

314

8.15.3.11 Final Remarks

318

8.15.4 Measures of Fenton and Kaposi

320

8.15.5 Measures of Preiser and Storm

330

8.15.6 Measures of Ejiogu

333

8.15.7 Measures of Blaschek

345

8.15.8 Measures of Belady

362

8.16 Measure of Schmidt and Gong and Extensions 8.17 Measures Based on Ranges 8.17.1 Introduction

374 400 400

8.17.1.1 Dominators

400

8.17.1.2 First Occurrence Path

401

8.17.1.3 Lower Bound and Greatest Lower Bound

403

8.17.1.4 Ranges and Scopes

404

8.17.1.5 Nesting Level of Nodes

410

8.17.2 Measures of Harrison and Magel

413

8.17.2.1 Measure SCOPE

413

8.17.2.2 Measure SCOPE and Extensions as Defined by Howatt and Baker

414

8.17.2.3 Comments from the Literature

416

8.17.2.4 Examples

416

8.17.2.5 Discussion of the Measures

425

8.17.2.6 Extensive Structure and Ratio Scale

429

XIV

Contents

430

8.17.2.7 Final Remarks 8.17.3 Measures of Howatt and Baker

433

8.17.3.1 Remarks by Howatt and Baker

436

8.17.3.2 Comments by the Author

436

8.17.3.3 Examples for the Measures SCOPE, PEN and AVG

. .

437

8.17.3.4 Examples for the Measure NL

441

8.17.3.5 Discussion of the Measures

450

8.17.3.6 Extensive Structure and Ratio Scale

454

8.17.3.7 Final Remarks

456

8.18 Measures for Analyzing the Unstructuredness of Flowgraphs

458

8.18.1 Measure of Woodward, Hennell and Hedley

459

8.18.2 Measure of Piwowarski and Extensions

464

8.18.2.1 Comments to the Definition of the Measure by the Author

465

8.18.2.2 Entry-Node of a Range

469

8.18.2.3 Structuredness and Unstructuredness of Pairs of Ranges

470

8.18.2.4 Definition of the Measure of Piwowarski by the Author

471

8.18.2.5 Examples

472

8.18.2.6 Definition of the Measure of Piwowarski by Howatt and Baker

482

8.18.2.7 Discussion of the Measures of Piwowarski

483

8.18.2.8 Extensive Structure and Ratio Scale

486

8.18.2.9 Final Remarks

487

8.18.3 Measures for Unstructuredness of Howatt and Baker and Extensions

490

9 Results and Research in the Future 9.1 9.2

511

List of the Investigated Measures

511

Partial Properties of the Measures

512

9.2.1

Partial Properties of the Measures of McCabe and Extensions

513

9.2.2

Partial Properties of the Measures of Szentes and Gras

514

9.2.3

Partial Properties of the Measures of Hecht and Moawad

. . . .

515

9.2.4

Partial Properties of the Measures of Schneidewind

515

9.2.5

Partial Properties of the Measures of Chen

516

9.2.6

Partial Properties of Measures Based on Primes

517

9.2.7

Partial Properties of the Measures of Blaschek and Ejiogu . . . .

518

9.2.8

Partial Properties of the Measures of Belady

519

Contents 9.2.9

9.3

XV Partial Properties of the Measures of Schmidt and Gong

. . . .

9.2.10

Partial Properties of Measures Based on Ranges

9.2.11

Partial Properties of the Measures for Unstructuredness

9.2.12

List of the Measures and the Partial Properties

9.2.13

Complete List of the Atomic Modifications

523

9.2.14

Classification of Measures by Partial Properties

529

9.2.15

520

Summary

. . . .

521 522

530

Properties of Measures Related to the Extensive Structure 9.3.1

531

Overview of the Properties of the Measures to Extensive Structure

9.4

519

9.3.2

Axiom of Weak Associativity for the Binary Operation BALT

9.3.3

Sensitivity of Measures to adding Statements

531 . . .

534 536

Set of Measures to Measure the Intra-Modular Complexity

538

9.4.1

Normalized Measures and such with Unclear Properties

538

9.4.2

Criteria for the Selection of Appropriate Measures

539

9.4.3

Set of Measures to Analyze the Program Complexity

542

9.4.4

Standardized Software Complexity Measures

9.4.5

Minimal Set of Standardized Software Complexity Measures

545 . .

551

9.5

Measurement Process of Restructure and Software Reuse

551

9.6 9.7

Wrong and Correct Calculation of the Arithmetic Mean Complexity in Comparison to Reference Programs and Program Versions

557

9.8

Validation of a Measure

560

9.9

Correlation between Software Complexity Measures

9.10 Open Problems and Research in the Future

558 562 563

10 Glossary of Terms

565

11 References

573

1 Introduction High software costs, and the fact that over 70% of the software development effort /BOEH79/ is spent in testing and maintenance of software have generated the need to analyze and to measure the "quality" of software. One consequence has been, that over the last decade many software complexity measures have been introduced by researchers. Many software tools have been developed using software complexity measures for analyzing productivity, reliability, maintainability, and complexity of software in order to reduce the costs and to improve the quality of software products. A fresh impetus for this work has recently provided by the discussion got from the research field of software reuse, where a numerical evaluation of the quality of the software product is essential. In 1985 Ramamoorthy, Tsai, Yamaura and Bhide /RAMA85/ pointed out that software complexity is the major reason for rapidly increasing software development costs. To deal with this problem effectively, we need to have better ways of predicting and measuring software characteristics. Ramamoorthy, et al. proposed to use measures throughout the software life-cycle. Such measures should be used to indicate the complexity of software at each phase. Because there is an urgent need for such measures there is a rapidly growing body of literature in which new measures are introduced and experiments with these measures are carried out. The situation in this field is characterized by the fact that there are, on one hand, an increasing number of measures which are connected to different ideas of complexity, and that, on the other hand, criteria are missing to decide which measure should be used in a given situation. This problem has already been recognized by some authors, such as Ejiogu /EJI085/: "Conventional measures of software complexity have so far proved unsatisfactory, and many have unsound logical foundations". Howatt and Baker /HOWA89/ pointed out that two deficiencies persist in program complexity research and that is: "A lack of formalism in defining complexity measures and a lack of analytical tools for evaluating these measures. The lack of formalism significantly hinders independent empirical evaluation of proposed measures. The lack of analytical tools and techniques for evaluating measures makes comparisons between independent research efforts difficult". Research activities in the field of software measures, especially software complexity measures, have taken a massive step forward since the seventies. The earliest works about software complexity could be the work of Rubey /RUBE68/, the work of Van Emden /EMDE71/ and the two proposed software complexity measures by Hecht /HECH77/, /HECH75/. However, the work of Van Emden und the Measures of Hecht fell into oblivion. In 1976 and 1977 the paper of McCabe /MCCA76/ about the cyclomatic complexity appeared and the book of Halstead /HALS77/ about the software science measures was published. Some of the best known complexity measures today are the Measure of McCabe (Cyclomatic Number), Lines of Code (LOC), and the Measures of Halstead (Length, Volume, Difficulty and Effort). Other complexity measures are data flow and information flow measures (e.g. data flow Measure of Oviedo and information flow Measure of Henry and Kafura /HENR81/). And there are more than 100 other measures for the complexity of programs. However, the term "software complexity" is still not well defined. Here, the term complexity measure is a misnomer. The true meaning of the term software complexity is the difficulty to maintain, change and understand software. It deals with the psychological complexity of programs.

2

1 Introduction

Some authors gave definitions of complexity. Ramamoorthy, et al. /RAMA85/ defined software complexity: "We define software complexity as the degree or difficulty in analysis, testing, design and implementation of software. We will not attempt to attach a single number to software complexity. Instead, we discuss the complexity of individual characteristics of the software". Sheppard /SHEP88/ writes about the term software complexity: "Complexity is a metaphysical property and thus not directly observable. What is required is a means to link the behaviour of the product characteristics that are measureable". There are several categories of software complexity. Ejiogu /EJ1085/ explains five of them: "Structural complexity: Has to do with the natural expression of the topological relationships of a system's components. Structural complexity is more than just the effects of control paths, it is the global attribute of every software module. Computational complexity: Concerns the relative difficulty in accomplishing arithmetical/ logical computations of an algorithm on data. This complexity is an attribute of an algorithm and not an immediate attribute of software. Logical complexity: Has to do with the relative difficulty of logical decisions or flows and branches within a system. Conceptual complexity: Has to do with with the psychological perception or the relative difficulty of undertaking or completing a system; it may also include the diversity of human and material resources. Textual complexity: Has to do with the static analysis of program source texts; this condition influences reliability. Halstead used psychological assumption to establish his measures of software science". The overall complexity of software is a function of many factors. In literature we can find many types of measures, for example process measures, product measures, resource measures, static measures, descriptive measures, black-box measures, quality measures, code measures, design measures, inter- and intra-modular measures, data flow measures, information flow measures, and specification measures. The complexity of a module or a program system is influenced by the factors of cohesion, coupling, decomposition and intra-modular complexity. It can be said that the measurement of the complexity is synonymous with determing the degree of difficulty in analyzing, maintaining, testing, designing and modifying software. In literature we can find more than two hundred software complexity measures, which capture different types of structural, logical and intra-modular complexity. But the selection of an appropriate measure is still very difficult because there are no generally accepted criteria for the description of the properties and the scales of the measures. The properties of the measures are not described in a uniform way and there exists no unique criteria to evaluate software complexity measures. That may be one reason why most of the published software complexity measures are not known and not implemented in software measurement tools. Recently progresses have been made to propose standardized measures to produce reliable software. The Institute of Electrical and Electronics Engineers, Inc. (IEEE) has published a paper titled: "An American National Standard: IEEE Guide for the Use of IEEE Standard Dictionary of Measures to Produce Reliable Software" /IEEE89/, /IEEE89a/. A disadvantage is, that this guide contains only some software complexity measures.

1 Introduction

3

However, there are still more problems with software complexity measures not fully recognized in the research field of software measurement. If we have measurement values, we want to use them, we want to calculate arithmetic means, variances, percentages and apply statistical tests. We want to draw conclusions and take actions based on these calculations. But arbitrary statistics are not allowed. For example, in physics if we have an interval scale such as temperature in Fahrenheit, we may not calculate percentages and draw conclusions like: "Today at noon it was 20% warmer than yesterday at noon". On the other hand we may do things like this with a measure for length such as yards or meters. Hence the question arises as to what kind of scales we have for software complexity measures and what meaningful statements we may make with the measurement values. Some authors mention measurement theory and scales. Harrison, Magel, Kluzny and DeKock /HARR82/ acknowledge scales, like ordinal, interval and ratio scales. But they neither use measurement theory to describe the kind of scale, nor do they use approaches to describe the scales of software complexity measures. Li and Cheung /LI87/ wrote about measurement and scales: "In the ordinal scale, the complexities of different programs are to be ranked to provide a rather crude comparison. In the interval scale, the difference in complexity of two programs is expressed in units, for example, a program B is 6 units more complex than program A. In ratio scale, the ratio of complexities of two programs is determined. The ratio scale is flexible, but impractical". Li and Cheung neither give a foundation for this statement: "... ratio scale is impractical" nor do they use measurement theory to describe the scale of the measures. In the report of the Alvey Project "Structured-Based Software Measurement" /ALVE88/ many statements are discussed about measurement theory and software measurement. Scales are introduced, but the proposed and discussed software measures are not described as an ordinal, interval and ratio scale. The bridge between measurement theory and software (complexity) measurement is missing. Some authors discussed desireable properties of software complexity measures. Such proposals of concatenation properties were given for example, by Weyuker /WEYU85/, /WEYU88/, Jayaprakash, et al. /JAYA87/ and by Bache /BACH87/. These properties are inconsistent; on the one hand they require implicitly the ratio scale, and on the other hand they reject the ratio scale. And the proposed properties are not yet discussed in literature and are not generally accepted. Summing up, it may be said that the situation in software complexity measurement is confusing and not satisfying for the user. There are many software complexity measures proposed and discussed in literature, but the measures are not described and evaluated by generally accepted criteria. The correct use of the measures in connection with scales is not sufficiently treated in literature, either. The user does not have criteria for the selection of a set of well defined and described software complexity measures for an application in practice. There does not exist sufficient support for the user, the manager, etc., to understand the meaning of the numbers related to the term complexity of programs. This support is important because they want to make decisions based on these numbers. The major goal of this book is to present methods for selecting, describing and evaluating micro-level software complexity measures in theory and practice. Micro-level measures are also called Intra-modular measures. They analyze the complexity of a single program module. The presented methods in this book should help the reader to understand the discussion of software measurement (complexity, maintainability, reliabi-

4

1 Introduction

lity) in literature and the role of measurement theory applied to software measures. It should also help the user how to determine the scale of a software complexity measure, the strategy to select software complexity measures by certain criteria and interpret the meaning of the numbers of the measurement process related to the term complexity of a program. For this reason an approach developed by the author /ZUSE85/ to characterize software complexity measures is applied. Hypotheses of measurement theory are used to get criteria for scales, like the ordinal and ratio scales. The connection of measurement theory with software (complexity) measures (also applicable to to other types of software measures) is shown and discussed in detail. This approach is called a descriptive approach /ROBE79/. A descriptive approach means: whether or not measurement takes place then depends on whether or not an individual's judgement satisfies the axioms. In this approach measurement theory with software (complexity) measures are connected. The properties of the measures are described by their partial properties in terms of atomic modifications in the flowgraph. Many measures are described as an ordinal scale. Applying the theory of extensive measurement, concatenation operations between programs are defined by the author and sufficient and necessary conditions are given to characterize software complexity measures as a ratio scale. The concatenation operations of programs defined by the author are compared with those of Weyuker /WEYU88/ and Bache /BACH87a/. The results of the characterization of measures as an ordinal scale or as a ratio scale are very important for selecting appropriate software measures to determine the quality of software. The proposed concept is also very helpful for developing tools which use software measures to evaluate the "quality" of software. Applications of software measurement are shown and a special set of standardized measures is proposed to measure the structural complexity of flowgraphs or programs. The final result is a catalog of standardized intra-modular software complexity measures. In detail the contents of the sections of the book are the following: Section 2 shows the confusing situation in the area of software complexity measurement. The difficulties of evaluating the results of software measurement are discussed. Many examples of software measurement are presented which show that it is almost impossible to select an appropriate software complexity measure. These examples are also used to discuss the problem of the interpretation of the numbers. Other examples show that a manager or programmer is not always able to distinguish the complexity of even simple programs or to give a definition of complexity in the sense: Why is one program more complex than another one? In Section 3 an overview of software measurement, definitions of measures, types of software measures and a review of measurement theory and scales, as discussed in the literature, is given. In Section 4 measurement theory is introduced. Although measurement theory is not the solution of the difficulties in software measurement, the discussed methods and hypotheses in measurement theory give ideas for software (complexity) measurement. The difference between classical measurement in physics and measurement of software complexity is discussed. The empirical relational system, the formal relational system, the measure n, the definition of a scale, the meaningfulness of statements, the weak order, the homomorphism and the Extensive Structure are described. Examples of scales are shown and the sufficient and necessary conditions to describe measures as an ordinal and a ratio scale are given.

1 Introduction

5

In Section 5 definitions, models of programs and definitions of structured and unstructured programs are presented. In Section 6 the ideas behind the complexity of programs, as discussed in literature, are presented. Concatenation operations of programs of Weyuker /WEYU88/ and Bache /BACH87a/ are discussed and compared related to the proposed concatenation operations of the author in Section 4. In Section 7 our investigation of software complexity measures is introduced. The software lab MDS (Measure Demonstration System), which was developed by the author, is presented and examples of the use of MDS are given. The atomic modification to describe the partial properties of measures as an ordinal scale is explained in detail. A modified set of axioms for the Extensive Structure is presented to describe measures as a ratio scale. The Measure of McCabe and two other measures are used to demonstrate our way investigating of software complexity measures. In Section 8 more than ninety software complexity measures are investigated and evaluated. The measures are described in uniform notation illustrated with more than three hundred examples calculated by the MDS system to explain and understand the calculation of the measures. For each measure the atomic modifications are given in order to describe the measures partially or completely as an ordinal scale. The property of the measures with respect to the axioms of the Extensive Structure is investigated with two binary operations. A final discussion of each measure gives an overview of the properties of the measures. Section 9 shows the results of our investigation of the measures. An overview of the properties and scales of the measures is presented. A set of measures to analyze the intra-modular complexity of a program for the use in practice is presented. This set of measures capturing basic properties, nested structures, loops, stable sets, the dominance tree, primes, ranges and unstructured parts of the program. A special set of measures, which is described as a ratio scale, is used to demonstrate the calculation of the complexity of a restructuring process of programs from a heavily unstructured program to a well structured program. About fifty software complexity measure are proposed and discussed as a set of standardized software complexity measures by the author for an application in practice. This standardized set of measures should help the customer to apply software complexity measurement over years and shall it make easier to interpret the results and the meaning of the numbers. In Section 10 a glossary of terms is given by the author. Section 11 contains more than two hundred references to the literature.

2 Problems in Evaluating the Complexity of Programs In this book intra-modular software complexity measures are investigated. These measures analyze the complexity of a single program. They are also called micro-level measures. Most of the measures are based on the representation of a program by a flowgraph. Exceptions are the Measures of Halstead which are based on the source code of programs. We discuss the problems and the difficulties to interpret the results of the measurement of the complexity of programs. In Section 2.1 we apply software complexity measures. In Section 2.2 the interpretation of the numbers of the software measurement process is discussed. In Section 2.3 we show the difficulty of deciding whether a given program has lesser, equal or greater complexity than another program. The problem is illustrated by some examples. In Section 2.4 the problem of the correct calculation of the arithmetic mean is shown. In Section 2.5 we discuss the problems of the selection of an appropriate measure. 2.1 Difficulties in Interpreting the Results of Software Complexity Measurement It is difficult to interpret the results of software complexity measurement. Many examples below show this problem. The problem can be outlined by the statement: The base of every evaluation of the complexity of a program is an idea, when one program is more complex than another one. This simple formulation of the statement above has no unique answer as the variety of the measures shows. The complex situation to interpret the results of software measurement is shown in some examples below.

P1

P2

Figure 2.1: P1 and P2 are two arbitrary programs. •> is the relation "equal or more complex". The question is why program P1 is more complex than program P2, why a program P1 is equal or better to maintain then program P2, or why program P1 is equal or more reliable than program P2? Figure 2.1 shows two arbitrary programs P1 and P2. The intuitive decision whether a program is more complex (maintainable, reliable) than another one can be done without any measure and measurement process. However, there are some important questions. We consider this questions for the term complexity, but this questions are similar for maintainability and reliability: What does the term "complexity" mean in general? What is the complexity of a program? Why is program P1 more complex than program P2 or program P1 equally complex to P2? In order to illustrate the problem of the determination of the complexity of programs, the selection of appropriate measures and the interpretation of the numbers, the complexity for several flowgraphs with many software complexity measures as proposed in literature is calculated. The following measures are discussed and investigated in this book. They are also implemented in the "Measure Demonstration System" (MDS).

2 Problems in Interpreting Measures

MEASURE

AUTHOR

OVERVIEW ABOUT MEASURES: T S REF SECTION GILB77 SZEN86 DUNS78 BELA81 BELA81 BLAS85 BLAS85 BLAS85 BLAS85 Author OVIE8O Author ROTH87 SCHM85 DUNS78 Author DUNS78 DUNS78 Author BELA81 EJI087 EJI087 EJI087 EJI087 EJI087 BLAS85 HECH77 HARR82 HALS76 HALS76 HALS76 HALS76 HALS76 HECH77 WOOD79 FENT87 HECH77 CONT86 MCCA76 MCCA76

8.5 8.7 8.17.3 8.15.B 8.15.8 8.15.7 8.15.7 8.15.7 8.15.7 8.16

PN L BE Q NR LR

MCCA76 MCCA76 Author MCCA76 CHEN78 Author MOAW83 MOAW83 MOAW83 Author BELA81 HECH77 SZEN82 SCHN79 HARR82 HOWA85

8.4 8.4 7;8.4;9 8.4 8.14.1 9.2.5 8.12 8.12 .12 .7 .15.8 8.11 8.6 8.13 8.17.2 8.17.3

Zuse, H. Blaschek Prather, R. Howatt; Baker Schneidewind Howatt, Baker Piwowarski Fenton; Kaposi Preiser; Storm Zuse, H. Schneidewind Gilb, T. Zuse, H. Bache Bache Zuse, H. Bache

R P P R P NR UR P P P Q P Q P P P P

Author BLAS85 PRAT84 HOWA85 SCHN7 9 HOWA85 PIW082 FENT87 PREI79 Author SCHN79 GILB77 Author ALVE88 ALVE88 Author ALVE88

.18.3 8 8 .15.2 8 .18.3 8 .9 8 .17.3 8 .18.2 8 .15.4 8 .15.5 7 ,8.15.3 8 .13 8 .5 8 .13 8 ,15.3 8 ,15.3 8 ,15.3 8 ,15.3

SBSM-SQF SBSM-V SCOPE SCOPE-D SCOPE-MN SCOPE-NL STABLE STRUCT UN UNST UNSTR

Zuse, H. Bache Harrison; Magel Zuse, H. Zuse, H. Zuse, H. Szentes; Gras Zuse, H. Zuse, H. Howatt; Baker Howatt; Baker

P P NR NR NR L S B U U u

Author ALVE88 HARR82 Author Author Author SZEN86 Author Author HOWA85 HOWA85

8 8 8 8 8 8 8 8 8 8 8

UNSTRUCT UNSTZ UO UOD UODD UOV UPAIRS VINAP-PD

Zuse, H. Zuse, H. Zuse, H. Zuse, H. Zuse, H. Zuse, H. Howatt; Baker Bache

B U UR UR UR UR R P

Author Author Author Author Author Author HOWA85 ALVE88

8 8, 18.3 8, 18.3 8, 18.3 8, 18.3 8. 18.3 8. 18.3 8. 15.3.5

P

ALVE88 8.15.3.5

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

ALC Gilb, T. ALPHA Szentes; Gras AVG Dunsmore;Gannon;Howatt;Ba BAND Belady, L. BAND-CYC Belady, L. BLA-H Blaschek BLA-HA Blaschek BLA-W Blaschek BLA-WR Blaschek CD Zuse, H. CF Oviedo CN Zuse, H. CR Roth CSG Schmidt; Gong DAVE Dunsmore; Gannon DEC Zuse, H. DMAX Dunsmore;Gannon DTOT Dunsmore; Gannon DTOTU Zuse, H. E-BAND-CYBelady, L. EJ-DSC iogu. Lern EJ-E iogu. Lern EJ-ISC iogu. Lern iogu. Lern EJ-L _ iogu. Lern EJ-M Blaschek ET Hecht, M. H-RED H-SCOPE Harrison; Magel HALST-D Halstead, M. HALST-E Halstead, M. HALST-N Halstead, M. HALST-V Halstead, M. HALST-VC Halstead, M. Hecht, M. IDSL Woodward;Hennel1;Hedley KNOTS Fenton; Kaposi LAMBDA Hecht, M. LC Several authors LOC McCabe, T. MCC-D McCabe, T. MCC-EV

41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

MCC-EVO MCC-V MCC-V-Q MCC-V2 MIN MINQ MWD-HB MWD-LC MWD-MH N+E N-BAND N-LOOPS N-MCCABE N-REACH N-SCOPE NL

McCabe, T. McCabe, T. Zuse, H. McCabe, T. Chen, E. Zuse, H. Moawad; Hassan Moawad; Hassan Moawad; Hassan Zuse, H. Belady, L. Hecht, M. Szentes Schneidewind Harrison; Magel Howatt; Baker

57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73

NPAIRS NT NTC PAIRS PATH PEN PIWO PRATH-E PREISER PRIMES REACH RLC S-REACH SBSM-N SBSM-P SBSM-P1 SBSM-S

74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92

93 VINAP-SUMBache

8.8

8.16 8.16 8.16 8.15.1 8 8.15.1 8.15.1 8.15.1 8.15.6 8.15.6 8.15.6 8.15.6 8.15.6 8

8.11 8.17.2 8.2 8.2

8.2 8.2 8.2

8.11

8.18.1 8.15.4 8.11 8.3 8.4 8.4

,15.3 ,15.3 ,17.2 .17.2 ,17.2 .17.2 .7 .18.3 .18.3 .18.3

COMMENT TO THE MEASURE Number of decision nodes I Stable Set I/(IEI + IN I) Average nesting depth of nodes Extension of McCabe/Nesting of nodes BAND-CYC=2*N-BAND/MCC-V Elevation measure Sum of edges from root-node nO to ni Number of leaves Relative number of leaves Modified Measure CSG Number of edges Modified Measure CSG Modified Measure CSG Dominance and postdominance Average nesting of decision nodes Number of decision nodes Maximal nesting of decision nodes Sum of nest, levels of decision nodes Sum of nest, levels of decision nodes BAND/D Degree of software complexity Explosion number E Image of software complexity Nesting level L Monadicity M Number of edges in T Reducible=0, not reducible=-l. Hybrid SCOPE Measure Measure DIFFICULTY Measure EFFORT Measure LENGTH Measure VOLUME Measure VC: n=nl + n2 Interval Derived Sequence Length Number of knots in a linear flowgraph Extension of Measure PRATH-E Loop-Connect ion-Sequence-Length Lines of Code MCC-D=IDI+1 Essential Compl.: MCC-EV-MCC-D - IMI+ Essential Compl.: MCC-EVO-IDI - IMI MCC—V=IEI — |NI + 2p, p=l MCC—V—Q=(|E|—|NI + 21**1.5 MCC-V2=|EI - IN| + 1 Maximal Intersection Number MINQ=MIN**1.5 Extension of MWD-MH by Howatt, Baker Extension of MWD-MH with LC of Hecht Extension of the Measure of McCabe Nodes + Edges Normalized BAND Measure Number of Loops by Hecht Normalized Measure MCC-V of McCabe Normalized Reachability by N Normalized SCOPE-Measure: 1-N/SCOPE Sum of the nesting level of nodes by loops Number of nested pairs of ranges Number of nodes in T New Testing Complexity Measure Number of pairs of ranges Number of possible path Predicate Execution Number Nesting and Unstructuredness Extension of NTC of Prather Measure of Preiser and Storm Number of primes in F Reachability Measure ALC of Gilb divided bv N Normalized Reachability (Modified) Level of Nesting in F Number of primes in F Number of trivial primes in F Highest number of sel. nodes in prime s Primes on nesting level 1 Number of procedure nodes Sensitive against nesting Decision node d in Range(d). Maximal nesting level of n Decision node is a loop predicate Stable Set of a flowgrapn STRUCT=1 then structured else 0 Number of nested pairs Partial unstructuredness Sum of predicated nodes in overlapped pairs. UNSTRUCT=1 then unstructured else 0 Modified UNST of Howatt and Baker Overlapped pairs Overlapped pairs Overlapped pairs Sensitive against unstructuredness Number of unstr. pairs of ranges Measure VINAP-PD (Product of dec. nod es in a prime) Measure VINAP-SUM (Sum of dec. nodes in a prime)

2 Problems in Interpreting Measures 94 95 96 97 98

WHIT WHIT-MAX WHIT-MIN WHIT-REL Z

Whitworth; Whitworth; Whitworth; Whitworth; Chen, E.

Szulewski Szulewski Szulewski Szulewski

BE BE BE BE S P

9 WHIT80 WHIT80 WHIT80 WHIT80 CHEN78

8.10 8.10 8.10 8.10 8.14.2

Node complexity measure Node complexity measure: Maximum Node complexity measure: Minimum Node complexity measure: Relative Z=MIN+1; MIN=Max. Intersection Number

Figure 2.2: The list of the measures in an alphabetic order as used in this book and implemented in the system MDS.

Explanation of the column headings of the list above: # is the current number, MEASURE is the name of the measure used in this book and by the system MDS (Measure Demonstration System), and AUTHOR is the author of the measure. Column T means: S: the measure can be only used for structured flowgraphs. Column S shows a rough classification of the measure. REF is the reference to the literature and SECTION denotes the section in this book where the measure is described. COMMENTS TO THE MEASURES is a short description of the measure. The many software complexity measures listed above are overwhelming for the reader. For this reason the measures as listed in Figure 2.3 are classified very roughly. A more detailed discussion of classes of measures are given in Section 8 and Section 9. The meaning of the classes in column S is: B

That are so-called base-measures. This kind of measure capture simple properties of the flowgraph, like the number of independent path, the number of nodes, the number of edges, the number of decision nodes, etc.

D

This are measures which are based on the dominance tree of a flowgraph.

I

Measures which are based on the reducibility of flowgraphs in intervals as defined by Hecht /HECH77/.

L

Measures which capture loops in a flowgraph.

N

Measures which are sensitive to the nesting level of nodes and decision nodes.

P

Measures which are based on the decomposition of flowgraphs into primes. Primes are subflowgraphs which consist of one entry and one exit.

R

Measures which are based on ranges/scopes as proposed by Harrison and Magel /HARR81/. Ranges are the nodes between the decision node and the greatest lower bound of the decision node.

Q

Measures which are based on the reachability of nodes.

S

Measures which are based on the "stable set" in a flowgraph.

U

Measures which capture several types of unstructuredness in flowgraphs.

NR

Measures which are based on ranges/scopes (Ranges and scopes are used as synonyms) and are sensitive to nesting.

UR

Measures which are based on ranges and are sensitive to unstructuredness.

BE

Extensions of the Measure of McCabe.

H

A hybrid measure consisting of a measure which is based on the representation of a program as a flowgraph and additionally a measure which is based on the source code of the program (Halstead's measures).

C

The measure is based on the source code of a program.

10

2 Problems in Interpreting Measures

The next list shows the roughly classified software complexity measures which are investigated in this book. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

OVERVIEW ABOUT MEASURES: SECTION T S REF

MEASURE

AUTHOR

CF DEC LOC MCC-D MCC-V MCC-V-Q MCC-V2 N+E STRUCT UNSTRUCT N-MCCABE WHIT WHIT-MAX WHIT-MIN WHIT-REL HALST-D HALST-E HALST-N HALST-V HALST-VC CD CN CR CSG H-SCOPE H-RED IDSL LC MWD-HB MWD-LC MWD-MH N-LOOPS SCOPE-NL NL

Oviedo Zuse, H. Several authors McCabe, T. McCabe, T. Zuse, H. McCabe, T. Zuse, H. Zuse, H. Zuse, H. Szentes Whitworth; Szulewski Whitworth; Szulewski Whitworth; Szulewski Whitworth; Szulewski Halstead, M. Halstead, M. Halstead, M. Halstead, M. Halstead, M. Zuse, H. Zuse, H. Roth Schmidt; Gong Harrison; Magel Hecht, M. Hecht, M. Hecht, M. Moawad; Hassan Moawad; Hassan Moawad; Hassan Hecht, M. Zuse, H. Howatt; Baiter

B B B B B B B B B B BE BE BE BE BE C

Zuse, H. Harrison; Magel Howatt, Baker Harrison; Magel Zuse, H. Zuse, H. Gilb, T. Dunsmore;Gannon;Howatt;Ba Blaschek Blaschek Blaschek Blaschek Eliogu, Lem Eliogu, Lem Eliogu, Lem Eliogu, Lem Eliogu, Lem Blaschek Fenton; Kaposi Chen, E. Zuse, H. Blaschek Prather, R. Schneidewind Fenton; Kaposi Preiser; Storm Zuse, H. Gilb, T. Bache Bache Zuse, H. Bache

NR NR NR NR NR NR P

35 DTOTU 36 N-SCOPE 37 PEN 38 SCOPE 39 SCOPE-D 40 SCOPE-MN 41 ALC 42 AVG 43 BLA-H 4 4 BLA-HA 45 BLA-W 4 6 BLA-WR 47 EJ-DSC 48 EJ-E 49 EJ-ISC 50 EJ-L 51 EJ-M 52 ET 53 LAMBDA 54 MIN 55 MINQ 56 NT 57 NTC 58 PATH 59 PRATH-E 60 PREISER 61 PRIMES 62 RLC 63 SBSM-N 64 SBSM-P 65 SBSM-P1 66 SBSM-S

67 SBSM-SQF Zuse, H. 68 SBSM-V Bache 69 VINAP-PD Bache

P P P

70 VINAP-SUMBache

P

71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88

Z Chen, E. BAND Belady, L. BAND-CYC Belady, L. DAVE Dunsmore; Gannon DMAX Dunsmore;Gannon DTOT Dunsmore; Gannon E-BAND-CYBelady, L. N-BAND Belady, L. N-REACH Schneidewind REACH Schneidewind S-REACH Zuse, H. NPAIRS Zuse, H. PAIRS Howatt; Baker UPAIRS Howatt; Baker ALPHA Szentes; Gras STABLE Szentes; Gras KNOTS Woodward;Hennel1;Hedley MCC-EV McCabe, T.

89 MCC-EV0 90 UN 91 UNST

McCabe, T. Zuse, H. Howatt; Baker

COMMENT TO THE MEASURE

OVIE8O Author C0NT86 MCCA76 MCCA76 Author MCCA76 Author Author Author SZEN82 WHIT80 WHIT80 WHIT80 WHIT80 HALS76 HALS76 HALS76 HALS76 HALS76 Author Author R0TH87 SCHM85 HARR82 HECH77 HECH77 I HECH77 L M0AW83 L M0AW83 L MOAW83 L HECH77 Author LR H0WA85

U U U

Number of edges Number of decision nodes 8.3 Lines of Code 8.4 MCC-D=IDI+1 8.4 MCC-V-IE |-|N I + 2p, p=l 7 ; 8 .4 ; 9 MCC-V-Q-(IE|-IN I + 2)**1.5 MCC-V2- IE | - | N I + 1 8.4 Nodes + Edges 8.7 8 STRUCT—1 then structured else 0 8 UNSTRUCT-1 then unstructured else 0 8.6 Normalized Measure MCC-V of McCabe 8.10 Node complexity measure 8.10 Node complexity measure: Maximum 8.10 Node complexity measure: Minimum 8.10 Node complexity measure: Relative 8.2 Measure DIFFICULTY 8.2 Measure EFFORT 8.2 Measure LENGTH 8.2 Measure VOLUME 8.2 Measure VC: n=nl + n2 8.16 Modified Measure CSG 8.16 Modified Measure CSG 8.16 Modified Measure CSG 8.16 Dominance and postdominance 8.17.2 Hybrid SCOPE Measure 8.11 Reducible=0, not reducible—1. 8.11 Interval Derived Sequence Length 8.11 Loop-Connect ion-Sequence-Length 8.12 Extension of MWD-MH by Howatt, Baker 8.12 Extension of MWD-MH with LC of Hecht 8.12 Extension of the Measure of McCabe 8.11 Number of Loops by Hecht Decision node is a loop predicate .17.2 Sum of the nesting level of nodes by 8 .17.3 loops Sum of nest, levels of decision nodes Author 8.15.1 Normalized SCOPE-Measure: 1-N/SCOPE HARR82 8.17.2 Predicate Execution Number HOWA85 8.17.3 Sensitive against nesting HARR82 8.17.2 Decision node d in Range(d). Author 8.17.2 Maximal nesting level of n Author 8.17.2 Number of decision nodes GILB77 8.5 Average nesting depth of nodes DUNS78 8.17.3 Elevation measure BLASB5 8.15.7 BLAS85 8.15.7 Sum of edges from root-node nO to ni BLASS5 8.15.7 Number of leaves BLASB5 .15.7 Relative number of leaves EJI087 8.15. Degree of software complexity "" 6 EJI087 8.15. Explosion number E EJI087 8.15.6 Image of software complexity EJI087 8.15.6 Nesting level L EJI087 8.15.6 Monadicity M BLAS85 8 Number of edges in T FENT87 8.15.4 Extension of Measure PRATH-E CHEN78 B.14.1 Maximal Intersection Number Author 9.2.5 MINQ-MIN**1.5 BLAS85 8 Number of nodes in T PRAT84 8.15.2 New Testing Complexity Measure SCHN79 8.9 Number of possible path FENT87 8.15.4 Extension of NTC of Prather PREI79 8.15.5 Measure of Preiser and Storm Author 7,8.15.3 Number of primes in F GILB77 8.5 Measure ALC of Gilb divided by N ALVE88 8.15.3 Level of Nesting in F ALVE88 8.15.3 Number of primes in F Author 8.15.3 Number of trivial primes in F ALVE88 8.15.3 Highest number of sel. nodes in prime s Author 8.15.3 Primes on nesting level 1 Number of procedure nodes ALVE88 8.15.3 ALVE88 8.15.3.5 Measure VINAP-PD (Product of dec. nod es in a prime) ALVE88 8.15.3.5 Measure VINAP-SUM (Sum of dec. nodes in a prime) CHEN78 8.14.2 Z-MIN+1; MIN-Max. Intersection Number BELA81 8.15.8 Extension of McCabe/Nesting of nodes BELA81 8.15.8 BAND-CYC=2*N-BAND/MCC-V DUNS78 8.15.1 Average nesting of decision nodes DUNS78 8.15.1 Maximal nesting of decision nodes DUNS78 8.15.1 Sum of nest, levels of decision nodes BELA81 BAND/D BELABI 8.15.8 Normalized BAND Measure SCHN7 9 8.13 Normalized Reachability by N SCHN79 8.13 Reachability Author 8.13 Normalized Reachability (Modified) Author 8.18.3 Number of nested pairs of ranges H0WA85 8.18.3 Number of pairs of ranges H0WA85 8.18.3 Number of unstr. pairs of ranges SZEN86 8.7 I Stable Set I/(IE I + IN 1) SZEN86 8.7 Stable Set of a flowgraph WOOD79 8.18.1 Number of knots in a linear flowgraph MCCA76 8.4 Essential Compl.: MCC-EV-MCC-D - IMI+ MCCA76 8.4 Author 8.18.3 HOWA85 8.18.3

Essential Compl.: MCC-EV0-IDI-|M| Number of nested pairs Partial unstructuredness

2 Problems in Interpreting Measures

11

92 UNSTR

Howatt; Baker

U

HOWA8 5 !1.18.,3

93 94 95 96 97 98

Zuse, H. Piwowarski Zuse, H. Zuse, H. Zuse, H. Zuse, H.

U UR UR UR UR UR

Author PIW082 Author Author Author Author

UNSTZ PIWO UO UOD UODD UOV

Figure 2.3: Classified list of measures.

i1.18,,3 ((. 18. .2 t!.18,.3 (!.18..3 f¡.18,.3 f¡.18,.3

Sum of predicated nodes in overlapped pairs. Modified UNST of Howatt and Baker Nesting and Unstructuredness Overlapped pairs Overlapped pairs Overlapped pairs Sensitive against unstructuredness

The next seven figures show the calculation of the complexities for several structured and unstructured flowgraphs with the listed measures. The selected flowgraphs consist of different structures, for example, D-Structures (Djikstra-Structures for structured programs), loops and unstructured parts in the flowgraph. A flowgraph is defined exactly in Section 5. A: is the abbreviated name of the flowgraph. In our case it is the filename under the IBM operating system VM/SP. N: is the complete name of the flowgraph which is usually the same as A. R: is the reference of the flowgraph, given by the literature reference or the author. C: is a comment, for example the page of the paper, where the flowgraph was found. SU: S for structured or U for unstructured or empty. Figure 2.4 shows the calculation of the complexity of four simple flowgraphs S1, S2, S3 and S3M. A: SI N: SI R: HARR82 C: Example SU:

A: S2 N: S2 R: HARR82 C: Example SU:

A: S3 N: S3 R: HARR82 C: Example SU:

A: S3M N: S3M R: Author C: Example SU:

...3... 5

6

!

:.>891089

Formal Relational System SR (Real Numbers) Equal or greater than: >

|_5_| b•> a

Binary Operation o: Concatenation: i1 1— 1 1 a 1 b aob

n(b)>n(a) Addition + H(a o b)= n(a) + |i(b)

Figure 4.1: Example of measuring the length of wooden boards a and b. If we measure the length of wooden boards with a rule n, then we have a homomorphism. In Figure 4.1 the empirical relation on the objects, here wooden boards, is "equal or longer than" and the assigned formal relation is "equal or greater". The empirical binary operation o is the concatenation of two wooden boards and the formal binary operation is here the addition +. The mapping from the empirical relational system to the formal relational system preserves all relations and operations, that means mapping is a homomorphism. It is important to notice that we can decide whether one board is longer than another one without using any measurement. This means that there exists an intuitive idea of length independently from measurement. More examples of measurement in classic physics can be found in Krantz /KRAN71/. In the book of Roberts /ROBE79/ examples of the measurement of preferences, loudness, brightness, intelligence, and so on, can be found. 4.1.1

The Difference Between the Measurement of the Length of Wooden Boards and the Complexity of Software

As pointed out, the empirical relation "equal or longer than" is clear for everybody. It is an experience of daily life. However, when using software (complexity) measures, we do not know how the empirical relational system really looks like. We do not have a physical analogue. Hence we do not have a generally accepted homomorphism and thus we have no generally accepted scales.

4 Measurement Theory

42

In Kriz /KRIZ88/ we can find important statements about the empirical relation and the interpretation of the results of measurement. Kriz uses Figure 4.2 below to show the connection of the empirical relational system, the formal relational system, the interpretation of the results of measurement and the role of statistics.

Empirical relational system

Intelligence BARRIER

Formal relational system

Statistics/Mathematics

I

v

Result (Empirical Relevant)

Result (Numerical)

Interprétât ion

Figure 4.2: The measurement process as presented by Kriz /KRIZ88/. Kriz /KRIZ88/ points out: "If the attempt turns out to be completely successful in mapping the empirical structure into the numerical structure (Author: Kriz calls the formal relational system a numerical system), then it becomes possible to reduce the latter with the help of certain mathematical algorithms (where statistics belong to). The numerical data can then be reorganized, classified, grouped and simplified according to specific points of view, characteristic values (so-called "statistics") can be determined and so forth. The end products of reducing information with the help of statistics are definite numerical results, e.g. a median, a correlation coefficient, a chi-square. These numerical results, of course, have no empirical meaning themselves. Rather, they have to be translated back into the empirical statements, a process called interpretation. It is important to stress that the circumvention of the "intelligence barrier" with help of statistics first of all depends on the success in mapping most genuinely the empirical information into a numerical one. In that case only, the reduction can make sense. As a correspondence of what has been said before, all statements in the numerical relational system are valid if and only if they are valid in the empirical relational system, too". In software science and software complexity measurement we have very similar problems. There are many results of a software measurement process, but what is the empirical meaning of such measurements? The problem is the translation back into the empirical system which Kriz calls interpretation. Interpretation is very important in software measurement, since it determines how the empirical relation "equal or more complex" is understood. 4.2 The Definition of Scales and Meaningfulness If we have measurement values, in our case numbers, we want to make statements based on these numbers. For example the statement: "Program P1 is more complex

4 Scales and Meaningfulness

43

than program P2" or "Program P1 is twice as complex as Program P2". In the daily life there are also very often statements like the following: "Today it is 20C at noon, yesterday it was 10C at noon, today is twice as warm as yesterday". More complex statements occur if we compare arithmetic means or if we apply statistical tests. Based on these statements we may make decisions (for example to redesign a program if it is too complex). The "20C" example demonstrates that unless the scale and the allowable operations are understood, meaningless statements or calculations can result. We now consider the problem of meaningfulness in more detail and introduce the admissable transformation. Definition 4.3 (Admissible Transformation):

Let (A, B, n ) be a real scale. A mapping g: n(A) tion if and only if (A, B, g o n) is also a scale. •

B is an admissible transforma-

If we again consider the measurement of length, the multiplication with a positive constant transforms one measure of length into another one, for example meters into yards. Naturally we demand that if a statement is true in meters it remains true if we transform meters in yards. This is the motivation of the following definition: Definition 4.4 (Meaningfulness): A statement is meaningful if and only if its truth value is invariant against all admissible transformations. • Scales are also defined by admissible transformations. For real scales there is a classification of scales according to their admissible transformations /STEV46/. Name of the Scale

Transformation g

Nominal Scale Ordinal Scale Interval Scale Ratio Scale Absolute Scale

Any one to one g g: Strictly increasing function g(x) = a x + b a>0 g(x) = a x a > 0 9(x) = x

Figure 4.3: Several examples of scale types as presented by Stevens /STEV46/ and Finkelstein /FINK84/. 4.2.1 Examples of Scale Types The idea of defining scales by class of admissible transformations is due to Stevens /STEV46/. In general, the scales listed in Figure 4.3 go from the weakest to the strongest, in the sense that absolute and ratio scale contain much more information than ordinal or nominal scales. It is often a goal of measurement to obtain as strong a scale as possible. That goal is also sought in the research area of software complexity measures /HARR82/. It is interesting, that measurement can progress from lower to higher scale types. Stevens /STEV59/ (p.24) gives a very good discussion of this point. Early man probably distinguished only between cold and warm, thus using a nominal scale. Later, degrees of warmer and colder might have been introduced, corresponding to various natural events. This would give an ordinal scale. Later, introduction of thermometers led to in-

4 Measurement Theory

44

terval scales of temperature. Finally, the development of thermodynamics led to a ratio scale of temperature, the Kelvin scale. In software complexity measurement scales may also progress similarly from lower to higher scales. The simplest software complexity measure is the Chump Measure as proposed by DeMarco /DEMA82/. The value of the Measure Chump is 0 if the program is written in the assembly language and it is 1 if it is written in a higher programming language. This is a nominal scale. Introducing the Measure of McCabe gives us under certain conditions an ordinal scale. Requirements of additivity for software complexity measurement may give us certain conditions for the use of the Measure of McCabe as an interval and the ratio scale. We now give several examples for scales. Nominal Scale: In some scales, all one-to-one functions g define admissible transformations. Such scales are called nominal scales. Examples are: Number of the uniforms of football players. Numbering of alternative plans as plan 1, plan 2, etc. Statistics: Non-parametric. Ordinal Scale: The ordinal scale is uniquely only up to order. The admissible transformations are the monotone increasing functions. Examples are: Air quality Program complexity: It assigns a number of 10 for a less complex program, a number of 20 for a intermediate nested and complex program, a number of 30 for a deeply nested and very complex program and a number of 40 for a spagetty code program. We could just as well use the numbers 1.2,12.5,123.9 and 1001, or any numbers that preserve the order. Preference Hardness. Intelligence tests. Statistics: Rank order statistics and all that apply to nominal scales. Interval Scale: The admissible transformations are the positive linear transformations. Examples are: Temperature, as it is commonly measured, that means in Celsius and Fahrenheit. Time of calendar. Statistics: Arithmetic Mean and all that apply to ordinal scales.

4 Scales Types

45

Ratio Scale: A scale with the similarity transformations as its scale of admissible transformations is called a ratio scale. Examples: Mass Kelvin scale Loudness Statistics: Arithmetic Mean Percentage calculation and all that apply to interval scales. Absolute Scale: The only admissible transformation is g(x)=x. There is only one way to measure things in this situation. Examples: • Counting Statistics: All that apply above. We now give some examples to illustrate the importance of the meaningfulness of statements. More examples can be found in Roberts /ROBE79/ and Zuse /ZUSE85/. 4.2.2 Examples of Meaningfulness Let P1 and P2 be two programs and n a software complexity measure. Pressman /PRES87/ writes that the complexity of the combined programs P1 and P2 (P1 o P2) should be greater than the sum of the complexities of program P1 and P2 (Pressmann gives no definition of the concatenation operation). Hence Pressmann demands that the following inequality holds JX(P1 oP2) >n(P1) + n(P2). Weyuker /WEYU85/ proposes a similar formula which includes the possibility of an equal measure: H(P1 o P2) > n(P1) + n (P2). We do not want to discuss if these statements are reasonable or not. But let us assume the measurement is done with an interval scale. Then we have the following inequality using the inequality of Pressman. a H(P1 o P2) + b > a |J.(P1) + b + a N (P2) + b, which does not hold for arbitrary b. Hence the statements of Pressman and Weyuker are not meaningful for an interval scale, but they are meaningful for the ratio scale (considered the five major type of scales as presented above). That means, this statement is only meaningful if the measure n represents a ratio scale. (See the discussion of the statements of Weyuker in Section 6, too). Some authors require additivity /JAYA87/, /MCCA76/ for the statements above: H(P1 o P 2 ) = n ( P 1 ) + n ( P 2 ) . It also means, that this statement is only meaningful for a ratio scale.

46

4 Measurement Theory

The meaningfulness of statements is very important, because they contain requirements for the kind of measurement, for example, the kind of measurement of the complexity of a software system consisting of many modules. It is a requirement to the formal relational (numerical) system of the measurement process. More precisely means that: the binary operation of the formal relational system depends on the statements above. Is the addition of the software programs required, then the binary operation for the formal relational system is"+". Is the relation ">" or "> required, then the binary operation of the formal relational system cannot be the V , it is something like a square-root. But, in every case above, measurement has to be done on the level of a ratio scale. Hence, a ratio scale is not always additive. For more informations of the ratio scale (additive and not additive) see Fishburn (Section 4) /FISH88/, Krantz et al. (Page 154) /KRAN71/ and Narens /NARE84/. The next example of meaningfulness of statements is given in a similar kind by Roberts /ROBE79/. It shows the calculation of the arithmetic mean over two different sets of programs. Arithmetic Mean over two Different Sets: We consider the meaningfulness of the calculation of the arithmetic mean. n

Programs of one kind of experimental type.

m Programs of a second kind of experimental type. We want to say that the average complexity under the first kind of experiment is greater than under the second kind of experiment f

Is the software complexity measure f.

g

Is the admissible transformation.

(1)

l/nl" =1 f(ai)>1/ml7 =1 f(bi).

We consider statement (1) meaningful if for all admissable transformations g, (1) holds if and only if (2)

1/n X"=)(g o f)(ai) > 1/m l7 =1 (g o f)(bi).

If g is a similarity transformation, say g(x)= a x, a>0, then certainly (2) holds if and only if (1) holds. This is even the case when g is a positive linear transformation, that is, g(x)= a x+ p, p>0 for then (2) becomes: (3)

1/nl" = 1 a f(ai)+ p> 1/m X ^ a

f(bi)+p

The statements above show very clearly, that for the calculation of the arithmetic means at least an interval scale is required (considered the five scales as presented above). From this discussion we see that the meaningful use of software complexity measures needs criteria to decide which kind of scale is used. In the next Section a methodology is developed which gives us the criteria for the use of scales. 4.3 Criteria for Ordinal and Ratio Scales It is necessary to have criteria for the kind of scale, which is used with the measure. This requires a measurement theoretic investigation of software (complexity) measures. We consider the empirical objects, the relations between these objects and the binary operations. We assume, that programs are represented by their flowgraphs hence the set of empirical objects P is the set of all flowgraphs.

47

4 Ordinal Scale Firstly, we consider the ordinal scale. 4.3.1 Weak Order and Ordinal Scale

In this Section, necessary and sufficient conditions for an ordinal scale are given. We introduce the empirical relation "equal or more complex" and the weak order. Empirical Relations: Let P be the set of all flowgraphs. We consider empirical relations on the set of flowgraphs. If someone has to decide about complexity of programs given by flowgraphs she/he has an idea of complexity. On the other hand every software complexity measure has a (mostly unknown) behaviour/property. The intuitive idea of complexity is the empirical relation. Some remarks: In the paper /ZUSE89/ the empirical relation is also called a viewpoint which may confuse the reader. A viewpoint is here identical to an empirical relation. The term empirical relation is well known and thus it is not necessary to introduce a new term with the same meaning. Originally, the term viewpoint was introduced by Cherniavsky /CHER71/ to describe evaluation measures for the system proposals of information retrieval systems. If we want to measure something the problem is that we must find a measure which has the same property that reflects our intuitive idea of complexity. To this end we analyze the property of measures and thus obtain a method for the appropriate use of a measure. For this reason, we introduce the concept of the weak order. Here an empirical relation is a binary relation defined on P. The name of the empirical relation is "equal or more complex than". For P,P' e P we introduce the following notations: P •> P' P •= P' P'

P is more complex than P'. P and P' are equally complex. is defined as: P •> P ' o r P P'.

We now define a weak order to be a relation that is complete, reflexive and transitive. For the empirical relation we demand the following axioms to hold: P P

P', P' P" => P •> P" P' or P* P

transitivity completeness

for all P, P', P" e P. That is we assume that our idea of complexity is a weak order. A weak order always implies the axiom of reflexivity: P •> P. Because P is countable and •> is a weak order we know from measurement theory /KRAN71/ that there always exists an ordinal scale

4 Measurement Theory

48

((P,.>),(),H) with P . > P'

n(P)

>

n(P')

for all P, P' e P. Let us consider the triple ((P, •> ),(SR, > ),|i) in more detail. There is the empirical relational system ((P,*>), the formal relational system (SR,>), and the software complexity measure p.. The requirement of the weak order for software complexity measurement is not undisputed. Fenton /FENT89/ argues that an idea of software complexity can be only a partial order. The critical axioms for software measurement are the axiom of completeness and the axiom of transitivity. What is the meaning of the axioms of completeness and of transitivity in the case of software measurement? Completeness means, that an engineer, a programmer, a manager, etc. has to be able to decide in each case when a program is more or equal complex than another one. That, we know, may not always be possible. However, Weyuker /WEYU88/ requires the axiom of completeness for software measurement. (See also Section 6.7). The axiom of transitivity can also be a problem for an intuitive idea of program complexity. W e now make the axiom of transitivity more understandable:

p

!

.>»

!

P'

. ' . > - !

P

1

'

.>=: E m p i r i c a l R e l a t i o n : equal or more c o m p l e x than.

Figure 4.4: The axiom of transitivity. P, P* and P"e P in our case are arbitrary programs or flowgraphs. If a person has an idea of the relation of complexity of three or more programs, it is possible that the decisions of this person do not correspond with the axiom of transitivity: P •> P', P' •> P" => P •> P". In the daily life it happens very often that a person's judgement does not correspond with the axiom of transitivity. For example, if the empirical relation is: "equal or prettier than", and P, P' and P" are pictures, then, in this case it is possible that a person does not accept the axiom of transitivity. Another example are chess players. In this case we have the empirical relation "plays better chess than". If a chess player P1 plays better than P2 and P2 plays better chess than P3, then P1 may not play better chess than P3. However, if there is no weak order then we have no real scale. Considering software complexity measures then we have real numbers. Hence, we request the weak order. However, for our investigations of software complexity measurement and to describe the measures as an ordinal and ratio scale, we request the weak order for our intuitive idea of complexity.

4 Ordinal Scale

49

4.3.1.1 The Empirical Relation "Equal or More Complex Than" The question arises for the reader what is the empirical relation "equal or more complex than" and is it possible to give a definition of the empirical relation "equal or more complex than"? It is not possible to give a general definition of an empirical relation "equal or more complex than". This would provide a general description of all possible ideas of complexity of programs. That means, that we would have to describe all views which explain why a program P is equal or more complex than program P'. But that is not possible with so many views of program complexity. Each person may have her/his own idea of complexity. Every complexity measure has an associated property of complexity. Choosing an appropriate measure means that the measure has the property that corresponds with the idea of complexity of the person or institution that performs measurement. Even though we cannot describe all possible ideas of complexity, but we can still use some ideas of complexity which we can describe. That means we can describe some empirical subrelations (as implicitly given by the authors with the definition of the measures). The consequence is that we consider pieces of the idea of complexity, of maintainability and of reliability. We will get these pieces of complexity, reliability, etc. from the measures. Hence, we talk about empirical subrelations (see below). 4.3.2 Extensive Structure and the Ratio Scale From the ordinal scale we get the ratio scale via the Extensive Structure. The ordinal scale is a prerequisite for the criteria of the ratio scale. If a measure obeys the ratio scale we can calculate and compare the arithmetic mean and percentages as required in literature. To describe a measure as a ratio scale the Extensive Structure /KRAN71/, /ROBE79/ is used. In order to obtain a ratio scale, the most common way is to use the Extensive Structure. The empirical and the formal relational system of the ordinal scale ((P,.>),(*,>),^) has to be extended to ((P, •> ,o),(9l, > ,+),n) by the binary operations o for the empirical system and + for the formal relational system. Extensive Structure: Extensive attributes /KRAN71/ such as length and mass have been measured successfully since antiquity. The modern theory of extensive measurement, however, originated less than a century ago when Helmholtz (1887) and Holder (1901) developed the first axiomatic analysis of extensive attributes. Generally speaking, a theory of extensive measurement is a set of assumptions, or axioms, formulated in terms of an ordering •> , of objects with respect to some property, and a binary operation o between the objects that permit the construction of a scale f satisfying

4 Measurement Theory

50 a

« b

f(a) >

f(b)

and f(a o b) = f(a) + f(b). The first formula represents the measurement of the ordinal scale. Both formulas represent the extensive measurement. It is the known relation of the ordinal scale and the additive property of the ratio scale. Since the additive representation mass, length, and time duration have become a part of our daily experience we tend to take for granted the qualitative laws that underlie the numerical representation. Indeed, under the natural interpretations of and o, these laws typically reduce to common physical truths. We now give the definition of the Extensive Structure /KRAN71/, /ROBE79/.

Definition 4.5 (Extensive Structure): Let P be a non-empty set, a binary relation on P, and o a binary operation on P. The relational system (P, o ) is an Extensive Structure if and only if the following axioms hold for all P1,..,P4 e P: A1: (P,«£ )

is a weak order

A2: P1 o (P2 o P3 )=(P1 o P 2 ) o P3,

axiom of weak associativity

A3: P1

P2 P1 o P3

P2 o P3 P3 o P1

P3 o P2 axiom of monotonicity

A4: If P3 • > P4 then for any P1 ,P2, there exists a natural number n, such that P1 o nP3 *£P2 o nP4, Archimedian Axiom

• Theorem 4.1 (Roberts and Luce 1968 /KRAN71/): Suppose A is a non empty set, •> is a binary relation on P, and o is a binary operation on P. Then there is a real-valued function f: P ->SR satisfying: a

•;> b f(a) £

f(b)

and f(a o b) = f(a) + f(b) if and only if (P, ,o) is an Extensive Structure. If another function f fulfills these properties then there exists a positive real-value a that f (a) = a f(a) holds. • The meaning of the notation nP is: If (A,o) is a group, we may define na for every positive integer n. The definition is inductive. We define 1a to be a. Having na, we define (n+1)a to be a o na. The definition makes sense whenever (A,o) is associative.

4 Extensive Structure and the Ratio Scale

51

The real valued function f is in our case a software (complexity) measure. An application of the Theorem of Roberts and Luce is given by the description of the Measure of McCabe as a ratio scale in Section 4.7. However, there exist other possibilities to give necessary and sufficient conditions for the ratio scale. For that see Fishburn (Section 4) /FISH88/, Krantz et al. (Page 154) /KRAN71/ and Narens /NARE84/. The Extensive Structure seems to be the most intuitive way to get the ratio scale. 4.4 Description of Measures as an Ordinal and Ratio Scale In Section 4.3 we described the criteria for an ordinal and a ratio scale. In this Section we present the description of measures as an ordinal and a ratio scale. That involves the use of measures (Here software complexity measures) as an ordinal and a ratio scale. It is necessary to have criteria which scale is used. In order to describe software complexity measures as an ordinal and a ratio scale, we introduce atomic modifications (ordinal scale), empirical subrelations (parts of the idea of complexity), atomic modifications, partial properties of a measure, property of a measure and the binary operations (Ratio scale) between programs. Firstly, we consider the description of measures as an ordinal scale with empirical subrelations and atomic modifications. 4.4.1 Empirical Subrelation Because it is not possible to give the definition of the empirical relation "equal or more complex", we introduce the definition of an empirical subrelation. An empirical subrelation is used to reduce and to describe empirical relations, in our case "equal or more complex than". Definition 4.6 (Empirical Subrelation): Let be an empirical relation. An empirical subrelation *>e of an empirical relation is a binary relation on P with P»>e P'

=>

P*> P'

P»»eP'

=>

P •=> P'

for all P, P" e P. • That means, *se is a subset of an empirical relation or a part of an idea of complexity. Empirical subrelations differ from empirical relations. An empirical subrelation is not necessarily an empirical relation and hence not necessarily a weak order. It is a piece of an empirical relation, which means that it contains partial information about the empirical relation. 4.4.2 Atomic Modification We introduce the definition of an atomic modification in a flowgraph. Atomic modifications (AM) in the flowgraph are used to describe partial properties of a measure. Definition 4.7 (Atomic Modification): An atomic modification is the change of a flowgraph P1 to flowgraph P1' by any modification, like adding, deleting, transfering edges and nodes in the flowgraph. •

4 Measurement Theory

52

Atomic modifications can be applied to a flowgraph without considering a software complexity measure. For example, we consider the atomic modifications M1, M5 and MEDG: M1

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

M5

To transfer an edge from one location in the flowgraph to another location in the flowgraph.

MEDG

To add an edge at an arbitrary location in the flowgraph.

Figure 4.5 shows the application of the atomic modification MEDG in a flowgraph. A: P I N: PI R: Author C: Example SU: S

A: P4 N: P4 R: A u t h o r C: E x a m p l e SU: 1 s

. .6. v . .7. 9

8

:>ioe to an atomic modification X. A partial property can be seen as a subset of PxP.

• This means, the application of an atomic modification in a flowgraph and the sensitivity of the software complexity measure to this atomic modification is a partial property of the measure. We now demonstrate the partial properties of some measures to the atomic modification MEDG. OVERVIEW ABOUT MEASURES: SECTION T S REF

MEASURE

AUTHOR

DEC MCC-V STABLE N+E ALPHA

Several a u t h o r s Zuse, H. Zuse, H. McCabe, T. Szentes; Gras Zuse, H. Szentes; Gras

B P B B S B S

CONT86 Author Author MCCA76 SZEN86 Author SZEN86

8.3 8 8 8.4 8.7 8.7 8.7

C O M M E N T TO T H E M E A S U R E L i n e s o f Code N u m b e r of e d g e s IE I in G. N u m b e r of d e c i s i o n n o d e s MCC-V=IEI - INI + 2p, p = l Stable Set of a f l o w g r a p h Nodes + Edges IStable Set I/(IE I + IN I)

Figure 4.6: The list of measures used in the examples below.

4 Partial Property of a Measure

53

A: P4 N: P4 R: Author C: Example SU:

w : ci R: Author C: Example SU: S 1 s

I s

V

v

2
6io

To add an edge at an arbitrary location in the flowgraph.

The complexity of the Measure MCC-V always increases ">" by the atomic modification MEDG. This is a partial property of the Measure MCC / of McCabe to the atomic modification MEDG. The sensitivity of the Measure LOC to the atomic modification MEDG is: MEDG

=

To add an edge at an arbitrary location in the flowgraph.

The complexity of the Measure LOC remains always unchanged "=" by the atomic modification MEDG. That is a partial property of the Measure LOC to the atomic modification MEDG.

4 Measurement Theory

54

What does that mean? Every Measure n has a sensitivity related to an atomic modification in the flowgraph. This sensitivity is denoted a partial property. For example, applying the atomic modification MEDG, the partial property to the atomic modification MEDG of the Measure MCC-V is ">" and the partial property of LOC is "=". The concept of partial properties allows the reader to analyze, compare and select measures. As Khz /KRIZ88/ pointed out, the numerical result alone has no empirical meaning. It is only the mathematical description of the measure. The numerical results have to be translated back into the empirical statements, a process that Kriz called the interpretation. That means, if the user's idea of complexity is identical to the partial property to the atomic modification MEDG of the Measure MCC-V, in this case "more complex", then this partial property of the Measure MCC-V is an empirical subrelation of the empirical relation "equal or more complex" of the user. That leads us to the definition of the property s of a measure. 4.4.4 Property s of a Measure The definition of the property s of a measure is given as: Definition 4.9 (Property s of a Measure): The set of partial properties which describe a measure completely, is called the property s of the measure. • With the term property (not property s) we denote the behaviour or property of a measure in general. 4.4.5 Empirical Subrelation of a Measure A user has pieces of ideas of complexity which can correspond with a partial property to an atomic modification of a measure. That leads us the the term of an empirical subrelation of a measure. Definition 4.10 (Empirical Subrelation of a Measure): •>e is an empirical subrelation of a measure (i if and only if it is a partial property of the measure. • What does that mean? P *>e P' is an empirical subrelation "more complex". If a measure p. has a partial property ">", then it is the empirical subrelation of the measure l i . In this case a piece of an idea of complexity of a person corresponds with the partial property of the measure. What is the advantage of knowing partial properties of the Measure MCC-V to one or more atomic modifications and what is the connection to the empirical relation? The user knows that inserting an edge in a flowgraph increases the value of the Measure MCC-V. If she/he would apply this atomic modification to the Measure LOC (Lines of Code), the value remains unchanged. The increasing values describe only the mathematical property of the measure. But if the empirical relation is "equal or more complex", then the increasing value of the measure has to be interpreted as more complex.

4 Property of a Measure

55

If the partial property > is not consistent with the idea of complexity of a person (empirical subrelation *>e) she/he may not use the Measure MCC-V of McCabe as a complexity measure. Hence the description of the partial properties of the measures are useful for deciding whether to reject a measure or not. Of course, an agreement of the property s of the measure with respect to one atomic modification is not sufficient, because there may be other measures with the same partial property to this atomic modification. Partial properties describe the ranking order of the programs. How do we obtain atomic modifications and partial properties? First of all, every pair comparison of two flowgraphs, together with the information which is more complex, is a partial property. We obtain more general partial properties by applying atomic modifications in the flowgraphs and then ask for the resulting partial property of complexity. More atomic modifications are described in Sections 7 and 8. As a consequence of the statements above the question arises of the selection of an appropriate measure for software measurement.

4.4.6 The Choice of an Appropriate Software Complexity Measure The appropriate way of measurement would be to define an empirical relation of complexity and to choose an appropriate measure. But, the choice of an empirical relation of software complexity is not a formal problem. There exists no generally accepted idea of the empirical relation "equal or more complex". It is a problem to be discussed by programmers, managers, etc. It can not be solved here. For this reason, we choose another approach. We describe the partial properties of software complexity measures by using atomic modifications. That means, that we look at the piece of an idea of complexity which is connected with the software complexity measures. We interpret the numerical results of the measures by their partial properties to atomic modifications and derive from that an empirical meaning (interpretation) of the numerical results. We explain this by the formula

((P, ? The empirical relation "equal or more complex than" is here replaced by an "?". That means, we do not know how the empirical relation really looks like. W e look at the partial properties of the measures and derive from that the empirical subrelations of complexity. This way is not usual, but because the term complexity is not well defined, we use the ideas of complexity which are connected by partial properties with the measures. The advantage is, that the user knows exactly which empirical relation should be hold with the measure. The user has to decide whether his idea of complexity corresponds with the empirical relation of the measure. In other words: there exists the relational system of the measure and the empirical relational system of the person. The description of measures by partial properties describes the relational system of the measure. The user doing measurement has to decide whether both relational systems are identical. The consequence is: the idea of complexity behind the measure (partial properties) has to correspond with the empirical subrelations of the persons who makes measurement.

4 Measurement Theory

56

4.4.7 Partial and Complete Description of the Property s of a Measure The question is when the property s of a measure n is partially or completely described by partial properties. 4.4.7.1 Partial Description of the Property s of a Measure Definition 4.11 (Partial Description of the Property s a Measure): Every measure has a partial property corresponding to an atomic modification. A measure is partially described if its property s is partially described. • Let us consider the partial properties of the Measures MCC-V and LOC to the atomic modification M1. Measure MCC-V: M1

=

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

If we apply the atomic modification M1 to the Measure LOC, we get. Measure LOC: M1

>

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

The Measures MCC-V and LOC have different partial properties to the atomic modification M1. Applying the atomic modification M1, the complexity remains unchanged "=" for the Measure MCC-V, but the complexity increases ">" for the Measure LOC. However, the properties of the Measures MCC-V and LOC are only partially described by the partial property to the atomic modification M1. As shown in Section 4.4.2, there is at least one more partial property of the Measure MCC-V and that is the atomic modification MEDG. 4.4.7.2 Complete Description of the Property s of a Measure In order to describe the property s of a measure completely, we have to build the reflexive and transitive closure /BOLL81/ of the partial properties ei of a measure (i. Definition 4.12 (Complete Description of a Measure by Partial Properties): Let E= (ej) j e |, I an index set, be a family of partial properties, then the property s of a measure is completely described by partial properties iff s = H(U i e l ej), where H is the reflexive and transitive closure, s the property s of the measure and I an index set, be a family of the partial properties ei of a measure. • It is not always easy to describe the property s of a measure completely. The reason for that is the difficulty to figure out appropriate atomic modifications. So, at this time, we have mostly partial descriptions of measures. 4.4.8 Summary of Partial Properties and Atomic Modifications The important ideas relating to the description of the ordinal scale of a measure are summarized below.

4 Partial and Complete Descriptions of Measures

57

Every measure can be described mathematically by partial properties to atomic modifications. Important is the interpretation of the numbers of the measure. Without an interpretation of the numbers the values of the measures have no empirical meaning. Every person has an idea of complexity. This idea of complexity is the empirical relation "equal or more complex than". A formal definition of the empirical relation "equal or more complex than" is not possible because there are two many views of complexity. There are existing empirical subrelations of the empirical relation "equal or more complex than", for example: A program becomes more complex by the following modification: To add a node and an edge (Statement) at an arbitrary location in the flowgraph. The increasing complexity is an empirical subrelation. Every software complexity measure has a property s on the ordinal scale. The property s of the measure is reduced in partial properties described by atomic modifications. If a person wants to use a complexity measure, her/his idea of complexity, expressed by empirical subrelations and the partial properties of the measure, must correspond. To describe the property s of a measure completely it is necessary to build the reflexive and transitive closure of the partial properties. 4.4.9 Modified Axioms of the Extensive Structure In order to describe measures as a ratio scale we investigate the properties of the measures with the axioms of the Extensive Structure. For our investigation we use a modified set of axioms as proposed by Bollmann /BOLL84/. The axiom of weak monotonicity has been modified for more intuitive acceptance, the axiom of weak commutativity has been added and the Archimedian axiom has been made stronger (from > to >). Theorem 4.2 (Modified Extensive Structure): Let P be a non-empty set, a binary relation on P, and o a binary operation on P. The relational system (P, o ) is an Extensive Structure if and only if the following axioms hold for all P1 ,..,P4 e P. A1 : (P.-* ) A2: P1 o (P2 o P3 H P 1 o P2 ) o P3,

axiom of weak associativity

A3: P1 o P2 =P2 o P1,

axiom of weak commutativity

A4: P1

axiom of weak monotonicity

P2=> P1 o P3 •> P2 o P 3

is a weak order

A5: If P3 •> P4 then for any P1 ,P2 there exists a natural number n, such that P1 o nP3 •> P2 o nP4, Archimedian Axiom • We now have to consider the binary operation o between the objects. In Figure 4.1 a binary operation for wooden boards was shown. The objects in our case are programs or flowgraphs.

4 Measurement Theory

58

4.4.10 Binary Operations between Programs In order to have an Extensive Structure a binary operation o has to be defined. In this book a sequential concatenation BSEQ and an "if-then-else" binary operation BALT are proposed and investigated. The binary operations BSEQ and BALT have already been proposed by Zuse /ZUSE85/. s . .. .o

s o

P I

V o . . . .

V o.

. . . . o P I

.

.

P2

. . . .o

p2 . . .

.o

t

o . . . .

o.

!

;

!

*

;

B i n a r y BSEQ

>o
6eioio

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

N1

>

Measure BAND: To increase the nesting level L(n) of an arbitrary node n in Gd.

N2

=

Measure BAND: To cancel a node n, 0(n)=l and I(n)=l, on nesting level L(n)>=2 and to add L(n) nodes and edges at node t.

N3

=

To cancel one of two parallel edges in a flowgraph.

C

Y

Remarks: Y: Measure is completely described; N: Measure is not completely described.

Measure: BAND Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y Y Y

N

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure/Ratio scale

Figure 7.12: Interpretation of the complexities of the flowgraphs P1 and P W S for the Measure BAND of Belady. The complexity BAND(PWS)=18 is greater than BAND(P1)=16 because the following partial properties of the Measure BAND:

7 Interpreting the Numbers

115

M1

>

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

N1

>

Measure BAND: To increase the nesting level L(n) of an arbitrary node n in Gd.

If we use the Measure BAND of Belady as a complexity measure, the complexity increases by two atomic modifications M1 or N1. The Measure BAND is an Extensive Structure for the binary operation BSEQ and can be used as a ratio scale if the person who performs measurement accepts the partial properties of the Measure BAND and the binary operation BSEQ. The Measure BAND is not an Extensive Structure for the binary operation BALT because it does not have the property of the axiom of associativity. The examples show that in most cases the values of the measures can be interpreted very easily. The costumer knows exactly the meaning of the numbers. This approach makes it easier to use and to select software complexity measures in practice. 7.2.5 Selection of Measures with MDS Using the concept to describe measures with partial properties to atomic modifications, it is very easy to select measures. We demonstrate that by selecting measures whose complexity increase for the partial property ">" to the atomic modification MEDG. MEASURES SELECTED BY: MEDG > 1



t AM

AM-MATCH

1 2 3 4 5

3 3 3 3 5

1 1 1 1 1

6

5

1

Z

7

5

1

MINQ

8 9 10 11

4 4 4 7

1 1 1 1

MWD-MH MWD-HB MWD-LC PIWO

12

7

1

CSG

MEASURE MCC-V MCC-V-Q MCC-V2 N-MCCABE MIN

PARTIAL PROPERTIES Ml = MEDG > M5 Ml - MEDG > M5 Ml = MEDG > M5 = Ml * MEDG > M5 Ml = MEDG > BF = CHS = CHPS = Ml - MEDG > BF = CHS CHPS Ml = MEDG > BF - CHS CHPS Ml = MEDG > M5 * FB > Ml = MEDG > M5 * MNL > Ml M5 » LCI > Ml RNST > ROV > PW1 = PW2 = M5R = Ml - MEDG > RNST > M5 * BF > ROV to the atomic modification MEDG: To add an edge at an arbitrary location in the flowgraph. The meaning of the heading columns is: #: current number; #AM: number of partial properties to atomic modifications for the measure; AM-MATCH: number of partial properties which are identical between the query and the measure; MEASURE: name of the measure, and PARTIAL PROPERTIES: partial properties of the measure to the atomic modifications. For example, the Measure PIWO was selected by the partial property > to the atomic modification MEDG. It is described by seven partial properties. One partial property corresponds with the query. Using the description of measures by partial properties to atomic modifications makes it easy to select measures in a person machine dialog. 7.2.6 Examples and Counterexamples for the Extensive Structure The system MDS allows the calculation of examples and counterexamples for the modified set of axioms of the Extensive Structure as proposed by /BOLL84/ (See Section 4.4.9). The modified set of axioms of the Extensive Structure is:

7 Our Investigation of the Measures

116

1. 2. 3. 4. 5.

Axiom of weak order (Ordinal scale). Axiom of weak associativity. Axiom of weak commutativity. Axiom of weak monotonicity. Archimedian axiom.

In our further considerations we leave out the term "weak". Characterizing a measure as an Extensive Structure, the property of the measure to a certain binary operation, in our case the binary operations BSEQ and BALT, has to be investigated. We now present examples for the axioms of the Extensive Structure. 7.2.6.1 Axiom of Associativity Every measure has the property of the axiom of associativity for the binary operation BSEQ because the structure of the flowgraph does not change. But, considering the binary operation BALT the structures of the both flowgraphs are not identical.

P2.

.

PI

. .

. .

P2

. .

. .

P3

.

. P2.

P2 .

Figure 7.14: Axiom of associativity for the binary operation BALT: (P1.P2)*P3 •=P1»(P2»P3) Many measures have the property of the axiom of associativity for the binary operation BALT. However, measures which are sensitive to nested structures mostly do not have the property of the axiom of associativity. An example illustrates that:

7 Interpreting the Numbers

A: AS2 N: Associativity for BALT R: Author C: Axiom of Associativity SU:

A: AS1 N: Associativity for BALT R: Author C: Axiom of Associativity SU:

3 v 4 :..>5

117

6

12

v 7 V

8

!

13

!

!

:..>i4

V

3 ! .

V

B

V

V

• >4

11

; 12

9

!

V

>13

PI o. . .

P2 o

V

V

V

V

o oo

o o

.. .>o •>10566

!

8
P2 => P1 o P •> P2 o P, with P1»£P2 and an arbitrary P, and o is the binary operation BSEQ.

7 Interpreting the Numbers

119

The axiom of monotonicity is a very important axiom for the investigation of software complexity measures and measurement. The user has to decide what is his intuitive idea of complexity to the property of the axiom of monotonicity. What are the consequences for software measurement if a user rejects or accepts the property of the axiom of monotonicity? One consequence of the rejection of the axiom of monotonicity would be, that the Extensive Structure cannot be used to describe a measure as a ratio scale for the binary operation BSEQ. Weyuker /WEYU85/, /WEYU88/ points out that a measure should not have the property of the axiom of monotonicity. (See also the discussions in Section 6.7). We present the calculation of the axiom of monotonicity for the three flowgraphs P1, P2 and PWS with the Measure EJ-ISC of Ejiogu. The flowgraphs P1 and P2 have the same complexity with the Measure Ej-ISC (EJ-ISC(P1)=EJ-ISC(P2)=2). The flowgraphs P1 and P2 are concatenated by the binary operation BSEQ with flowgraph PWS. A: PI N: PI R: Author C: Example SU: S 1

A: P2 N: P2 R: Author C: Example SU: S 1 s

a

2

V

2

...3... v 4

v .3...

v 5

!.>6?9io8< V

10

.. .9.

V

V

V

1.12. t

11 12 t

10

V

11

Axiom of monotonicity: Binary operation BSEQ: Ml = PI o PWS M2 - P2 o PWS MEASURES OF EJIOGU: RESULTS OF THE MEASURE(S) DEC PRIMES EJ-L EJ-E EJ-M EJ-ISC EJ-DSC

PI

P2

PWS

Ml

M2

2..00 2..00 1..00 2 .00 1 .00 2 .00 0 .50

2..00 2..00 2..00 1..00 1..00 2 .00 0 .50

3.00 3.00 1.00 3.00 1.00 3.00 0.33

5..00 5..00 1..00 5..00 1..00 5..00 0 .20

5..00 5..00 2,.00 4,.00 1..00 8..00 0 .13

Figure 7.19: Calculation of the axiom of monotonicity with the Measures EJ-ISC for the binary operation BSEQ. M1 and M2 are the names of the concatenated flowgraphs: M1=P1oPWS and M2=P2oPWS. The values of the Measure EJ-ISC are: EJ-ISC(P1)=2 and EJ-ISC(P2)=2. Both flowgraphs P1 and P2 have the same value of complexity for the Measure EJ-ISC. However, the concatenated flowgraphs M1=P1oPWS and M2=P2oPWS by the binary operation BSEQ must also have the same complexity to fulfil the axiom of monotonicity. As to see, the complexity of EJ-ISC(P1oPWS)=5 and EJ-ISC(P2 o PWS)=8. That means,

7 Our Investigation of the Measures

120

that the Measure EJ-ISC of Ejiogu does not have the property of the axiom of monotonicity. The consequence is that the Measure EJ-ISC is not an Extensive Structure and cannot be used as a ratio scale (See also Section 4). 7.2.6.4 Archimedian Axiom While the axioms of associativity, commutativity and monotonicity are testable axioms, the Archimedian axiom is not a testable axiom. PI and P2 arbitrary

.> .
P4 then for any P1,P2 there exists a natural number n, such that P1 o nP3 •> P2 o nP4. Many measures have the property of the axioms of associativity, commutativity and monotonicity, but they do not have the property of the Archimedian axiom. An example for that is the Measure DMAX, which analyzes the maximal nesting depth of a flowgraph. 7.3 Atomic Modifications, Partial Properties and the Ordinal Scale In Section 4 the introduction in measurement theory was presented, the criteria for the ordinal and ratio scale were given and the description of measures as an ordinal and a ratio scale were presented. In order to describe measures as an ordinal scale, we go more deeply in the concept of partial properties to atomic modifications and apply this concept to the Measures MCC-V of McCabe, the Measures MCC-V-Q and the Measure C2. The definitions of the measure are: MCC-V(G) = |E| - |N| + 2, MCC-V2(G) = |E| - |N| + 1, MCC-V-Q(G) = (|E| - |N| + 2)"1.5, and C2(G) = 2*|E| - |N| + 1. The Measures MCC-V and MCC-V2 are Measures of McCabe, the Measure MCC-V-Q is a modification of the Measure MCC-V by a strictly monotonic transformation ""1.5", and the Measure C2 is a modification of the Measure MCC-V of McCabe by the author. The question is what are the partial properties of the Measures MCC-V, MCC-V-Q and C2 and what are the differences of the partial properties between the Measures MCC-V, MCC-V-Q and C2?

7 Measures as an Ordinal Scale

121

We have to distinguish between the atomic modification (AM) and the partial property of the measure to the atomic modification. An atomic modification is a change In a flowgraph (to add an edge, or to transfer an edge from one location to another location, etc.). Atomic modifications can be applied to the flowgraph without using any software complexity measure. A partial property of the measure is the sensitivity of the measure to a certain atomic modification. We say, for example: The Measure X has the partial property ">" to the atomic modification M1. We demonstrate that with the following examples. The calculation of the complexities of the Measures MCC-V, MCC-V-Q and C2 with the flowgraphs PWS, PWN, P1 and P4 is shown. Then the atomic modifications are defined to describe the partial properties of the Measures MCC-V, MCC-V-Q and C2. A: PWS N: PWS R: Author C: Example SU: U

2

A: P4 N: P4 R: Author C: Example SU:

A: PI N: PI R: Author C: Example SU: S

A: PWN N: PWN R: Author C: Example SU:

1 s

1 s

2

v 24

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

MEDG

>

To add an edge at an arbitrary location in the flowgraph.

M5

=

To transfer an edge from one location in the flowgraph to another location in the flowgraph.



It is easy to see that the differences between the Measures MCC-V, MCC-V-Q and C2 are the partial properties to the atomic modification M1. Using the Measures MCC-V and MCC-V-Q, the complexity does not increase, but using the Measure C2, the complexity increases. The question is whether the measures are completely described by the partial properties to the defined atomic modifications M1, MEDG and M5. The property s of the Measures MCC-V and MCC-V-Q are described completely (See below) by the partial properties to the defined atomic modifications M1, MEDG and M5 (See the proof below). The the Measure C2 is only partially described by the partial properties to the atomic modifications M1, MEDG and M5 (See below). Very often it is not possible to describe a measure completely by the partial properties. It is not always possible to figure out appropriate and intuitive acceptable atomic modifications for the complete description of the measure. The reason for that can be a very "complicated" definition of the measure, like the Measures NC of Whitworth and Szulewski, the Measure CSG of Schmidt and Gong, or the Measure ALPHA of Szentes and Gras. That leads us to the discussion of the complete description of the property s of a measure as an ordinal scale. Complete Description of a Measure The complete description of the property s of a measure means, that it must be possible to say for every pair of programs P and P' why program P is more, equal or less complex than P' expressed by partial properties to atomic modifications. The complete description of a measure requires a proof (Reflexive and transitive closure). Complete Description of the Measures MCC-V and MCC-V-Q We describe the idea of the proof for the complete description of the Measures MCC-V, MCC-V-Q and C2. Let F be an arbitrary flowgraph. Then the steps for the proof are the following: The first step is to find a specific standardized flowgraph F'. The structure of the standardized flowgraph F' depends on the definition of the measure. For the complexities of an arbitrary flowgraph F and the standardized

7 Our Investigation of the Measures

124

flowgraph F' holds: |i(F)= n(F'). The complexity of the flowgraph F' should increase by only one atomic modification. In the case of the Measures MCC-V and MCC-V-Q the flowgraph F' is a sequence of if-then structures. The complexity of F increases by the atomic modification MEDG. The second step is to show that it is possible to modify each arbitrary flowgraphs F into the standardized flowgraphs F by the partial properties to the defined atomic modifications for the measure. If that is possible for every arbitrary flowgraph then the measure is completely described by the partial properties to the atomic modifications. If that is not possible then the measure is only partially described by partial properties. The set of the partial properties to the atomic modifications of a measure is not unique. It is possible to describe the partial properties of the Measure MCC-V with several sets of atomic modifications.

. . .o

PI'

.

F1

o

F2'

Figure 7.22: Two standardized flowgraphs F1' and F2' which are different in only one atomic modification MEDG. F1' is more complex than F2' because F1' has one more edge than F2' and that is exactly a partial property to the atomic modification MEDG of the Measure MCC-V. It holds MCC-V(F1)= MCC-V(FV) and MCC-V(F2)= MCC-V(F2'). Using the defined atomic modifications M1, MEDG and M5 for the Measure MCC-V, the arbitrary flowgraphs F1 and F2 have to be changed into the flowgraph F1' and F2' keeping the complexity. If that is possible for every arbitrary flowgraph then the measure is completely described by the partial properties to the defined atomic modifications. That is in the case of the Measure MCC-V not complicated because the atomic modifications M1 and M5 do not change the complexity. Egdes and nodes can be deleted without changing the complexity and edges can be transfered without changing the complexity. Let us consider an example of the modification of an arbitrary flowgraph to the standardized flowgraph. For the flowgraph P1 the modification to P1' can be done in the following way. P1' is the standardized flowgraph.

7 Measures as an Ordinal Scale A: PI N: PI R: Author C: Example SU: S

A: PIM N: PIM R: Author C: Example SU: S

A: PIMM N: PIMM R: Author C: Example SU:

125 A: P1MMM N: P1MMM R: Author C: Example SU: S

A: PI" N : PI' R: Author C: Example SU: S

1 s

1 s

1 s

1 s

1

2

2

2

2

2

...3...

..3

. .3

• >10

->10 V

• >10

V

11 V

11

V

11

5

V

5

V

5

V

V

8

V

B

V

V

12

12

. . .3..

...3

v

v

! .>66

!>10io P' o P •> P" o P, with P'*>P", P arbitrary, and o is the binary operation BSEQ. We give an example to demonstrate that the Measures HALST-V, HALST-D and HALST-E do not have the property of the axiom of monotonicity. PROGRAM P' P" P P'oP P'oP P'oP P"oP

nl

n2

N1

N2

V

D

E

100 90 301 401 350 320 391

100 80 101 201 150 120 181

300 200 5000 5300 5300 5300 5200

400 200 4700 5100 5100 5100 4900

5350.70 2963.76 83915.19 96029.63 93244.19 91326.13 92514.69

200.00 112.50 7003.46 5087.31 5950.00 6800.00 5292.54

1070139.00 333422.69 587696896.00 488532224.00 554802688.00 621017600.00 489637376.00

Figure 8.9: The Measures HALST-V, HALST-D and HALST-E of Halstead do not have the property of the axiom of monotonicity for the binary operation BSEQ. For the concatenation of P' o P are given some examples to demonstrate the different possiblities of the addition of the distinct operators and operands.

145

8 Measures of Halstead

Hence, the Measures HALST-V, HALST-D and HALST-E of Halstead are not an Extensive Structure to the binary operation BSEQ because they do not have the property of the axiom of monotonicity. The measures cannot be used as a ratio scale.

Final Discussion of the Measure The Measures of Halstead are not a major part of this book. However, we present the Measures of Halstead because the Measures HALST-V and HALST-E are used in connection with some measures based on flowgraphs. More informations about the Measures of Halstead can be found among others in Lister /LIST82/, Bauley and Dingee /BAIL81/, Bohrer /BOHR75/, Elshoff /ELSH76/, Gordon and Halstead /GOHA76/, Fitzsimmons and Love /FITZ78/, /FITZ78a/, and Love /LOVE76/. The Measures of Halstead, beside the Measures of McCabe and lines of code (LOC), are the most discussed and investigated measures in literature. We are not able to say whether the Measures of Halstead are appropriate measures to analyze the quality and complexity of software, the effort to implement software, or the difficulty to write software. That has to be investigated by well prepared experiments. We present an overview of the properties of the Measures of Halstead. * 1 2 3 4 5

NAME

AUTHOR

HALST-N HALST-VC HALST-V HALST-D HALST-E

Halstead, Halstead, Halstead, Halstead, Halstead,

OVERVIEW ABOUT MEASURES: BSEQ REF O A C M A R E S C M. M. M. M. M.

HALS76 HALS76 HALS76 HALS76 HALS76

Y Y Y Y Y

Y Y Y Y Y N Y N Y N

Y Y

E E

BALT A C M A R E

R R

Figure 8.10: The properties of the Measures of Halstead related to the axioms of the Extensive Structure. The Measures HALST-V, HALST-D and HALST-E of Halstead are not Extensive Structures because the measures do not have the property of the axiom of monotonicity. However, some properties of the Measures of Halstead are worth of notice. The Measures HALST-V, HALST-D and HALST-E are not Extensive Structures. They do not have the property of the axiom of monotonicity to the binary operation BSEQ. The consequence is that the Measures HALST-V, HALST-D and HALST-E cannot be used as a ratio scale. Doing experiments, that is very important for the selection of the appropriate correlation coefficients and the kind of statistics. Calculating the arithmetic mean and the percentages with the Measures HALST-V, HALST-D and HALST-E, may lead to wrong results because these statistical operations are only meaningful for measures which can be used as an interval and a ratio scale. For the Measures HALST-V, HALST-D and HALST-E only the calculation of the median makes sense or the user has to give other conditions that the measures can be used as an interval or ratio scale. It is hard conceivable that the Measure HALST-E does not have the property of the axiom of monotonicity. The programmer, the reader, etc. have to think about whether the effort to write a program may not have the property of the axiom of monotonicity. As to how to do the correct experimentes we do recommend among others the book of Kriz /KRIZ88/.

146

8 Characterization of the Properties of Measures

8.3 Measure Lines of Code Name of the Measure: Lines of Code LOC. Author of the Measure: Several authors. Published In: /CONT86/./LEVI86/, and others. Definition of the Measure: The Measure Lines of Code (LOC) is defined in many different ways. The question is: What is a line of code. In Conte /CONT86/ we can find a definition for that: "A line of code is any line of program text that is not a comment or blank line, regardless of the number of statements or fragments of statements on the line. They specifically includes alle lines containing program headers, declarations, and executable and non executable statements" In the last analysis it is a question of the mapping function from the source code to a flowgraph. Levitin /LEVI86/ considers five types measuring the size of software: Source lines of code. The number of statements. Software - Science: Length and Volume /HALS77/ (Section 8.1). The number of tokens in the program. Another modification of the Measure LOC is the Measure SBSM-V of Bache, Fenton and Kaposi (See Section 8.15.3). Measure LOC We present here the most published definition of the Measure LOC. Definition 8.8 (Measure LOC): For flowgraph: G C(G)= |N|, with |N| •

Number of nodes in G.

Examples In order to explain the Measure LOC the flowgraphs LC1 and LC2 are presented. A: N: R: C: SU

LCI LCI Author Example U

A: N: R: C: SU

1 s

LC2 LC2 Author Example U 1 s

V

2 V

..>3...

..>3...

V

..,4< V

5M1 P2 => n(P1) > n(P2) P1 P2 => ji(P1) = H(P2) P1 -MEDG P2 => ji(P1) = n(P2) Explanation of the Atomic Modifications: The Measure LOC is completely described by the defined atomic modifications. It is easy to see that M1, M5 and MEDG describe the property of the Measure LOC. Only the atomic modification M1 increases the complexity of the Measure LOC. The following theorem can be proved. Theorem 8.1 The Measure LOC is completely described by the partial properties to the atomic modifications M1, M5 and MEDG. • Idea of a Proof of Theorem 8.1 : We show two flowgraphs P1" and P2' with the same complexity of the arbitrary flowgraphs P1 and P2 but consisting of a sequence of nodes. The difference between P1' and P2' is only one atomic modification in the flowgraph and that is in the case of the Measure LOC the atomic modification M1. o o

o O PI" P21 Figure 8.12: Two flowgraphs P1' and P2' which are differently in only one atomic modification M1.

8 Characterization of the Properties of Measures

148

Using the defined atomic modifications, the arbitrary flowgraphs P1 and P2 have to be changed to the flowgraphs P1' and P2'. If that is possible for every arbitrary flowgraph then the Measure LOC is completely described by the defined atomic modifications. That is easy because MEDG does not change the complexity. It is possible to delete all single edges without changing the complexity. Ordinal Scale As shown above, the Measure LOC is completely described. That means: P1 *SP2 LOC(P1) > LOC(P2). The user can use the Measure LOC as an ordinal scale if he accepts the partial properties of the Measure LOC. Extensive Structure and Ratio Scale We have to give conditions that the Measure LOC can be used as a ratio scale. We have to show whether the Measure LOC is an Extensive Structure to the binary operations BSEQ and BALT. Binary Operation BSEQ The adding function for the Measure LOC is: LOC (P1 o P2) = LOC(P1) + LOC(P2). Hence, the Measure LOC is an Extensive Structure and can be used as a ratio scale. Binary Operation BALT The adding function of the Measure LOC for the binary operation BALT is: LOC (P1 *P2) = LOC(P1) + LOC(P2) + 2. The Measure LOC is an Extensive Structure but not additive for the binary operation BALT. But the Measure LOC" is additive and defined as: LOC"(G)=LOC+2. We demonstrate that with an example: A: PI N: PI R: Author C: Example SU: S

A: PI N: PI R: Author C: Example SU: S

Is

Is

2

2

...3... PI combined by the binary operation BALT v 5

v 4

...3... v 4

v 5

..>66ioio=< >

Description of the Atomic Modification To add a node and an edge (Statement) at an arbitrary location in the fiowgraph.

M5

=

To transfer an edge from one location in the fiowgraph to another location in the fiowgraph.

MEDG = C

Y

To add an edge at an arbitrary location in the fiowgraph. Remarks: Y: Measure is completely described; N: Measure is not completely described.

Measure: LOC Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y Y Y

Y Y Y Y

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure/Ratio Scale Extensive Structure/ LOC''=LOC+2: Ratio scale

Figure 8.14: The partial properties of the Measure LOC and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. The Measure LOC is widely used, but not widely accepted as a software complexity measure. It is easy to implement and has very simple and clear measurement theoretic properties. Several extensions of the Measure LOC can be found in Li /LI87/, in /ALVE88/ and in Levitin /LEVI86/. The Measure LOC is a good example to demonstrate the difference between a complexity measure and a measure which counts the lines of code in a program. Using this

150

8 Characterization of the Properties of Measures

measure as a counting measure then LOC counts the number of lines of code and it is an absolute scale /FENT90/. However, using the Measure LOC as a complexity measure then we have the empirical relation "equal or more complex". In this case we have to check whether our idea of complexity is identical to the Measure LOC.

8 Measures of McCabe

151

8.4 Measures of McCabe and Modifications Names of the Measures: Measures MCC-V, MCC-V-Q, MCC-V1, MCC-V2, MCC-D, MCC-EV and MCC-EVO of McCabe. Author of the Measures: McCabe, Tom. Published in: /MCCA76/. Definitions of the Measures The Measures of McCabe base on the number of edges, the number of nodes and the number of primes in a flowgraph G (Arbitrary flowgraph). |D| |N| |E| |M|

Number of of decision nodes in G. Number of nodes in G. Number of edges in G. Number of primes in a flowgraph G.

Measure MCC-V Definition 8.10 (Original Definition by McCabefCyclomatic Number)): McCabe used the definition of the cyclomatic number for strongly connected flowgraphs as a software complexity measure. The Measure MCC-V is defined as: For flowgraph: G MCC-V(G) = |E| - |N| + 2p, with p

Number of connected components. For the calculation of the complexity of a module set p=1. Connected components are in the case of software complexity measurement the number of subprograms in a software system.

That means, the complexity (intra-modular complexity) of a single program is: MCC-V1 (G) = |E| - |N| + 2. • In this book the Measure MCC-V is used instead of the Measure MCC-V1, and it is always assumed p=1. Measure MCC-V-Q Definition 8.11 (Modification of the Measure MCC-V): MCC-V-Q(G) = (|E| - |N| + 2)"1.5 • The Measure MCC-V-Q was introduced by the author to demonstrate a strictly monotonic transformation of the Measure MCC-V. Measure MCC-V2 McCabe presented a modified definition of the Measure MCC-V and that is Measure MCC-V2. The Measure MCC-V2 of McCabe is a strictly monotonic transformation of the Measure MCC-V and it is additive to the binary operation BSEQ. Definition 8.12 (Measure MCC-V2 of McCabe): For flowgraph: G MCC-V2(G) = |E| - |N| + 1

152

8 Characterization of the Properties of Measures

MCC-V2(G)=MCC-V(G) - 1 • McCabe points out, that this measure is additive to the concatenation of two programs. Measure MCC-D Definition 8.13 (Measure MCC-D of McCabe): For flowgraph: G MCC-D(G) = |D| + 1 • For structured programs (For flowgraph: Gd) the result of the Measures MCC-D is equal to MCC-V. Measures "Essential Complexity" MCC-EV and MCC-EVO To capture the unstructured components of a flowgraph, McCabe defined the Measure "Essential Complexity" MCC-EV, which is sensitive against the unstructuredness of flowgraphs. Definition 8.14 (Measure Essential Complexity: MCC-EV): In order to measure the structuredness of programs by the reducibility in 1-entry and 1 -exit subflowgraphs (Primes), McCabe proposed the Measure Essential Complexity (MCC-EV). MCC-EV(G) = |D| - |M| + 1, with |M|

Number of 1-entry and 1 -exit subflowgraphs (Primes) in G (Excluded the trivial primes; see Sections 5 and 8.15).

The Measure MCC-EVO is introduced by the author and is defined as: MCC-EV0(G)= |D| - |M| The reason for the modified Measure MCC-EVO is the additive property to the binary operations BSEQ and BALT. • For a structured program the "Essential Complexity" is: MCC-EV(G)=1 and MCC-EV0(G)=0. McCabe uses for measuring of unstructuredness the decomposition into primes. However, mcCabe did not give a definition of a prime. For the decomposition into primes exists several algorithm (See Sections 5.2 and 7.2). Our definition of primes base on the Fenton-Whitty scheme (See Section 8.15). 8.4.1 Explanations by McCabe McCabe /MCCA76/ describes the properties of the Measure MCC-V in the following way. Let G be an arbitrary flowgraph. 1. 2. 3. 4. 5. 6.

MCC-V(G)>1. MCC-V(G) is the maximum number of linearly independent paths in G; it is the size of a basis set. Inserting or deleting functional statements to G does not affect MCC-V(G). G has only one path if and only if MCC-V(G)=1. Inserting a new edge in G increases MCC-V(G) by unity. MCC-V(G) depends only on the decision structure of G.

8 Measures of McCabe

153

The overall strategy will be to measure the complexity of a program by computing the number of linearly independent path MCC-V(G), control the "size" of programs by setting an upper limit to MCC-V(G) (instead of using just physical size), and use the cyclomatic complexity as the basis for a testing methodology". 8.4.2 Examples of the Measures In order to explain the Measures of McCabe we present some examples. Firstly, we present the list of measures which are used for our examples. MEASURE

AUTHOR

NODES EDGES DEC PRIMES MCC-V MCC-V2 MCC-D

Zuse, H. Zuse, H. Zuse, H. Zuse, H. McCabe, McCabe, McCabe, McCabe,

9 MCC-EVO McCabe, T. 10 N-MCCABE Szentes

OVERVIEW ABOUT MEASURES: T S REF SECTION Author Author Author Author MCCA76 MCCA76 MCCA76 MCCA76

COMMENT TO THE MEASURE

8 8 8 7,8.15.3 8.4 8.4 8.4 8.4

U MCCA76 8.4 BE SZEN82 8.6

Number of Nodes N Number of edges |E| in G. Number of decision nodes Number of primes in F MCC-V= | E I-IN | + 2p, p=l MCC—V2=IEI — |N| + 1 MCC-D»ID 1+1 Essential Compl.: MCC-EV=MCC-D - IM Essential Compl.: MCC-EV0=IDI -|MI Normalized Measure MCC-V of McCabe

Figure 8.15: The list of measures which are used for the examples. The complexity of four flowgraphs PWS, PWN, PWU and PWU10 calculated by the Measures of McCabe. A: PWS N: PWS R: Author C: Example SU:

A: PWN N: PWN R: Author C: Example SU:

A: PWU N: PWU R: Author C: Example SU:

A: PWU10 N: PWU10 R: Author C: Example SU:

2

!->4888o s

V

.

. .0

V

.

. . .o

.

.

,>o

.

..>o

V

.

V

o

>

V

o t G1 Weakly connected flowgraph G1 CYC(Gl)-5-5+1-1

V

o V

V

o t G2 S t r o n g l y connected flowgraph G2 CYC(G2)=6-5+1=2

Figure 8.17: Flowgraph G1 is a weakly connected flowgraph and G2 is a strongly connected flowgraph. The cyclomatic number CYC /BERG73/ for a strongly connected graph G is: CYC(G)=|E|-|N|+1. But, flowgraphs of programs are not strongly connected graphs, as flowgraph G1 shows. For flowgraph G1 the cyclomatic number has to be 2, but using the definition by Berge the cyclomatic complexity is 1. The correct and strongly connected flowgraph would be G2. For this reason McCabe defined the Measure MCC-V as: MCC-V(G) = |E| - |N| + 2. McCabe adds always 1 to CYC because there has to be always an edge from the node t to node s. Applied to the flowgraph G1, the cyclomatic complexity is:

8 Measures of McCabe

155 MCC-V(G1 )=|E|-|N| + 2 = 5 - 5 + 2 = 2.

We now give some examples to explain the independent path in a flowgraph. Firstly, we show how to calculate the possible path in a simple flowgraph P1. A: PI N: PI R: Author C: Example structured P SU: S 1 s 2 ...3.. V 4

EDGE

N1

N2

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 3 4 5 6 7 7 8 9 10 11

2 3 4 5 6 6 7 8 9 10 10 11 12

V 5

;.>6io7948

To add an edge at an arbitrary location in the flowgraph.

In Section 4 (Definition 4.14) the atomic modifications for directed flowgraphs are defined. Because of the following implications we see, that the partial properties to the atomic modifications M1, M5 and MEDG describe the property s of the Measures MCC-V and MCC-V2 (it represents here the Measures MCC-V and MCC-V2). P1 P1

.= M1

P2 => n(P1) = n(P2) P2 => n(P1) = n(P2) P1 ^medg p 2 => H(P1) > H(P2) Explanation of the Atomic Modifications: The Measures MCC-V and MCC-V2 are completely described by the defined atomic modifications. It is easy to see that M1, M5 and MEDG describe the partial properties of the Measures MCC-V and MCC-V2 of McCabe. The atomic modifications M1 and MEDG were already given by McCabe, but not the atomic modification M5. The following theorem can be proved. Theorem 8.3 The Measures MCC-V and MCC-V2 of McCabe are completely described by the partial properties to the atomic modifications M1, M5 and MEDG. • Idea of the Proof of the Theorem 8.3: We show two flowgraphs P1* and P2' with the same complexity of the arbitrary flowgraphs P1 and P2 but consisting of a sequence of nodes and if-then-structures. The difference between P1 ' and P2' is only one atomic modification in the flowgraph and that is in the case of the Measures MCC-V and MCC-V2 the atomic modification MEDG.

162

8 Characterization of the Properties of Measures

Figure 8.26: The two flowgraphs P1' and P2' differ in only one atomic modification MEDG. P1' is more complex than P2' because P1' has one more edge than P2\ It holds MCC-V(P1)= MCC-V(PV) and MCC-V(P2)= MCC-V(P2,)1 where MCC-V is the Measure of McCabe. Using the defined atomic modifications the arbitrary flowgraphs P1 and P2 have to be changed to the flowgraphs P1' and P2'. Is that possible for every arbitrary flowgraph, then the Measures MCC-V and MCC-V2 are completely described by the partial properties to the atomic modifications. The change from flowgraph P1 to P1' and P2 to P2' is not very complicated because the atomic modification M5 does not change the complexity. The atomic modification M1 does not change the complexity, too. We give an example of the transformation of the flowgraph PWN into the equivalent flowgraph PWN' (It holds: MCC-V(PWN)=MCC-V(PWN'), but PWN' is consists of a sequence of if-then-structures. Another example is given in Figure 7.23. A: P W N N: P W N R: A u t h o r C: Example SU:

A: P X X 1 N : PXX1 R: Author C: E x a m p l e SU:

A: PXX2 N: PXX2 R: Author C : Example SU:

A: N: R: C: SU

s

PWN* PWN' Author Example

o V

o.

V

0 ...o....

V

o

V

..o....

o..

V

o.

V

o

V 0 .

o
ooo


M5

Figure 8.27: An example for the proof of the complete description of the Measure MCC-V.

163

8 Measures of McCabe

The idea of the proof is to transform the flowgraph PWN to the standardized flowgraph PWN' via the flowgraphs PXX1 and PXX2 by applying the defined atomic modifications for the Measures MCC-V and MCC-V2. It holds always MCC-V(PWN)=MCC-V(PXX1)=MCC-V(PXX2)=MCC-V(PWN'). The "goal" flowgraph PWN' consists of a sequence of if-then-structures. If the modification is possible for each arbitrary flowgraph, then the measure is described completely by the partial properties to the atomic modifications. The proof for a complete description of the Measure MCC-V can be done by the following steps. 1.

The first step in the case of the Measure MCC-V is to delete edges and nodes (Atomic modification M1) That is always possible because the complexity of MCC-V does not change by the atomic modification M1. The result is the flowgraph PXX1.

2.

The second step is to transfer edges by the atomic modification M5 to get a sequence of if-then-structures. If there are not enough statements in the flowgraph, more statements (edges and nodes) can be added by the atomic modification M1. The complexity does not change by applying the atomic modification M1.

Doing this transformation with the two arbitrary flowgraphs P1 and P2 to the flowgraphs P1' and P2', the flowgraphs P1' and P2' should consist of the same number of nodes. Then, there is only a difference of the both flowgraphs P1' and P2' by the atomic modification MEDG. The complexity of the flowgraphs P1' and P2' related to the Measure MCC-V can be compared very easily. Ordinal Scale As shown above, the Measures MCC-V and MCC-V2 of McCabe are completely described by the three partial properties to the atomic operations M1, M5 and MEDG. That means it holds: P1 •> P2 MCC-V(P1) > MCC-V(P2). The user can use the Measures MCC-V and MCC-V2 of McCabe as an ordinal scale if she/he accepts the partial properties of the Measure of McCabe to the atomic operations M1, M5 and MEDG. Measure MCC-D The Measure MCC-D is a strictly monotonie transformation of the Measure ALC of Gilb: MCC-D = ALC + 1. Measure MCC-EV In order to give necessary and sufficient criteria for the use of the Measure MCC-EV of McCabe we describe the partial properties of the Measure MCC-EV by atomic modifications in the flowgraph. Definition 8.17 (Measures MCC-EV and MCC-EVO: Partial Properties to the Atomic Modifications): For the Measure MCC-EV of McCabe the four atomic modifications is defined: M1

^

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

DP

>

Measures MCC-EV, MCC-EVO: To decrease the number of 1-entry/1-exit primes (Consisting of one selection node) in a prime decomposistion tree T.

164

8 Characterization of the Properties of Measures

MEDG

£

To add an edge at an arbitrary location in the flowgraph.

M5P

=

Measure MCC-EV, MCC-EVO: To transfer an edge from one arbitrary location to another location in the flowgraph without changing the number of 1-entry and 1 -exit subflowgraphs (Primes as defined by the Fenton-Whitty scheme).

Explanation of the Atomic Modifications: The property of the Measure MCC-EV is only partially described by the atomic modifications M1, DP, M E D G and M5P. The atomic modification M1 decreases the complexity or remains the complexity unchanged. (See the example below). The atomic modification DP increases the complexity because the number of primes (Consisting of one selection node) decreases. The atomic modification MEDG increases not always the complexity. To add an edge creating a new prime remains the complexity unchanged. Adding an edge in a prime, which does not create a new prime, increases the complexity. The atomic modification M5P does not change the complexity. Important is, that the atomic modification M5P does not change the number of primes. Example for the Atomic Modification M1 : A: N: R: C: SU

SE 5 SE5 Author Exmp. 1

A: N: R: C: SU s

SE 4 SE 4 Author Exmp. 1

V

s

V

>2

>2

V

V

4

V

3

3 4

V

V

5

>5

V 6

V 6

V

V

7 t

7

V

8 t

MEASURES OF MCCABE

RESULTS OF THE MEASURE(S) NODES EDGES DEC PRIMES MCC-V MCC-V2 MCC-D MCC-EV MCC-EVO N-MCCABE

NODES EDGES DEC PRIMES MCC-V MCC-V2 MCC-D MCC-EV MCC-EVO N-MCCABE

SE5

SE 4

7.000 8.000

8.000 9.000 2.000 2.000 3.000 2.000 3.000

2.000

1.000

3.000 2.000 3.000 2.000

1.000 0.286

1.000 0.000 0.250

Figure 8.28: Flowgraph SE4 results from flowgraph SE5 by the atomic modification M1. The complexity decreases for the Measures MCC-EV and MCC-EVO. The reason for that is the definition of primes by the Fenton-Whitty scheme.

165

8 Measures of McCabe

8.4.6 Extensive Structure and Ratio Scale We have to give conditions that the Measures of McCabe can be used as a ratio scale, and we have to show whether the Measures of McCabe are Extensive Structures for the binary operations BSEQ and BALT. Measures MCC-V and MCC-V2 We consider the adding function for the binary operations BSEQ and BALT. Binary Operation BSEQ: The adding function for the Measure MCC-V is: MCC-V (P1 o P2) = MCC-V(P1) + MCC-V(P2) -1. But, for the Measure MCC-V2 the adding function is: MCC-V2 (P1 o P2) = MCC-V2(P1) + MCC-V2(P2). That means, that the Measure MCC-V is an Extensive Structure, but not additive. From the Theorem of Luce (Section 4) we know that there exists a function which is additive. Additive is the Measure MCC-V'=MCC-V -1. That is exactly the Measure MCC-V2. Hence, the Measure MCC-V2 is an Extensive Structure and can be used as a ratio scale for the binary operation BSEQ. Binary Operation BALT: We show an example for the binary operation BALT. A: PI N: PI R: Author C: Example SU: S

A: PI N: PI R: Author C: Example SU: S

1 s

1 s

2

2

...3... PI combined by the binary operation BALT 4

5

4

! .>6666-
C

Y

Description of the Atomic Modification

To add an edge at an arbitrary location in the flowgraph. Remarks: Y: Measure is completely described; N: Measure is not completely described.

Measure: MCC-V Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y Y Y

Y Y Y Y

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure Extensive Structure/Ratio Scale

Figure 8.31: The partial properties of the Measures MCC-V and MCC-V1 of McCabe and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. Measure MCC-V2: Measure: MCC-V2 Partial Properties of the Measure to Atomic Modifications (AM) AM Ml M5

>-< » =

Description of the Atomic Modification To add a node and an edge (Statement) at an arbitrary location in the flowgraph. To transfer an edge from one location in the flowgraph to another location in the flowgraph.

MEDG >

To add an edge at an arbitrary location in the flowgraph.

C

Remarks: Y: Measure is completely described; N: Measure is not completely described.

Y

Measure: MCC-V2 Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y Y Y

Y Y Y Y

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure/Ratio Scale Extensive Structure

Figure 8.32: The partial properties of the Measure MCC-V2 of McCabe and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT.

168

8 Characterization of the Properties of Measures

Measure MCC-EV: Measure: MCC-EV P a r t i a l P r o p e r t i e s of the M e a s u r e to A t o m i c M o d i f i c a t i o n s AM

>~
=

To a d d an edge at an a r b i t r a r y location in the

M5P

=

DP

>

C

N

M e a s u r e MCC-EV, M C C - E V O : To transfer an edge from one a r b i t r a r y l o c a t i o n to another location in the flowgraph without c h a n g i n g the n u m b e r o f 1 - e n t r y a n d 1-exit subflowgraphs (Primes as d e f i n e d b y the F e n t o n - W h i t t y s c h e m e ) . M e a s u r e s MCC-EV, M C C - E V O : To decrease the number of 1 - e n t r y / 1 - e x i t p r i m e s (Consisting of one selection node) in a prime d e c o m p o s i s t i o n tree T. R e m a r k s : Y: M e a s u r e is completely d e s c r i b e d ; N: M e a s u r e is not c o m p l e t e l y d e s c r i b e d .

Measure: MCC-EV A x i o m s of E x t e n s i v e

flowgraph.

Structure Binary Operations

Axiom

BSEQ

BALT

A x i o m of a s s o c i a t i v i t y A x i o m of c o m m u t â t i v i t y A x i o m of m o n o t o n i c i t y Archimedian Axiom

Y Y Y Y

Y Y Y Y

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure Extensive Structure/Ratio

Scale

Figure 8.33: The partial properties of the Measure MCC-EV of McCabe and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. Measure MCC-EVO: M e a s u r e : MCC-EVO P a r t i a l P r o p e r t i e s of the M e a s u r e to A t o m i c M o d i f i c a t i o n s AM

>=
=

To a d d an edge at an arbitrary location in the

M5P

«

M e a s u r e M C C - E V , M C C - E V O : To transfer an edge from one a r b i t r a r y l o c a t i o n to another location in the flowgraph without c h a n g i n g the number o f 1 - e n t r y a n d 1-exit subflowgraphs (Primes as d e f i n e d by the F e n t o n - W h i t t y s c h e m e ) .

DP

>

M e a s u r e s M C C - E V , M C C - E V O : To decrease the number of 1 - e n t r y / l - e x i t p r i m e s (Consisting of one selection node) in a prime d e c o m p o s i s t i o n tree T.

C

N

R e m a r k s : Y: M e a s u r e is completely d e s c r i b e d ; N: M e a s u r e is not c o m p l e t e l y

M e a s u r e : MCC-EVO A x i o m s of E x t e n s i v e

flowgraph.

described.

Structure Binary Operations

Axiom

BSEQ

BALT

A x i o m of a s s o c i a t i v i t y A x i o m of c o m m u t a t i v i t y A x i o m of m o n o t o n i c i t y Archimedian Axiom

Y Y Y Y

Y Y Y Y

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure/Ratio Extensive Structure

Scale

Figure 8.34: The partial properties of the Measure MCC-EVO and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. The Measures of McCabe are well known and accepted software complexity measures. Very often they are interpreted as a "testing measures" for testing of programs by the independent paths. Many authors remark, that the Measure of McCabe does not measure any kind of nesting. This behaviour reflects the partial property to the atomic modification M5. The partial property to the atomic modification M1 reflects that the addition of a statement does not change the complexity.

169

8 Measures of McCabe

If one wants to use the Measures MCC-V, MCC-V2, MCC-EV and MCC-EVO of McCabe as a ratio scale, he has to accept the following: 1.

The weak order, that means the partial properties of the Measures MCC-V, MCC-V2, MCC-EV and MCC-EVO of McCabe to the atomic modifications.

2.

For For For For

the the the the

Measure Measure Measure Measure

MCC-V2 the binary operation BSEQ. MCC-V the binary operation BALT. MCC-EV the binary operation BALT. MCC-EVO the binary operation BSEQ.

That means, for example, that the Measure MCC-V2 has the property of the axioms of the Extensive Measurement for the binary operation BSEQ, and the Measure MCC-V2 is additive to the binary operation BSEQ. So, using the Measure MCC-V2 as a ratio scale, the user has to think about whether the binary operation BSEQ is an appropriate concatenation of programs. The Measures of McCabe are beside the Measures of Halstead the mostly discussed and a widely accepted software complexity measures. (The Measures of Halstead are based on the source code of programs). The measures are based on a solid mathematical foundation and that is the cyclomatic number of a strongly connected control flowgraph. It is not well known, that McCabe required to use the Measures MCC-V2 and MCC-EV or MCC-EVO together. Mostly, only the Measures MCC-V and MCC-V2 are investigated and criticized by researchers. One example for that is the investigation of Lewis and Henry /LEWI89/, where the correlation between the Measures LOC, EFFORT of Halstead and MCC-V with a collection of some hundred programs was calculated. However, no measure was used, which is sensitive against unstructured programs. A new application of the Measures of McCabe by McCabe is the "Computer-Aided Software Engineering" (CASE) /CHIF89/, /MCCA89/ where the Measures MCC-V and MCC-EV of McCabe are used to describe the complexity of single modules, software design measures, and the complete software systems. An interesting extension of the Measure MCC-V of McCabe to network complexity is the work of Hall /HALL83/.

170

8 Characterization of the Properties of Measures

8.5 Measures "Relative and Absolute Logical Complexity" of Gilb Names of the Measures: The Measures Absolute (ALC) arid Relative Logical Complexity (RLC) of Gilb. Author of the Measure: Gilb, Tom. Published in: /GILB77/. Definitions of the Measures The Measures of Gilb are very simple measures. The Measure ALC (Absolute Logical Complexity) is similar to the Measure MCC-D of McCabe which were published in 1976. Gilb argues, that the complexity (Absolute logical complexity (Measure ALC)) of a program increases by the number of predicates. The relative logical complexity depends additionally by the number of nodes in the flowgraph. Measure ALC Definition 8.18 (Measure Absolute Logical Complexity ALC): For flowgraph: G ALC(G) = |D|, with |D| •

Number of decision nodes (predicates) in flowgraph G.

The Measure ALC of Gilb is a strictly monotonic transformation of the Measure MCC-D of McCabe (See Section 8.4). Measure RLC Definition 8.19 (Measure Relative Logical Complexity RLC): For flowgraph: G RLC(G) = |D| / |N|, with |D|

Number of decision nodes (predicates) in G

|N| •

Number of nodes in G

The Measure RLC is similar to the Measure N-MCCABE of Szentes and Potier (See Section 8.6). The Measure N-MCCABE is defined: N-MCCABE(G)=MCC-V2 / |N|= (|E| - |N| + 1)/|N|. Examples Figure 8.35 shows the list of measures for the examples. »

OVERVIEW ABOUT MEASURES: T S REF SECTION

MEASURE

AUTHOR

1 2 3 4 5 6 7

UNSTRUCT LOC DEC PRIMES MCC-V MCC-V2 MCC-EV

Zuse, H. Several authors Zuse, H. Zuse, H. McCabe, T. McCabe, T. McCabe, T.

B B B P B B U

Author CONT86 Author Author MCCA76 MCCA76 MCCA76

8 8.3 8 7,8.15.3 8.4 8.4 8.4

COMMENT TO THE MEASURE UNSTRUCT-1 then unstructured else 0 Lines of Code Number of decision nodes Number of primes in F MCC-V-1EI-IN I + 2p, MCC-V2-|EI-|NI + 1 Essential Compl.: MCC-EV-MCC-D - IMI +

8 9 10 11

MCC-D N-MCCABE ALC RLC

McCabe, T. Szentes Gilb, T. Gilb, T.

B BE P P

MCCA76 SZEN82 GILB77 GILB77

8.4 8.6 8.5 8.5

MCC-D=IDI+1 Normalized Measure MCC-V of McCabe Number of decision nodes Measure ALC of Gilb divided by N

Figure 8.35: The list of measures used for the examples.

171

8 Measures of Gilb

We demonstrate the calculation of the Measures ALC and RLC of Gilb by some flowgraphs. A: Pll N: Pll R: Author C: Example SU:

A: P10 N: P10 R: Author C: Example SU:

A: P U B N: P U B R: Author C: Example SU:

A: P11A N: P11A R: Author C: Example SU:

• >v . ,5v ..5.

MEASURE OF GILB AND OTHERS: RESULTS OF THE MEASURE(S) P10

1.00 11.00 3.00 1.00

UNSTRUCT LOC DEC PRIMES MCC-V MCC-V2 MCC-EV MCC-D N-MCCABE ALC RLC

4.00 3.00 3.00 4.00 0.27 3.00 0.27

Pll

P11A

4.00 2.00 5.00 4.00 3.00 5.00 0.36 4.00 0.36

11,.00 4..00 .00 1. 6..00 5,.00 4..00 5..00 0,.45 4 .00 0..36

1.00 11.00

1,.00

P11B

1.00 11.00 5.00 3.00 6.00 5.00 3.00 6.00 0.45 5.00 0.45

Figure 8.36: The complexity of flowgraphs P10, P11, P11A and P11B calculated with the Measures ALC and RLC of Gilb and some other measures. The reason of the difference between the Measures N-MCCABE and RLC is the definition of the Measure N-MCCABE(G)=(|E| - |N| + 1)/|N|. Discussion of the Measures In order to give necessary and sufficient criteria for the use of the Measures of Gilb, the partial properties of the Measures ALC and RLC are described by atomic modifications in the flowgraph. Measure ALC Definition 8.20 (Measure ALC: Partial Properties to the Atomic Modifications):

For the Measure ALC (Absolute Logical Complexity) of Gilb the four atomic modifications are defined: M1

=

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

ADN

>

To create a decision node with 0(d)>=2 at an arbitrary location in the flowgraph.

TDN

=

To transfer a decision node d from one arbitrary location to another arbitrary location in the flowgraph without changing the outdegree of the decision node d.

172

8 Characterization of the Properties of Measures

CODN •

=

To change the outdegree of a decision node from 0(d)>2 to 0(d)=2.

Explanation of the Atomic Modifications: The Measure ALC is only partially described by the defined atomic modifications. The atomic modification M1 does not increase the complexity of a flowgraph per definition. The atomic modification ADN (adding a decision node) increases always the complexity. The atomic modification TDN, (transfering decision nodes) does not change the complexity. The atomic modification CODN does not change the complexity because a change of the outdegree of a decision node from 0(d)>2 to 0(d)=2 has no influence to the complexity per definition. It is easy to see, that the Measure ALC is a strictly monotonie transformation of the Measures MCC-D of McCabe: ALC=MCC-D - 1 . Measure RLC Definition 8.21 (Measure RLC: Partial Properties to the Atomic Modifications): For the Measure RLC (Relative Logical Complexity) of Giib the four atomic modifications are defined. To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

M1 ADN

>

To create a decision node with 0(d)>=2 at an arbitrary location in the flowgraph. To transfer a decision node d from one arbitrary location to another arbitrary location in the flowgraph without changing the outdegree of the decision node d.

TDN CODN •

=

To change the outdegree of a decision node from 0(d)>2 to 0(d)=2.

Explanation of the Atomic Modifications: The Measure RLC of GILB is only partially described by the defined atomic modifications. The atomic modification M1 increases, decreases or does not change the complexity of a flowgraph. That is the difference to the Measure ALC. The atomic modification ADN, that means adding a decision node, increases always the complexity. The atomic modification TDN, that means transfering a decision node, does not change the complexity. The atomic modification CODN does not change the complexity, because a change of the outdegree of a decision node from 0(d)>2 to 0(d)=2 has no influence per definition. The Measure RLC of Gilb is similar to the Measure N-MCCABE of Szentes and Potier.

8 Measures of Gilb

173

Extensive Structure and Ratio Scale We have to give conditions whether the Measures of Gilb are Extensive Structures to the binary operations B S E Q and BALT. Measure ALC We consider the binary operation B S E Q and BALT. Binary Operation BSEQ: The adding function of Measure A L C is: A L C (P1 0 P2) = ALC(P1) + ALC(P2). The Measure A L C is an Extensive Structure and can be used as a ratio scale. Binary Operation BALT The adding function of Measure A L C is: A L C (P1 *P2) = ALC(P1) + ALC(P2) + 1. The Measure A L C is an Extensive Structure and the Measure ALC"(G) = A L C + 1 is additive and can be used as a ratio scale. Measure RLC We consider the binary operations B S E Q and BALT. Binary Operation BSEQ: We show, that the Measure RLC does not have the property of the axiom of monotonicity. A: P1X N: P1X R: Author C: Example 1 s SU: S V 2

A: PI N: PI R: Author C: Example SU: S 1 s

V

V

4

5

; .>6< V . . .7. V

V

9

8

!>io< V

V

V

4

12 V

V

V e V 7 V

V ...7... V

8

V

12 t

V

. .15. 17

I>182261066 > >

•= = =

= « =

N N N

1 ALC 2 MCC-D 3 RLC

AUTHOR G i l b , T. McCabe, T . G i l b , T.

at

an a r b i t r a r y

location

an a r b i t r a r y

node from 0 ( d ) > 2

completely described;

NUMBER OF MEASURES:

NAME

at

node w i t h 0 ( d ) > = 2

in

location

to

N: M e a s u r e

is

the

in

flowgraph.

the

flowgraph.

another a r b i t r a r y node d .

location

in

0(d)=2. not

completely

described.

3

OVERVIEW ABOUT MEASURES: BSEQ REF O A C M A R E S C GILB77 MCCA7 6 GILB77

Y Y Y

Y Y Y Y Y Y Y N

E E

R R

BALT A C M A R E S C

Y

Y Y

Y

Y Y

N

Y Y

Y Y

E E

Figure 8.39: The partial properties and the axioms of the Extensive Structure for the Measures of Gilb and MCC-D of McCabe. The Measures of Gilb are very simple measures. They are easy to implement. The Measure ALC of Gilb is a strictly monotonic transformation of the Measure MCC-D of McCabe. The Measure ALC is an Extensive Structure to the binary operations BSEQ and BALT. The Measure RLC is not an Extensive Structure to the binary operations BSEQ and BALT. The Measure RLC can be considered as a kind of a "density measure", like the Measure "Specific Gravity".

176

8 Characterization of the Properties of Measures

8.6 Measure "Control Flow Density" of Szentes and Potier Name of the Measure: Measure N - M C C A B E (Control Flow Density) of Szentes and Potier. Author of the Measure: Szentes; Potier; and others. Published in: /SZEN82/, /POTI82/. Definition of the Measure: The Measure N - M C C A B E is an extension of the Measure MCC-V2 of McCabe. Forflowgraph: G N-MCCABE(G) = (|E| - |N| + 1 ) / |N| N-MCCABE(G) = MCC-V2 / |N|, with |N| |E|

Number of nodes in G, and Number of edges in G.

For a sequence of nodes the value of the Measure MCC-V2 is always 0. Examples In order to explain the Measure N-MCCABE we present some examples. Firstly the list of the measures which is used for the examples, is presented. OVERVIEW ABOUT MEASURES: t MEASURE AUTHOR 1 2 3 4 5 6 7 8 9

NODES EDGES DEC PRIMES MCC-V MCC-V2 MCC-D MCC-EV N-MCCABE

T REF

Zuse, H. Zuse, H. Zuse, H. Zuse, H. McCabe, McCabe, McCabe, McCabe, Szentes

Author Author Author Author MCCA76 MCCA76 MCCA7 6 MCCA76 SZEN82

COMMENT TO THE MEASURE Number of Nodes INI Number of edges IE I in G. Number of decision nodes PD: Number of primes in F V-|E|-|N| + 2p, p«l V2=|E|—|N| + 1 V2=|D|+1 Essential Complexity Normalized Measure V of Mc

Figure 8.40: The list of the measures used for the examples. Five n-case-structures demonstrate the Measure N-MCCABE. A: IFTH N: If-Then R: LEDG75 C: D*-Structure SU: D'

A: CASE-3 N: CASE-3 R: Author C: Example SU: S

A: CASE-2 N: CASE-2 R: Author C: Example SU: S

A: CASE-3A N: CASE-3A R: Author C: Example SU: S

1 s

MEASURES OF MCCABE

NODES EDGES DEC PRIMES MCC-V MCC-V2 MCC-D MCC-EV MCC-EVO N-MCCABE

A: CASE-4 N: CASE-4 R: Author C: Example SU: S

1 s

A: CASEN: CASER: Autho C: Examp SU: S

1 s

RESULTS OF THE MEASURE(S) IFTH

CASE-2

5.,00 5..00 1..00 1,.00 2..00 1..00 2..00 1..00 0..00 0..20

6..00 E..00 1..00 1..00 2 .00 1..00 2..00 1 .00 0 .00 0 .17

CASE-3 CASE-3A 7,.00 8..00 1..00 1..00 3..00 2..00 2,.00 1..00 0 .00 0 .29

6..00 6.,00 1..00

1,.00 2..00 1..00 2..00 1..00 0..00 0..17

CASE-4

CASE-5

8..00 10,.00 1..00 1,.00 4,.00 3..00 2,.00 1,.00 0 .00 0 .38

9..00 12,.00 1,.00 1,.00 5,.00 4..00 2,.00 1,.00 0,.00 0,.44

Figure 8.41: The complexities of some different N-Case-structures.

8 Measure of Szentes and Potier

177

Discussion of the Measure N-MCCABE In order to give necessary and sufficient criteria for the use of the Measure N-MCCABE the partial properties of the Measure N-MCCABE are described by atomic modifications in the flowgraph. Measure N-MCCABE Definition 8.22 (Measure N-MCCABE: Partial Properties to the Atomic Modifications): For the Measure N-MCCABE the three atomic modifications are defined: M1

*

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

M5

=

To transfer an edge from one location in the flowgraph to another location in the flowgraph.

MEDG •

>

To add an edge at an arbitrary location in the flowgraph.

Explanation of the Atomic Modifications: The Measure N-MCCABE is only partially described by the atomic modifications M1, M5 and MEDG. The difference between the Measures MCC-V2 of McCabe and N-MCCABE is the atomic modification M1. The complexity of N-MCCABE increases, decreases or remains unchanged dependent on the quotient of (|E| - |N| +1) /|N|. Extensive Structure and Ratio Scale We have to give conditions that the Measure N-MCCABE can be used as a ratio scale and we have to show whether the Measure N-MCCABE is an Extensive Structure to the binary operations BSEQ and BALT. We consider the two binary operations BSEQ and BALT. Binary Operations BSEQ and BALT The Measure N-MCCABE is not additive for the binary operations BSEQ and BALT. The examples of the Measure RLC of Gilb (See Section 8.5) show that very clearly. The Measure N-MCCABE has interactions between the both flowgraphs P1 and P2 when they are concatenated to P1 o P2 or P1 • P2. Hence, the Measure N-MCCABE does not have the property of the axiom of monotonicity for the binary operations BSEQ and BALT. The Measure N-MCCABE is not an Extensive Structure. Final Remarks We presented the definition of the Measure N-MCCABE and defined the atomic modifications to describe the partial properties of the Measure N-MCCABE. In addition we investigated whether the measure is an Extensive Structure to the binary operations BSEQ and BALT. We present the summary of the results of this investigation: Measure N-MCCABE: Measure: N-MCCABE Partial Properties of the Measure to Atomic Modifications (AM) AM

>=
C

N

To add an edge at an arbitrary location in the flowgraph. Remarks: Y: Measure is completely described; N: Measure is not completely described.

Measure: N-MCCABE Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y N

Y Y N

Binary Operation BSEQ: Binary Operation BALT:

Figure 8.42: The partial properties of the Measure N-MCCABE and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. The Measure N-MCCABE has completely different properties than the Measure MCC-V2 of McCabe. The atomic modification M1 is differing and the Measure N-MCCABE cannot be used as a ratio scale. We mean, that we should consider the Measure N-MCCABE as a kind of density measure, like the Measure "specific gravity". For structured flowgraphs Gd the Measure N-MCCABE is identical to the Measure RLC of Gilb.

8 Measures of Szentes and Gras

179

8.7 Measures of Szentes and Gras Name of the Measure: Measures STABLE and ALPHA of Szentes and Gras. Author of the Measure: Szentes J.; Gras J. Published in: /SZEN86/. Definitions of the Measures Szentes and Gras proposed the Measure ALPHA which is based on the definition of a "stable set of nodes" in a flowgraph as defined by Berge (page 9) /BERG73/. Additionally the Measure STABLE is presented by the author. Definition 8.23 (Stable Set of Nodes): A set S c N of nodes is called a stable set if no edges join two distinct nodes in S /BERG73/. Let f(A) denote the set of all images of nodes belonging to A (That is the set of all endpoints of edges starting from nodes in A). A set ScN is called a stable set when f(S)nS=0 and STABLE(G)=|S| if S is the maximal stable set in G. • The stable set is illustrated with the flowgraph LC1. A: LCI N: LCI R: Author C: Example SU: U

1 3 2

v

v >3... v 4< v 53.. . 58697
10468io7
9

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

M5

=

To transfer an edge from one location in the flowgraph to another location in the flowgraph.

MEDG

>

To add an edge at an arbitrary location in the flowgraph.

CFF

=

Measure Oviedo: To delete an edge at an arbitrary location in the flowgraph and to add an edge and a node at an arbitrary location in the flowgraph.

Because of the following implications we see, that M1, M5, MEDG and CFF describe the property of the Measure CF (Abbreviated with p.): P1 P1

«>M1 .=„5

P2 P2

=> =>

n(P1) n(P1)

> =

|i(P2) n(P2)

P1

^medg .= CFF

P2

=> =>

n(P1)

> =

M-(P2) n(P2)

P1

P2

Explanation of the Atomic Modifications: The Measure CF of Oviedo is completely described by the partial properties to the defined atomic modifications. It is easy to see that the partial properties to the atomic modifications M1, M5, MEDG and CFF describe the property of the Measure CF. The atomic modifications M1 and MEDG increase the complexity of the Measure CF. The atomic modification CFF changes an edge against an edge and a node. The following theorem can be proved. Theorem 8.4 The Measure CF is completely described by the partial properties to the atomic modifications M1, M5, MEDG and CFF. • idea of a Proof of Theorem 8.4.: We show two flowgraphs P1' and P2' with the same complexity as the arbitrary flowgraphs P1 and P2 but consisting of a sequence of nodes. The difference between the flowgraphs P1' and P2' is only one atomic modification in the flowgraph and that is in the case of the Measure CF the atomic modification M1.

8 Characterization of the Properties of Measures

198

o PI'

P21

Figure 8.65: Two flowgraphs P1' and P2' which are differently in only one atomic modification M1. It holds CF(P1 ')=CF(P1) and CF(P2')=CF(P2). Using the defined atomic modifications the flowgraphs P1 and P2 have to be changed to the flowgraphs P1" and P2\ The atomic modification C F F is necessary to delete edges in the flowgraph in order to get the sequence of nodes. Ordinal Scale: As shown above, the Measure CF is completely described by the partial properties to the four atomic operations M1, M5, MEDG and CFF, that means: P1

P2 CF(P1) s CF(P2).

The user can use the Measure CF as an ordinal scale if he accepts the partial properties of the Measure CF. Extensive Structure and Ratio Scale In order to give necessary and sufficient conditions for the use of the Measures C F of Oviedo as a ratio scale, we consider the binary operations BSEQ and BALT. Binary Operation BSEQ The adding function for the Measure CF is: CF (P1 o P2) = CF(P1) + CF(P2) + 1. The Measure C F is an Extensive Structure but not additive. The Measure CF' is: CF'=CF+1, and is also an Extensive Structure, is additive, and can be used as a ratio scale. Binary Operation BALT The adding function for the Measure CF is: CF (P1 • P2) = CF(P1) + CF(P2) + 4. The Measure C F is an Extensive Structure and the Measure CF"=CF+4 can be used as a ratio scale. Final Remarks We presented the definition of the Measure CF and defined the atomic modifications to describe the partial properties of the Measure CF. In addition we investigated whether the measure is an Extensive Structure to the binary operations BSEQ and BALT. We present the summary of the results of this investigation:

199

8 Measures of Oviedo

Measure CF: Measure: OVIEDO Partial Properties of the Measure to Atomic Modifications (AM) AM Ml

>«< >

Description of the Atomic Modification To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

M5

=

To transfer an edge from one location in the flowgraph to another location in the flowgraph.

MEDG >

To add an edge at an arbitrary location in the flowgraph.

CFF

=

Measure Oviedo: To delete an edge at an arbitrary location in the flowgraph and to add an edge and a node at an arbitrary location in the flowgraph.

C

Y

Remarks: Y: Measure is completely described; N: Measure is not completely described.

Measure: OVIEDO Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y Y Y

Y Y Y Y

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure/CF'=CF+1: Ratio scale Extensive Structure/CF''=CF+4: Ratio scale

Figure 8.66: The partial properties of the Measure CF and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. The Measure OV of Oviedo is a hybrid measure. It is the combination of the Measures CF for control flow complexity and DF for data flow complexity of programs. The Measure CF of Oviedo is a very simple measure. It is an Extensive Structure for the both binary operations BSEQ and BALT. However, the Measure OV of Oviedo is defined as the sum of the control flow complexity CF and the data flow complexity DF. Considering the definition of DF it is clear, that there are interactions between the flowgraphs P1 o P2 in the case of the binary operation BSEQ and BALT. The consequence is, that the Measure OV of Oviedo OV(G)=CF + DF does not have the property of the axiom of monotonicity. That was already pointed out by Weyuker /WEYU85/ in her consideration of data flow measures. A further consequence is, that the Measure OV of Oviedo cannot be used as a ratio scale. However, that is not the only consequence of combining the two Measures CF and DF to one Measure OV. The types of the atomic modifications and the partial properties will be changed when the Measures CF and DF are combined to the Measure OV. The number of the atomic modifications increases, that means the measure captures more partial properties of complexity. This makes it difficulty to interpret the numbers. We are not sure whether it really makes sense to combine control flow and data flow complexity measures to one value.

200

8 Characterization of the Properties of Measures

8.9 Measure PATH of Schneidewind Name of the Measure: Measure PATH of Schneidewind and other authors. Author of the Measure: Schneidewind; Gilb; Fenton; Kaposi, and other authors. Published In: /SCHN79/, /GILB77/, /FENT87/, /ALVE88/, and others Definition of the Measure The Measure PATH is defined by several authors, but mostly verbally. No exact definitions exists for counting the possible paths of loops. A solid mathematical definition of the Measure PATH was given by Fenton and Kaposi /FENT87/, which is presented here. Measure PATH Fenton and Kaposi /ALVE88/ defined the Measure PATH by assigning the number of paths to each prime in a flowgraph F and used for the definition of the measure the Fenton-Whitty scheme. Definition 8.32 (Measure PATH): Using the Fenton-Whitty scheme, the Measure PATH (Abbreviated with u) is defined: P1

Trivial prime.

D1'

if-then-structure.

D1

If-then-else-structure.

D2

Do-while-structure.

1.

u(F)= number of paths through F for each prime F with: u(P1)=1, u(D1')=2, u(D1)=2, u(D2)=2 etc.)

2.

u(F1;....;Fn)=TT^ 1 u(Fi)

3.

u(F(F1

Fn)) = I^^TT J ; = 1 u(Fi) b i i

where bij = 1 if Fi lies on the jth path of F and bij=0 otherwise. • Note that the value here is dependent on bij's which in turn are dependent not on u(F) but on F. In order to explain the Measure PATH some examples are presented.

8 Measure PATH of Schneidewind et al.

201

Examples We consider some examples of the Measure PATH, The first example shows the flowgraph PWS. A: PWS N: PWS R: Author C: Example SU:

GRAPH: PWS PATH NODES 10 12 11 12

10 12 11 12

10 12 11 12

10 12 11 12

RESULTS OF THE MEASURE(S) PWS PATH

8.000

Figure 8.67: The flowgraph PWS consists of eight possible path. The next example shows the nested flowgraph PWN. A: PWN N: PWN R: Author C: Example SU:

GRAPH: PWN PATH NODES 1 1 1 1

2 2 2 9

3 4 7 8 10 3 5 7 8 10 6 8 10 10

•>106793. .

8 Measures of Hecht

225

CONTROL FLOW ANALYSIS SUMMARY : LCI I. II.

THE FLOW GRAPH IS NOT REDUCIBLE BY INTERVALS. BACK EDGES 0 -> V ASSOCIATED WITH MULTI-ENTRY REGIONS

U -> V 4 3 MEASURES IDSL AND LC OF HECHT: RESULTS OF THE MEASURE(S) UNSTRUCT H-RED IDSL LC N-LOOPS SCOPE-NL LN-SUM LN-ABS

1.000 -1.000 -1.000 -1.000 -1.000 2.000 -1.000 -1.000

Figure 8.92: Flowgraph LC1 is not reducible in intervals (IDSL(LC1)=-1). The value of the Measure SCOPE-NL is 2, that means that there are two loops in the flowgraph as defined by Howatt and Baker (See Section 8.17.3). We now show flowgraphs which consist of different type of alternative and loop structures. The next flowgraph SE1 consists of nested if-then constructs. A: SE1 N: SE1 R: Author C: Exmp. SU:

. . .2

v . . .3 v 4 V 5 V

..>6 . >7 V 8

CONTROL FLOW ANALYSIS SUMMARY : SE1 I.

THE FLOW GRAPH IS REDUCIBLE BY INTERVALS.

II.

THE FLOW GRAPH CONTAINS NO LOOPS.

III. MEASURE VALUES FOR THE DEPHT OF THE FLOW GRAPH INTERVAL DERIVED SEQUENCE LENGTH LOOP CONNECTEDNESS NUMBER OF LOOPS NUMBER OF LOOP NODES (SUMMARIZED) NUMBER OF LOOP NODES (ABSOLUTE)

= = = -

1 0 0 0 0

MEASURES IDSL AND LC OF HECHT: RESULTS OF THE MEASURE(S) UNSTRUCT H-RED IDSL LC N-LOOPS SCOPE-NL LN-SUM LN-ABS

0.000 0.000 1.000 0.000 0.000 0.000 0.000 0.000

Figure 8.93: In the flowgraph SE1 exists no backward edges. The complexity is: LC(SE1)=0.

226

8 Characterization of the Properties of Measures

Flowgraph SE3 is a modification of flowgraph SE1. The two forward edges are changed to backward edges. A: 5E3 N: SE3 R: Author C: Exmp. SU: 1 v ..>2 v . .>3 v 4 v 5 V ...6

CONTROL FLOW ANALYSIS SUMMARY : SE3 I. II.

LOOPS UNDER BACKWARD EDGES U -> V :

-> V 6 3 7 2

7 v e t

THE FLOW GRAPH IS REDUCIBLE BY INTERVALS.

LOOP NODES 3 4 5 6 2 3 4 5 6 7

III. MEASURE VALUES FOR THE DEPHT OF THE FLOW GRAPH : INTERVAL DERIVED SEQUENCE LENGTH LOOP CONNECTEDNESS NUMBER OF LOOPS NUMBER OF LOOP NODES (SUMMARIZED) NUMBER OF LOOP NODES (ABSOLUTE)

- 3 - 1 - 2 - 10 - 6

MEASURES IDSL AND LC OF HECHT: RESULTS OF THE MEASURE(S) SE3 UNSTRUCT H-RED IDSL LC N-LOOPS SCOPE-NL LN-SUM LN-ABS

0.000 1.000 3.000 1.000 2.000 2.000 10.000 6.000

Figure 8.94: Flowgraph SE3 has two loops and the value of Measure LC is: LC(SE3)=1. We now compare flowgraph SE4 with flowgraph SE3. A: SE4 N: SE4 R: Author C: Exmp. SU: 1 s V .>2 v 3 v . .4 v .>5

CONTROL FLOW ANALYSIS SUMMARY : SE4 I.

THE FLOW GRAPH IS REDUCIBLE BY INTERVALS.

II.

LOOPS UNDER BACKWARD EDGES U -> V :

U -> V

LOOP NODES

4 7

2 3 4 5 6 7

2 5

III. MEASURE VALUES FOR THE DEPHT OF THE FLOW GRAPH : INTERVAL DERIVED SEQUENCE LENGTH LOOP CONNECTEDNESS NUMBER OF LOOPS NUMBER OF LOOP NODES (SUMMARIZED) NUMBER OF LOOP NODES (ABSOLUTE)

« -

2 1 2 6 6

8 Measures of Hecht

227

MEASURES IDSL AND LC OF HECHT: RESULTS OF THE MEASURE(S) UNSTRUCT H-RED IDSL LC N-LOOPS SCOPE-NL LN-SUM LN-ABS

SE 4

SE3

0.00 0.00 2.00 1.00 2.00 2.00 6.00 6.00

0.00 0.00 3.00 1.00 2.00 2.00 10.00 6.00

Figure 8.95: Flowgraph SE4 has two sequential loops. The value of the Measure is: LC(SE4)=1.

The next example shows flowgraph SE5 compared with the flowgraphs SE4 and SE3. A: N: R: C: SU

SE5 SE5 Author Exmp.

1 V

>2

V 3

4

V 5

V 6

V 7

CONTROL FLOW ANALYSIS SUMMARY : SE5 I.

THE FLOW GRAPH IS REDUCIBLE BY INTERVALS.

II.

LOOPS UNDER BACKWARD EDGES U -> V :

U -> V

LOOP NODES

4 6

2 3 4 5 6 4 5 6

2 4

III. MEASURE VALUES FOR THE DEPHT OF THE FLOW GRAPH : INTERVAL DERIVED SEQUENCE LENGTH LOOP CONNECTEDNESS NUMBER OF LOOPS NUMBER OF LOOP NODES (SUMMARIZED) NUMBER OF LOOP NODES (ABSOLUTE) MEASURES IDSL AND LC OF HECHT:

•= = -

3 2 2 8 5

RESULTS OF THE MEASURE(S) SE5

UNSTRUCT H-RED IDSL LC N-LOOPS SCOPE-NL LN-SUM LN-ABS

1.00 0.00 3.00 2.00 2.00 2.00 8.00 5.00

SE 4

0.00 0.00 2.00 1.00 2.00 2.00 6.00 6.00

SE3

0.00 0.00 3.00 1.00

2.00 2.00 10.00 6.00

Figure 8.96: Flowgraph SE5 consist of two connected loops. The value of the Measure LC is: LC(SE5)=2. The values of the flowgraphs SE3, SE4 and SE5 are: LC(SE3)=1, LC(SE4)=1 and LC(SE5)=2. This explains the behaviour of the Measure LC. The value of the Measure UNSTR is: UNSTR(SE5)=1. That means that the flowgraph is determined as unstructured. The reason for that is the definition of unstructuredness of flowgraphs by overlapping ranges (See Section 8.18.3).

8 Characterization of the Properties of Measures

228

The next example shows the concatenation of the flowgraph SE5 to the flowgraph SE5A=SE5 o SE5 by the binary operation BSEQ. The connection between the both flowgraphs is done by the edge (7,8). A: SE5A N: SE5A R: Author C: Exmp. SU:

4 5 v 6 7 v 8

v ..>9 V 10 ...v ..>11

CONTROL FLOW ANALYSIS SUMMARY : SE5A I.

THE FLOW GRAPH IS REDUCIBLE BY INTERVALS,

II.

LOOPS UNDER BACKWARD EDGES U -> V :

u -> 4 6 1 1 1J

V 2 4 9 11

LOOP

NODES

2 3 4 5 6 4 5 6 9 10 11 12 11 12 13

13

III. MEASURE VALUES FOR THE DEPHT OF THE FLOW GRAPH : INTERVAL DERIVED SEQUENCE LENGTH LOOP CONNECTEDNESS NUMBER OF LOOPS NUMBER OF LOOP NODES (SUMMARIZED) NUMBER OF LOOP NODES (ABSOLUTE)

- 3 - 2 = 4 = 16 = 10

14 t MEASURES IDSL AND LC OF HECHT: RESULTS OF THE MEASURE(S) SE5A UNSTRUCT H-RED IDSL LC N-LOOPS SCOPE-NL LN-SUM LN-ABS

1.000 0.000 3.000 2.000 4.000 4.000 16.000 10.000

Figure 8.97: Two flowgraphs SE5 are combined by the binary operation BSEQ to the flowgraph SE5A=SE5 o SE5. The Loop-Connectness of LC(SE5) and (SE5A) is identical.

8 Measures of Hecht

229

The next example shows a more complicated flowgraph MENNERT3, which consists of unstructured loops and is reducible in intervals. A: MENNERT3 N: MENNERT3 R: MENNB9 C: Example for LC SU:

•>5 V :

U -> V

LOOP NODES 1 2 3 4 5 2 3 4 5

III. MEASURE VALUES FOR THE DEPHT OF THE FLOW GRAPH : INTERVAL DERIVED SEQUENCE LENGTH LOOP CONNECTEDNESS NUMBER OF LOOPS NUMBER OF LOOP NODES (SUMMARIZED) = NUMBER OF LOOP NODES (ABSOLUTE) MEASURES IDSL AND LC OF HECHT: RESULTS OF THE MEASURE(S) MENNERT3

1.000

UNSTRUCT H-RED IDSL LC N-LOOPS SCOPE-NL LN-SUM LN-ABS

2.000 3.000 2.000 2.000 2.000

9.000 5.000

Figure 8.98: Flowgraph MENNERT3 is unstructured, but reducible. The Loop-Connectness LC is 2 and the number of loops is: N-LOOPS (MENNERT)=2. The connected loop in the flowgraph MENNERT3 consists of the nodes 5,2,3,1. Discussion of the Measures of Hecht In order to give necessary and sufficient criteria for the use of the Measures IDSL and LC of Hecht we describe the properties of the measures by atomic modifications in the flowgraph. Measure Interval-Derived-Sequence-Length IDSL Definition 8.45 (Measure IDSL: Partial Properties to the Atomic Modifications): For the Measure IDSL of Hecht the following atomic modifications are defined: M1

=

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

11

>

To increase the Interval Derived Sequence Length in a reducible flowgraph RFG (Hecht).

• Explanation of the Atomic Modifications: The Measure IDSL is only partially described by the atomic modifications M1 and 11. The complexity increases if the "Interval Derived Sequence Length" increases.

230

8 Characterization of the Properties of Measures

Measure LC Definition 8.46 (Measure LC: Partial Properties to the Atomic Modifications): For the Measure LC of Hecht the three following atomic modifications are defined: M1

To increase the "Maximal Loop Connectness Length" LC in a reducible flowgraph RFG (Hecht).

• Explanation of the Atomic Modification: The Measure LC is only partially described by the defined atomic modifications. •

The atomic modification M1 remains the complexity unchanged or decreases the complexity (See the example). The atomic modification M5 remains the complexity unchanged, increases or decreases the complexity. The atomic modification LC1 always increases the complexity.

Example for the Atomic Modification M1 : We illustrate the atomic modification M1 by an example. A: M: R: C: SU

SE5 SE5 Author Exmp.

A: SE4 N: SE4 R: Author C: Exmp. SU: 1 s

1 s V . . .>2

V >2

V 3

V

4 V 5

V

>5

V 6

V

V 7 t

V

e 7

V

8 t RESULTS OF THE MEASURE(S) LC

LC

SE5

SE4

2.000

1.000

Figure 8.99: Flowgraph SE4 results from flowgraph SE5 by the atomic modification M1. The complexity decreases. Extensive Structure and Ratio Scale We discuss the Measures IDSL and LC of Hecht whether they are Extensive Structures. For that the two binary operations BSEQ and BALT are considered.

8 Measures of Hecht

231

Measure IDSL We consider the binary operations BSEQ and BALT. Binary Operation BSEQ: The example of flowgraph SE5A=SE5 o SE5 shows that the Measure IDSL of Hecht is not additive. The adding function is: IDSL(P1 o P2) = MAX (IDSL(P1 ),IDSL(P2)). The proof is given in /MENN89/. Hence, the Measure IDSL is not an Extensive Structure. Binary Operation BALT: For the Measure IDSL the adding function is: IDSL(P1 • P2) = MAX (IDSL(P1 ),IDSL(P2)). The next example illustrates the adding function of the Measure IDSL. A: SE5 N: SE5 R: Author C: Exmp. SU:

A: SE5 N: SE5 R: Author C: Exmp. SU:

Is v 2 V

>3 v 4 ;
5

V

.

>3 v 4

!5

v e

. .

v e

V

V

7

7

8 t

8 t

V

V

MEASURES IDSL AND LC OF HECHT: RESULTS OF THE MEASURE(S) UNSTRUCT H-RED IDSL LC N-LOOPS SCOPE-NL LN-SUM LN-ABS

UNSTRUCT H-RED IDSL LC N-LOOPS SCOPE-NL LN-SUM LN-ABS

SE5

SE50SE5

1.000 0.000 3.000 2.000 2.000 2.000 8.000 5.000

1.000 0.000 3.000 2.000 4.000 4.000 16.000 10.000

Figure 8.100: The binary operation BALT with the flowgraphs SE5. The example shows that the Measure IDSL is not additive. The proof is also given in /MENN89/. The Measure IDSL not an Extensive Structure to the binary operation BALT. The Measure cannot be used as a ratio scale. Measure LC For the Measure LC the binary operations BSEQ and BALT are investigated. Binary Operation BSEQ: The example in Figure 8.97 shows that the Measure LC of Hecht is not additive. The adding function is: LC(P1 0 P2) = MAX (LC(P1),LC(P2)). Hence the Measure LC is not an Extensive Structure. To illustrate that the Archimedian axiom is considered.

232

8 Characterization of the Properties of Measures

Pl# P2 are arbitrary

LC (PI) LC(P2) LC(P3) LC(P 4)

= = = -

2 7 3 2

More complex than Less complex than

Figure 8.101: Archimedian Axiom for the binary operation BSEQ. If P3 •> P4 then for any P1 ,P2 there exists a natural number n, such that P1 o nP3 •> P2 o nP4 It is easy to show, that the Measure Loop-Connectness (LC) does not have the property of the Archimedian axiom because it is not possible to change the relation between P1 o nP3 and P2 o nP4 by adding n-times the flowgraphs P3 and P4. Hence, the Measure LC is not an Extensive Structure.

Binary Operation BALT: Figure 8.100 shows, that the Measure LC is not additive. It is easy to see, that the adding function for the binary operation BALT is: LC(P1 *P2) =MAX ( LC(P1), LC(P2)). The Measure LC is not an Extensive Structure.

Final Remarks We presented the definitions of the Measures IDSL and LC and defined the atomic modifications to describe the partial properties of the Measures IDSL and LC. In addition we investigated whether the measure are Extensive Structures to the binary operations BSEQ and BALT. W e present the summary of the results of this investigation:

Measure IDSL: Measure: IDSL Partial Properties of the Measure to Atomic Modifications (AM) AM

>=


To increase the Interval Derived Sequence Length in a reducible flowgraph RFG (Hecht).

Ml

=

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

N Remarks: Y: Measure is completely described; N: Measure is not completely described. C Measure: IDSL Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y Y N

Y Y Y N

233

8 Measures of Hecht Binary Operation BSEQ: Binary Operation BALT:

Figure 8.102: The partial properties of the Measure IDSL and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. Measure LC: Measure : LC Partial Properties of the Measure to Atomic Modifications (AM) AM

>=


To increase the "Maximal Loop Connectness Length" LC in a reducible flowgraph RFG (Hecht).

Ml

=


Measure N-L00P: To create a loop as defined by Hecht, Aho and Ullmann.

C N Remarks: Y: Measure is completely described; N: Measure is not completely described. Measure: N-LOOPS Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y Y Y

Y Y Y Y

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure/Ratio Scale Extensive Structure/Ratio Scale

Figure 8.104: The partial properties of the Measure N-LOOPS and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. The Measures LC and IDSL of Hecht were introduced in 1977, but they were fallen in oblivion. We mean, that the Measures IDSL and LC are well qualified as complexity measures. The Measure IDSL gives information about the reducibility of flowgraphs and the Measure LC about the types of loops in the flowgraph. A disadvantage is that the measures are only defined for reducible flowgraphs and the definitions are not extendable to arbitrary flowgraphs G.

234

8 Characterization of the Properties of Measures

8.12 Measure of Moawad and Hassan and Extensions Name of the Measure: Measure MWD-MH of Moawad and Hassan and extensions. Author of the Measure: Moawad, Ramadan; Hassan, Mohamed. Published in: /MOAW83/. Definitions of the Measures In 1983 Moawad and Hassan proposed an extension of the Measure of McCabe and included the "loop-effect" to the Measure of McCabe. The Measure MCC-V2 of McCabe was selected as a base measure because this measure can be used for the binary operation BSEQ as a ratio scale (additive property). Measure MWD-MH We present the original definition of the Measure MWD-MH of Moawad and Hassan. Definition 8.47 (Measure MWD-MH( Original Definition by Moawad and Hassan)): For flowgraph: We assume flowgraph: Gd* (Dijkstra and extended Dijkstra structures) MWD-MH(Gd')

=

|E| - |N| + 1 + |L|

MWD-MH(Gd')

=

MCC-V2 + |L|

with MCC-V2

Measure of McCabe (additive).

11—|

Number of Loops.

Moawad and Hassan did not state the type of the flowgraph and they did not give the definition of a loop. Probably they assumed the flowgraphs Gd or Gd'. In order to give a precise definition of the Measure MWD-MH of Moawad and Hassan we introduce some modified and improved definitions and some more measures. For flowgraph: Gd' MCC-V2(Gd')

=

|E| - |N| + 1

MWD-MH(Gd')

=

|E| - |N| + 1 + |Eb|

MWD-MH(Gd')

=

MCC-V2(Gd') + |Eb|

with |Eb|

Number of backward edges |Eb| (number of loops), as defined by Hecht /HECH77/.

• For flowgraphs Gd ¿Gcf, the loops (backward edges) are uniquely defined /HECH77/. Measure MWD-HB We propose an extension of the Measure MWD-MH of Moawad and Hassan and that is the Measure MWD-HB. Definition 8.48 (Modified Measure MWD-HB by the Author): For flowgraph: G MCC-V2(G)

=

|E| - |N| + 1

MWD-HB(G)

=

|E| - |N| + 1 + SCOPE-NL

8 Measures of Moawad and Hassan MWD-HB(G)

=

235

MCC-V2(G) + SCOPE-NL

with SCOPE-NL

Number of loop-predicates in a flowgraph G using the approach of Howatt and Baker (See Section 8.17.2). The Measure SCOPE-NL is defined for structured and unstructured flowgraphs.

• Measure MWD-LC We propose an extension of the Measure MWD-MH of Moawad and Hassan and that is the Measure MWD-LC. Definition 8.49 (Modified MWD-LC by the Author): For flowgraph: RFG MCC-V2(G)

=

|E| - |N| + 1

MWD-LC(RFG)

=

|E| - |N| + 1 + LC

MWD-LC(RFG)

=

MCC-V2(G) + LC

with RFG

Reducible flowgraph as defined by Hecht /HECH77/.

LC

Measure "Loop Connectness" LC of Hecht /HECH77/ (See Section 8.11, the Measures IDSL and LC of Hecht).

Comments by the Author Moawad and Hassan either gave a precise definition of the type of flowgraphs which they use nor they gave the definition of a loop. Their definition of the Measure MWD-MH is not unique. We improved and precised the definition using the following three definitions of loops from the literature: 1.

The definition of a loop (backward edge) in flowgraphs Gl, Gd and Gd' /HECH77/.

2.

The definition of a loop-predicate by Howatt and Baker /HOWA85/. Howatt and Baker gave a definition of a loop predicate for structured and unstructured flowgraphs (See the Measures SCOPE-NL and NL of Howatt and Baker in Section 8.17.3).

3.

The definition of the Loop-Connectness by Hecht /HECH77/ (See in Section 8.11 the Measures IDSL and LC of Hecht).

Some examples shall illustrate the modified measures of Moawad and Hassan. Examples In order to explain the definitions of the Measures of Moawad and Hassan and the improved definitions by the author, several examples are given. » 1 2 3 4

MEASURE

AUTHOR

H-RED UNSTRUCT NODES EDGES

Hecht, M. Zuse, H. Zuse, H. Zuse, H.

OVERVIEW ABOUT MEASURES: T S REF SECTION I B F P

HECH77 Author Author Author

8.11 8 8 8

COMMENT TO THE MEASURE Reducible-O, not reducible—1. UNSTRUCT-1 then unstructured else 0 Number of Nodes INI Number of edges IEI In G.

236 5 6 7 8 9 10

8 Characterization of the Properties of Measures MCC-V2 MWD-MH MWD-HB MWD-LC N-LOOPS NL

11 LC

McCabe, T. Moawad;: Hassan Moawad;r Hassan Moawad;r Hassan Hecht, M. Howatt;' Baker

B L L L L LR

MCCA76 MOAH83 MOAW83 MOAW83 HECH77 HOWA85

Hecht, M.

I

HECH77 8.11

MCC-V2= | E | - | N | + 1 Extension of the Measure of McCabe Extension of MWD-MH by Howatt, Baker Extension of MWD-MH with LC of Hecht Number of Loops by Hecht Sum of the nesting level of nodes by loops Loop-Connection-Sequence-Length

8.4 8.12 8.12 8.12 8.11 8.17.3

Figure 8.105: The list of measures used for the examples. The first example are flowgraphs consisting of different types of loops. A: P3 N: P3 R: Author C: Example SU:

A: P4 N: P4 R: Author C: Example SU:

1 s

1 s

V

V

2. .

26610
2

V

....>2

V

>2

V

>2

V

V

V

V

V

V

V

.5

V

V

V

! ! v . ...>6

V

V

V

V

V >7

V

V

V

V

V B

V

V

. . . .

4

4

5

>4 5

e

6

7

5

6

6

7 t

7

8 t

>4

7

V

8 t

8

v . . .>9 v 10 11 V 12

v 13 v 14 t MEASURES OF MOAHAD: RESULTS OF THE MEASURE(S) UNSTRUCT H-RED LOC EDGES PRIMES N-LOOPS SCOPE-NL LN-ABS LN-SUM MCC-V2 MWD-MH MWD-HB MWD-LC LC

LCI

SE1

SE3

SE4

SE5

SE5A

1 .00 0 .00 6 .00 8 .00 2 .00 -1 .00 2 .00 -1 .00 -1 .00 3 .00 5 .00 5 .00 -1 .00 -1 .00

0 .00 0 .00 10 .00 11 .00 2 .00 0 .00 0 .00 0 .00 0 .00 2 .00 2 .00 2 .00 2 .00 0 .00

0 .00 0 .00 10 .00 11 .00 2 .00 2 .00 2 .00 e .00 10 .00 2 .00 4 .00 4 .00 3 .00 1 .00

0 .00 0 .00 10 .00 11 .00 2 .00 2 .00 2 .00 6 .00 e .00 2 .00 4 .00 4 .00 3 .00 1 .00

1 .00 0 .00 7 .00 8 .00 1 .00 2 .00 2 .00 5 .00 8 .00 2 .00 4 .00 4 .00 4 .00 2 .00

1..00 0..00 14..00 17,.00 2,.00 . 4 .00 4 .00 . 10..00 16,.00 4, .00 8..00 8..00 6,.00 2..00

Figure 8.107: The complexities of several flowgraphs calculated with the Measures of Moawad and Hassan and some extensions by the author.

The value of the Measure MWD-HB for the flowgraphs SE4 and SE5 is identical, but the value of the Measure MWD-LC increases. The reason for that is the behaviour of the Measure LC. Discussion of the Measures In order to give necessary and sufficient criteria for the use of the (extended) Measures of Moawad and Hassan the partial properties of the measures are described by atomic modifications in the flowgraph. Measures MWD-MH, MWD-HB and MWD-LC For the Measures MCC-V2 (repeated for a better explanation of the other measures), MWD-MH, MWD-HB and MWD-LC the following atomic modifications are defined.

238

8 Characterization of the Properties of Measures

Definition 8.50 (Measures MCC-V2, MWD-MH, MWD-HB and MWD-LC: Partial Properties to the Atomic Modifications): Measure MCC-V2: M1

=

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

M5

=

To transfer an edge from one location in the flowgraph to another location in the flowgraph.

MEDG

>

To add an edge at an arbitrary location in the flowgraph.

Measure MWD-HM: M1

=

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

M5

*

To transfer an edge from one location in the flowgraph to another location in the flowgraph.

FB

>

To change the direction from a forward to a backward edge in a flowgraph Gd'. Let G=(N,E,s,t) be a RFG (Reducible Flowgraph). Edge (x,y) is backward if and only if y dominates x.

MEDG

>

To add an edge at an arbitrary location in the flowgraph.

Measure MWD-HB: M1

=

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

M5

*

To transfer an edge from one location in the flowgraph to another location in the flowgraph.

MNL

>

To create a loop-predicate as defined for the Measures NL by Howatt and Baker.

MEDG

>

To add an edge at an arbitrary location in the flowgraph.

Measure MWD-LC: M1

£

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

M5

*

To transfer an edge from one location in the flowgraph to another location in the flowgraph.

LC1

>

To increase the "Maximal Loop Connectness Length" LC in a reducible flowgraph RFG (Hecht).

MEDG

>

To add an edge at an arbitrary location in the flowgraph.

• Explanation of the Atomic Modifications: The Measure MCC-V2 is completely described by the atomic modifications M1, MEDG and M5 The Measures MWD-HM, MWD-HB and MWD-LC are only partially described by the defined atomic modifications.

8 Measures of Moawad and Hassan

239

The atomic modifications M1, M E D G and M5 described already the partial properties of the Measure MCC-V2 of McCabe (See Section 8.4). Let us consider the differences of the Measure MCC-V2 and the Measures MWD-HM, MWD-HB and MWD-LC. Atomic Modification M1: In the case of the Measure MCC-V2, MCC-MH and MCC-HB the atomic modification M1 does not change the complexity. In the case of the Measure MWD-LC the complexity decreases or remains unchanged. (See the example below). Atomic Modification MEDG: The atomic modification M E D G increases always the complexity. The reason for that is the contribution of the Measure MCC-V2. Atomic Modification M5: The atomic modification M5 increases, deceases or remains the complexity unchanged for the Measures MWD-HM, MWD-HB and MWD-LC. Atomic Modifications M4, MNL and LC1: The atomic modifications M4, MNL and LC1 describe the loop-effect as defined by Hecht (MWD-MH), by Howatt and Baker (MWD-HB) and again by Hecht (MWD-LC). Example of the Atomic Modification M1 for the Measure MWD-LC: The partial properties to the atomic modification M1 for several measures which are sensitive against loops. A: N: R: C: SU

SE5 SE5 Author Exmp. 1

A: N: R: C: SU s

SE 4 SE 4 Author Exmp. 1

V

>2

V

V

3

3

4

4

V

V

5

>5

V .6

V 6

V 7

s

V

>2

V 7

t

V

8 t

MEASURES OF MOAWAD: RESULTS OF THE MEASURE(S) SE5

UNSTRUCT H-RED LOC EDGES PRIMES N-LOOPS SCOPE-NL LN-ABS LN-SUH MCC-V2 MWD-MH MWD-HB MWD-LC LC

UNSTRUCT H-RED LOC EDGES PRIMES N-LOOPS SCOPE-NL LN-ABS LN-SUM MCC-V2 MWD-MH MWD-HB MWD-LC LC

1.000 0.000

SE 4

7.000 8.000

0.000 0.000 10.000 11.000

2.000 2.000

.000 2.000

1.000

5.000 8.000 2.000 4.000 4.000 4.000 2.000

.000

6.000 6.000 2.000 4.000 4.000 3.000 1.000

Figure 8.108: Flowgraph S E 4 results from flowgraph S E 5 by the atomic modification M1. The complexity of the Measure MWD-LC decreases.

240

8 Characterization of the Properties of Measures

Extensive Structure and Ratio Scale We discuss the conditions whether the Measures of Moawad and Hassan and the extensions can be used as a ratio scale. We have to show whether the Measures of Moawad and Hassan are Extensive Structures to the binary operations B S E Q and BALT. The Measures MWD-HB and MWD-LC are not especially investigated (For that seethe Measures NL of Howatt and Baker and LC of Hecht (Sections 8.17.2 and 8.11)). Binary Operation BSEQ Measure MCC-V2: As shown in Section 8.4, the Measure MCC-V2 is additive. Measure MWD-MH: The adding function for the Measure MWD-MH is: MWD-MH (P1 0 P2) = MWD-MH(P1) + MWD-MH(P2). The Measure MWD-MH is an Extensive Structure and can be used as a ratio scale. Measure MWD-HB: The adding function for the Measure MWD-HB is: MWD-HB (P1 o P2) = MWD-HB(P1) + MWD-HB(P2). The Measure MWD-HB is an Extensive Structure and can be used as a ratio scale. Measure MWD-LC: Because the Measure MCC-V2 is additive and the Measure LC of Hecht is not additive, then the Measure MWD-LC is not additive, either. Hence, the Measure MWD-LC is not an Extensive Structure. Binary Operation BALT Measure MWD-MH: The adding function for the Measure MWD-MH is: MWD-MH (P1 • P2) = MWD-MH(P1) + MWD-MH(P2). The Measure MWD-MH is an Extensive Structure and can be used as a ratio scale. Measures MWD-HB: The Measure MWD-HB does not have the property of the axiom of associativity. Hence, the Measure MWD-HB is not an Extensive Structure. Measures MWD-LC: The Measure MWD-LC does not have the property of the Archimedian axiom (See Measure LC). Hence, the Measure MWD-LC is not an Extensive Structures. Final Remarks We presented the definitions of the Measure MWD-HM of Moawad and Hassan, of the extended Measures MWD-HB and MWD-LC, and defined the atomic modifications to describe the partial properties of the measures. In addition we investigated whether the measures are Extensive Structures to the binary operations B S E Q and BALT. We present the summary of the results of this investigation.

241

8 Measures of Moawad and Hassan

Measures MCC-V2, MWD-MH, MWD-HB and MWD-LC: SUMMARY OF THE PROPERTY OF MEASURES: Ml

To add a node a n d an e d g e

M5

To t r a n s f e r an e d g e f r o m one l o c a t i o n i n t h e f l o w g r a p h t o a n o t h e r l o c a t i o n the flowgraph.

(Statement)

FB

To c h a n g e t h e d i r e c t i o n f r o m a f o r w a r d t o a b a c k w a r d e d g e i n a f l o w g r a p h G d ' . L e t G = ( N , E , s , t ) b e a RFG ( R e d u c i b l e F l o w g r a p h ) . Edge ( x , y ) i s b a c k w a r d i f a n d o n l y i f y d o m i n a t e s

MNL

To c r e a t e a l o o p - p r e d i c a t e a s d e f i n e d f o r t h e M e a s u r e s NL by Howatt and B a k e r .

LCI

To i n c r e a s e t h e "Maximal Loop C o n n e c t n e s s L e n g t h " LC i n a r e d u c i b l e f l o w g r a p h RFG ( H e c h t ) .

MEDG To add an e d g e a t an a r b i t r a r y C

location

in the

flowgraph.

METVPA:

Ml

M5

FB >

LCI

MEDG

C

>

> > >

N N N

NUMBER OF MEASURES:

1 MWD-MH 2 MWD-HB 3 MWD-LC

x.

described.

3

OVERVIEW ABOUT MEASURES: NAME

in

flowgraph.

R e m a r k s : Y: M e a s u r e i s c o m p l e t e l y d e s c r i b e d ; N: M e a s u r e i s n o t c o m p l e t e l y

MWD-MH MWD-HB MWD-LC



a t an a r b i t r a r y l o c a t i o n i n t h e

AUTHOR

REF

Moawad; H a s s a n Moawad; H a s s a n Moawad; H a s s a n

MOAW83 MOAW83 MOAW83

BSEQ O A C M A R E S C

BALT A C M A R E S C

Y Y Y Y E R Y Y Y Y E R Y Y Y N

Y Y Y Y E R Y Y Y Y E Y Y Y N

Figure 8.109: The partial properties of the Measures MCC-V2, MWD-MH, MWD-HB and MWD-LC and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. The Measures MWD-MH, MWD-HB and MWD-LC are extensions of the Measure MCC-V2 of McCabe. We gave a precise definition of the extended and improved measures. Moawad and Hassan added the loop effect to the Measure of McCabe. They point out that the Measure MWD-MH is a suitable measure of structural complexity because it includes the two sources of logical complexity, "tests and loops". But they did not give definitions of loops. The Measure MWD-LC cannot be used as a ratio scale because it is not an Extensive Structure for the both binary operations. The Measure MWD-HB is beside the Measure NL of Howatt and Baker the only one measure which measures the loop-effect in a structured and unstructured flowgraph. It is an Extensive Structure for both binary operations and can be used as a ratio scale for the binary operation BSEQ. The question is here again whether the combination of the Measure MCC-V2 and another measure which captures the loop-effect makes sense. The number of the partial properties of the measure increases and it is more difficult to interpret the results of the measurement process. A possibility is to use the measures as pairs, like (MCC-V2, MWD-MH, MWD-HB, MWD-LC). Using this pairs it is easy to see whether there are loops in the program.

242

8 Characterization of the Properties of Measures

8.13 Measure "Reachability" of Schneidewind Names of the Measures: Measures Reachability REACH arid Normalized Reachability N-REACH of Schneidewind and the extension S-REACH by the author. Author of the Measure: Schneidewind, N.F. Published In: /SCHN79/. Definitions of the Measures R(rij)

Reachability matrix of nodes in G, with

rij= rij=

1 if node rj is reachable from node ri. 0 otherwise.

Measure Reachability REACH Definition 8.51 (Measure: Reachability): For flowgraph: G REACH(G) = ZjUJlJiriJ • Measure Normalized Reachability N-REACH Definition 8.52 (Measure: Normalized Reachability): For flowgraph: G N-REACH(G) =

/|N|



Measure Relative Reachability S-REACH The reason for this definition is that the normalization by |N| is not reasonable. The normalization as defined for the Measure S-REACH has the effect, that the complexity of a sequence is 1. Definition 8.53 (Measure: Relative Reachability (By the Author)): For flowgraph: G S-REACH(G) = EjUJlftrlj /(|N|/2*(|N|-1)) • Examples Some examples to calculate the reachability are presented. Firstly, the reachability of nodes for the flowgraph P1 is presented. A: FF N: FF R: Author C: Example SU: S

N

I 1 2 3 4 5 6

6

8

8

7

..>83 . .>4 . . .>5 . . . .>6 >7

>8 v>9 v 10 . . . . v 11 . . . v 12 . . v 13 . v 14 v 15 16 v 17 t

N

t

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

PATH FROM N TO NODE 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 5 6 7 8 9 10 11 12 13 14 15 16 5 6 7 8 9 10 11 12 13 14 15 16 6 7 8 9 10 11 12 13 14 15 16 7 8 9 10 11 12 13 14 15 16 8 9 10 11 12 13 14 15 16 9 10 11 12 13 14 15 16 10 11 12 13 14 15 16 11 12 13 14 15 16 12 13 14 15 16 13 14 15 16 14 15 16 15 16 16

244

8 Characterization of the Properties of Measures

MEASURES OF SCHNEIDEWIND:

RESULTS OF THE MEASURE(S) MNA

LOC REACH N-REACH S-REACH

16.000 120.000 7.500

1.000 Figure 8.112: The values of the measures for reachability for the maximal nested flowgraph MNA. An overview of the reachability of nodes of differently nested flowgraphs as proposed by Howatt and Baker /HOWA89/ (See also Section 7.2.3). < CF

DESCRIPTION

1 2 3 4 5 6

Seq. 7 Seq. 7 7 max. 7 max. 7 Int. 7 int.

SA SI MNA MNI INA INI

Alt. Itéra. nest. Alt. nest. Itéra. n. Alt. n. Itéra.

LOC

DEC

REACH

N-REACH

S-REACH

16.00 16.00 16.00 16.00 16.00 16.00

7.00 7.00 7.00 7.00 7.00 7.00

120.00 141.00 120.00 225.00 120.00 225.00

7.50 8.81 7.50 14.06 7.50 14.06

1.88

1.00 1.17 1.00 1.88 1.00

Figure 8.113: The complexities of six differently nested flowgraphs calculated with the Measures of Schneidewind. The most complex flowgraphs are the flowgraphs MNI and INI. The intermediate nested flowgraph INA is less complex than the intermediate nested flowgraph INI which contains deeply nested loops. The next example shows four simple flowgraphs. A: SI N: SI R: HARR82 C: Example SU:

A: S2 N: S2 R: HARR82 C: Example SU:

A: N: R: C: SU

S3 S3 HARR82 Example

A: S3M N: S3M R: Author C: Example SU:

.1. . .3. . . . .3 6

7

:.>8910... t

•>7

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

MEDG

^

To add an edge at an arbitrary location in the flowgraph.

R

>

To increase the reachability of a node in a flowgraph.

RNST

*

To nest two arbitrary non-overlapping ranges Range(p) in Range(q) by replacing one node of Range(q) by Range(p). Ranges are defined by the conditions of Howatt and Baker.

Explanation of the Atomic Modifications: The Measure REACH is only partially described by the defined atomic modifications M1, MEDG, R and RNST. The atomic modification M1 increases always the complexity because the reachability of the node increases. The atomic modification MEDG increases or remains the complexity unchanged (See the example below). The atomic modification R increases always the complexity. The atomic modification RNST increases, decreases or remains the complexity unchanged (See the example below). Example for the Atomic Modification MEDG: A: PI N: PI R: Author C: Example SU: S

A: P3 N: P3 R: Author C: Example SU:

A: P4 N: P4 R: Author C: Example SU:

1 s

1 s

1 5

2

V

V

...3... v 1

v 5

26io4
3
4
8< t

V

V

V

V

4

5

V

>5 .

.

V

6

V

V

7

7

V

>8

> s < . . ; V

! ->6< t

.

9. . .

V

10 MEASURES OF

3

6

>52

V

. . .4. t

V

s

1

V

right

>2

>56


To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

MEDG

^

To add an edge at an arbitrary location in the flowgraph.

R

>

To increase the reachability of a node in a flowgraph.

RNST

*

To nest two arbitrary non-overlapping ranges Range(p) in Range(q) by replacing one node of Range(q) by Range(p). Ranges are defined by the conditions of Howatt and Baker.

Explanation of the Atomic Modifications: The Measure N-REACH is only partially described by the partial properties to the defined atomic modifications M1, MEDG, R and RNST. The partial properties of the Measure N-REACH are the same as the partial properties of the Measure REACH.

8 Measure Reachability of Schneidewind

247

Measure S-REACH In order to give necessary and sufficient criteria for the use of the Measure S-REACH we describe the partial properties by atomic modifications in the flowgraph. Definition 8.56 (Measure S-REACH: Partial Properties to the Atomic Modifications): M1

^

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

MEDG

£

To add an edge at an arbitrary location in the flowgraph.

R

s

To increase the reachability of a node in a flowgraph.

RNST

*

To nest two arbitrary non-overlapping ranges Range(p) in Range(q) by replacing one node of Range(q) by Range(p). Ranges are defined by the conditions of Howatt and Baker.

• Explanation of the Atomic Modifications: The Measure S-REACH is only partially described by the atomic modifications M1, MEDG, R and RNST. Interesting is the atomic modification M1, which changed from > (Measures REACH and N-REACH) to >. For example, to add an edge and a node in a sequence. The complexity remains unchanged. The atomic modification MEDG increases or remains the complexity unchanged. The atomic modification R increases or remains the complexity unchanged. The atomic modification RNST increases, decreases or remains the complexity unchanged. Extensive Structure and Ratio Scale We discuss the conditions whether the Measures of Schneidewind can be used as a ratio scale. We have to show whether the Measures of Schneidewind are Extensive Structures to the binary operations BSEQ and BALT. Measures REACH, N-REACH and S-REACH Firstly, we consider the binary operation BSEQ. Binary Operation BSEQ: The adding function of the Measure REACH is: REACH(G)= REACH(P1 ) + REACH(P2) + LOC(P1 )*LOC(P2) LOC is the Measure "Lines of Code". The example below illustrate that:

248

8 Characterization of the Properties of Measures

A: PI N: PI R: Author C: Example SU: S

A: P2 N: P2 R: Author C: Example SU: S

1 s

1 s

2 ...3... 4

5

.,>61013

PI o. . .

P2 o

V

V

o V

oo

V

>14 >10
o

V

• >5 >-

>= >= >«

> > >

* * *

N N N

NUMBER OF MEASURES:

NAME 1 REACH 2 N-REACH 3 R-REACH

AUTHOR

3

OVERVIEW ABOUT MEASURES: BSEQ REF O A C M A R E S C

Schneidewind Schneidewind Zuse, H.

SCHN79 SCHN79 Author

Y Y Y

Y Y Y

Y N N

Y

E

R

BALT A C M A R E S C N N N

Figure 8.119: The partial properties of the Measures of Schneidewind and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. The Measure REACH is an Extensive Structure to the binary operation BSEQ, but it is not additive. The Measures N-REACH and S-REACH are not Extensive Structures to the binary operations BSEQ and BALT. The reachability could be a characteristic of the complexity of a program. The behaviour of the Measure N-REACH is very difficulty to understand. For this reason we introduced the Measure S-REACH, where the complexity of a sequence is exactly 1.

250

8 Characterization of the Properties of Measures

8.14 Measures of Chen Names of the Measures: Measure Maximal-Intersection-Number MIN and Z of Chen. Author of the Measure: Chen, Edward T. Published in: /CHEN78/, /HOWA85a/. Definitions of the Measures In 1979 Chen defined the Measures MIN and Z as a part of his "Effort to Measure Programmers Productivity". Chen distinguishes a weak connected flowgraph and a strong connected flowgraphs. But these definitions do not correspond with the definitions in graph theory. We think that the terms flowgraph without a bridge and flowgraph with a bridge are more precisely. Definition 8.57 (Flowgraph with a Bridge): For flowgraph: Gd A bridge is the connection of two sequential D-Structures by one edge. >o

. Bridge or o D1 o >o . Bridge

D1 o t

Case II: Figure 8.120: Two flowgraphs with a bridge. P' is an arbitrary program and D1 an ifthen-else control structure. A bridge combines two D-Structures or two arbitrary programs by at least one edge. • Definition 8.58 (Flowgraph without a Bridge): A flowgraph without bridges has no control flow structures which are combined by an edge.

so !

....o....

ot

o p"

;

¿
Pred(p)*Pred(q) Ape LB(q)]

0

otherwise



8.14.4 Discussion of the Measures In the paper of Chen /CHEN78/ is it not quite clear how to calculate the complexity for the following cases. Case I:

so

Case II:

so

D1

D1

0....0

o

D1 o t

o

SI

ot

Figure 8.123: Two examples which demonstrate the connections of D-Structures with an edge. Case I is the concatenation of two if-then-else D-Structures D1. Case II is the concatenation of a D1-Structure and a sequence S1. The adding function of Measure MIN for the binary operation BSEQ is in the case I MIN(D1 o D2) = MIN(D1) + MIN(D2)-2*i+2, i is the number of primes in the sequence, that means 2 in the Cases I and II. In Case I D1 and D2 are combined, that is MIN=2+2-2*2+2=2. That is corresponding with the calculation of Chen. But in Case II, D1 (If-then-else-structure with MIN(D1)=2) and S1 (Sequence with MIN=1) are combined and that means: MIN=2+1 -2*2+2=1. That would mean, that the complexity decreases. We do not believe, that that is the idea of complexity of Chen. The example above shows a contradiction of the adding function of Chen. But Chen requires that adding sequences does not change the complexity (See /CHEN78/ p.249). For that reason we consider another example (Figure 4 on page 249, /CHEN78/) of Chen. Chen calculates the complexity of the flowgraph below with MIN(C1)=4. Dl o • so ! si ...o.... Bridge?

ot D1 o.

Flowgraph: Cl Figure 8.124: The complexity of flowgraph C1 is MIN(C1 )=4. But if we use the adding function of MIN the result is: MIN(C1 )=MIN(S1 )+MIN(D1 )+MIN(D1 )-2*3+2

254

8 Characterization of the Properties of Measures MIN(C1)=1 +2+2-2*3+2=1.

That does not correspond with the calculation of Chen for Measure MIN (Chen required a complexity of MIN(C1 )=4). In order to solve this problem we assume, that the Measure MIN of Chen is not sensitive against sequences of nodes and that a flowgraph Gd does not have single nodes (procedure nodes). We define the following control structures and complexities of the control structures for the Measure MIN of Chen. 8.14.4.1 Revised and Improved Definition of the Measure MIN by the Author In order to get a precise definition of the Measure MIN of Chen, the following definitions are given. Definition 8.63 (Control Structures for MIN): We propose the following control structures for the Measure MIN and determine u(P). P, P1 and P2 are arbitrary flowgraphs consisting of D-Structures and D1 is an if-then-else-structure. For flowgraph: Gd 1) If-then-Else-Structure Dl:

u(Dl)=2 2) Do-While-Structure D2 with P: P is an arbitrary program. u(P) +1 . . . .o

P

3) If-Then-Structure

o27 v 2

v 3 >5< v 7 v 8 v 9... v v 10 11

4 .

v 14 . .

.

:..i2..:

6 v

v 13

v 19 . .

20

!

v 15 v .>16 .v . 17... . v . 18 . . . .

!

>2i
22


FLOWGRAPH: PRATH2 LIST OF PRIMES: E EX

26

t

ro«»

!

RESULTS O F THE MEASURE(S) PRATH2 MIN

8.000

Figure 8.130: The complexity of the flowgraph PRATH2 is: MIN(PRATH2)=8. The list: COMPLEXITIES OF THE PRIMES shows the accumulated complexities of the primes in the flowgraph.

260

8 Characterization of the Properties of Measures

8.14.6 Discussion of the Measures In order to give necessary and sufficient criteria for the use of the Measure MIN the property of the Measure MIN is described by atomic modifications in the flowgraph. The partial properties of the Measure Z are identical to MIN. Definition 8.64 (Measures MIN and Z: Partial Properties to the Atomic Modifications): For the Measure MIN and Z of Chen the five atomic modifications are defined: M1

=

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

BF

=

To change a backward edge to a forward edge in a flowgraph. Backward edge: Let G=(N,E,s,t) be an RFG (Reducible Flowgraph). Edge (x,y) is backward if and only if y dominates x.

MEDG

>

To add an edge at an arbitrary location in the flowgraph.

CHS

=

Measures MIN and Z: To delete a D-Structure if-then-else (D1) which sequential follows an arbitrary program P on the same nesting level.

CHPS

=

Measures MIN and Z: If-Then-Else-Structure: one part is an arbitrary program P, the other part is a D1-Structure (If-then-else-Structure). The if-then-else-structure D1 is deleted.

Because of the following implications we see, that M1, BF, MEDG, CHS and CHPS describe the property of MIN. Let |i be the Measure MIN: P1 P1 P1 P1 P1

H(P1) = H(P2) H(P1) = H(P2) * > MEDG H(P1) > H(P2) H(P1) = H(P2) 'CHS : H(P1) = H(P2) CHPS Explanation of the Atomic Modifications: The Measure MIN is completely described by the atomic modifications M1, BF, MEDG, CHS and CHPS.



M1 BF

P2 P2 P2 P2 P2

=> => => => =>

The atomic modification M1 does not change the complexity of a flowgraph. In the revised definition of the author procedure nodes have no effect to the complexity of the flowgraph. The atomic modification BF is easy to see. The complexity remains unchanged if an edge is changed from a backward edge to a forward edge. The atomic modifications MEDG, CHS and CHPS are explained below.

The next figures show the defined atomic modifications in detail.

8 Measures of Chen

261

Explanation of the Atomic Modification MEDG PI

P2

o

V

0....0

o P

o

o P

o

o

V

0...0

Figure 8.131: The atomic modification MEDG. P2 results from P1 by adding an edge. The complexity of MIN increases always. Explanation of the Atomic Modification CHS In order to explain the atomic modification CHS we introduce the following definition. Definition 8.65 (Sequential Predicates): A predicate p sequentially follows a predicate q if every path from q to t contains p. • We demonstrate the definition in Figure 8.132.

O. . . .0 D1

o..o

Figure 8.132: P is an arbitrary flowgraph of the type Gd and D1 is an if-then-elsestructure. D1 follows the arbitrary flowgraph P sequential on the same nesting level. Flowgraph F2 results from flowgraph F1 by the atomic modification CHS. The complexity of MIN remains unchanged. The cancellation of D1 does not change the complexity of Gd. That means it holds always: MIN(F1)=P+2-2*2+2=MIN(F2). The atomic modification CHS does not change the complexity of the flowgraph. Explanation of the Atomic Modification CHPS The atomic modification CHPS changes a flowgraph from F1 to the flowgraph F2. o....o

D1 o

FI

>

o. . .o

P

o . . .o

F2

Figure 8.133: Flowgraph F2 results from flowgraph F1 by the atomic modification CHPS. The complexity of MIN remains unchanged. The following theorem can be proved. Theorem 8.5 The Measure MIN of Chen is completely described by the atomic modifications M1, BF, MEDG, CHS and CHPS.

262

8 Characterization of the Properties of Measures

Idea of the Proof of Theorem 8.5: We show two flowgraphs P1' and P2' with the same complexity of P1 and P2, but consisting of nested primes. The difference between P1' and P2' is only one atomic modification in the flowgraph and that is in case the Measure MIN the atomic modification MEDG.

o..0.0... P2 '

Figure 8.134: The flowgraphs P1 and P2 are arbitrary flowgraphs. The flowgraphs P1' and P2' are flowgraphs which differ in only one atomic modification and that is MEDG. It holds: MIN(P1 )=MIN(P1') and MIN(P2,)=MIN(P2). Using the defined atomic modifications the flowgraphs P1 and P2 have to be changed to the flowgraphs P1' and P2'. If that is possible for every arbitrary flowgraph then the property s of the Measure MIN is described completely by the partial properties. Ordinal Scale As shown above, the Measure MIN of Chen is completely described by the partial properties to the five atomic operations M1, BF, MEDG, CHS and CHPS. That means: P1 *;>P2 MIN(P1) £ MIN(P2). The user can use the Measure of MIN of Chen as an ordinal scale if he accepts the partial properties of the Measure MIN of Chen. 8.14.7 Extensive Structure and Ratio Scale We have to give conditions that the Measure of MIN of Chen can be used as a ratio scale, and we have to show whether the Measure of MIN of Chen is an Extensive Structure to the binary operations BSEQ and BALT. Binary Operation BSEQ The adding function of the Measure MIN of Chen by the improved definition of the author is: MIN (P1 O P2) = MIN(P1) + MIN(P2) - 2. That means, that the Measure MIN of Chen is an Extensive Structure. The Measure MIN'=MIN+2 is also an Extensive Structure and can be used as a ratio scale for the binary operation BSEQ.

263

8 Measures of Chen

Binary Operation BALT The adding function for the binary operation BALT is: MIN (P1 • P2) = MIN(P1) + MIN(P2). That means, that the Measure MIN of Chen is an Extensive Structure and can be used as a ratio scale.

8.14.8 Final Remarks We presented the definition of the Measures MIN and Z and defined the atomic modifications to describe the properties of the measures. In addition we investigated whether the measures are Extensive Structures to the binary operations BSEQ and BALT. We present the summary of the results of this investigation:

Measure MIN: Measure: MIN Partial Properties of the Measure to Atomic Modifications (AM) AM

>=


To add an edge at an arbitrary location in the flowgraph.

CHS

Measures MIN and Z: To delete a D-Structure if-then-else (Dl) which sequential follows an arbitrary program P on the same nesting level.

»

CHPS =

Measures MIN and Z: If-Then-Else-Structure; one part is an arbitrary program P, the other part is a Dl-Structure (If-then-else-Structure). The if-then-else-structure Dl is deleted.

C

Remarks: Y: Measure is completely described; N: Measure is not completely described.

Y

Measure: MIN Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y Y Y

Y Y Y Y

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure/MIN'=MIN+2: Ratio scale Extensive Structure/Ratio scale

Figure 8.135: The partial properties of the Measure MIN and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT.

Measure Z: Measure: Z Partial Properties of the Measure to Atomic Modifications (AM) AM Ml

>=< =

Description of the Atomic Modification To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

BF

=

To change a backward edge to a forward edge in a flowgraph. Backward edge: Let G=(N,E,s,t) be an RFG (Reducible Flowgraph). Edge (x,y) is backward if and only if y dominates x.

MEDG >

To add an edge at an arbitrary location in the flowgraph.

CHS

Measures MIN and Z: To delete a D-Structure if-then-else (Dl) which sequential follows an arbitrary program P on the same nesting level.

=

CHPS =

Measures MIN and Z: If-Then-Else-Structure: one part is an arbitrary program P, the other part is a Dl-Structure (If-then-else-Structure). The if-then-else-structure Dl is deleted.

C

Remarks: Y: Measure is completely described; N: Measure is not completely described.

Y

264

8 Characterization of the Properties of Measures

Measure: Z Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y Y Y

Y Y Y Y

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure/Z1=Z-1: Ratio scale Extensive Structure/Ratio scale

Figure 8.136: The partial properties of the Measure Z and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. The Measures MIN and Z are Extensive Structures to the binary operations BSEQ and BALT. An interesting property of the Measure MIN is the sensitivity against nested structures and that the Measure MIN is an Extensive Structure to the binary operation BALT. It is a disadvantage of the Measure MIN that it is not extendable to flowgraphs of the type G. The consequence of that limitation is a very limited use of the Measure MIN.

265

8 Measures Based on the Decomposition in Primes

8.15 Measures Based on the Prime Decomposition of Flowgraphs We present measures which are based on the decomposition of flowgraphs in primes. A prime decomposition of a program is obtained by repeatedly identifying all its prime subprograms and replacing each with a function node, until a single function node remains. In our investigation the decomposition in primes as defined by the FentonWhitty scheme /ALVE88/ is used. The measures based on primes and which we treat are: 1.

The Measures of the Project "Structured-Based (SBSM) /ALVE88/ (See Section 8.15.3):



2. 3. 4. 5. 6.

Software

Measurement"

Measure Volume (SBSM-V). Measure Number of Primes (SBSM-P). Highest Number of Selection Nodes in a Prime (SBSM-S). Number of Levels of Nesting (SBSM-N). The VINAP Measures (VINAP-PD and VINAP-SUM).

The Measure NTC of Prather (Section 8.15.2). The Measures PRATH-E and LAMBDA of Fenton and Kaposi (Section 8.15.5). The Measures BAND, N-BAND, etc. of Belady (Section 8.15.9). The Measure PREISER of Preiser and Storm (Section 8.15.6). The Measures DTOT, DAVE and DMAX of Dunsmore and Gannon (Section 8.15.1). The Measures BLA-H, BLA-W and BLA-WR of Blaschek (Section 8.15.8). The Measures EJ-ISC and EJ-DSC of Ejiogu (Section 8.15.7).

7. 8.

Some examples of primes are presented to give an introduction to the decomposition into primes of flowgraphs. More precisely definitions can be found in Section 5. Primes are 1-entry subflowgraphs of a flowgraph keeping the in- and outdegree of the decision nodes. P1 primes are trivial primes consisting of an edge and two nodes. The start-node s' of a trivial prime can be only a procedure node or a receiving node, but not a decision node. We give an example. A: P4 N: P4 R: Author C: Example SU: FLOWGRAPH: P4 1 5 PRIME-DECOMP.-TREE+P1 V 7 2 EX) : EX PI E #P

. \

15 - / v/ 16 t

3

ROOT--NODE :

10\ . v / 12\

+

+-

. 7 v / '8/

1 2 3 4 5 6 7 8 9 10 11

9 6 9 15 12 14 16 2 8 14 15

3 4 6 9 10 12 2 1 4 10 3

NP (P)



PI P2 P2 P2

1D|

L

|N|

9 6 8 15 12 14 16

2 3 3 2 3 3 1

1 1 1 1 1 1 1

3 1 2 4 1 2 7

8 1 2 9 8 4 10 10 14 11 3 15 MAX_PRIME_NEST:

1 3 3 2

0 0 0 0

1 0 0 0

3

COMPLEXITIES OF THE PRIMES P:

pp

KD

1 1 1

PI P2 P2 P2

NODES(P) 3 4 5 6 7 8 9 4 5 6 6 7 8 9 10 11 12 13 14 15 10 11 12 12 13 14 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 4 6 10 12 3 9

C(P)

3 4

4.00

2.00 2.00

6

9 10 12

4.00 2.00 2.00 8.00 1.00

2

1

RESULTS OF THE MEASURE(S) INA

Figure 8.159: Seven intermediate nested alternative constructs. The complexity is NTCW(INA)=33.

289

8 Measure of Prather

The next example compares the flowgraph INA consisting of seven intermediate nested alternative constructs with the flowgraph INI consisting of seven intermediate nested iterative constructs. A: INI N: INI R: HOWA86 C: 7 int. n. Itéra. SU:

1 2. .

FLOWGRAPH: INI PRIME-DECOMP.-TREE+P1

45 v 67

— +

+ 7

+ 1

y

+

3

9

+ 5

•NODE :

9
o
5o
=> =>

H(P1) H(P1) H(P1) JI(P1) H(P1)

> > > = =

H(P2) H(P2) H(P2) H(P2) H(P2)

Explanation of the Atomic Modifications: The Measure SCOPE is completely described by the partial properties to the defined atomic modifications. •

It is easy to see that the atomic modification M1 increases always the complexity of a flowgraph (The part |N| of Definition 8.138).

8 Characterization of the Properties of Measures

426

The atomic modification MEDG increases or remains the complexity unchanged. The part |Pred(n)| of Definition 8.138 shows, that the complexity increases if a node n is predicated by an additional predicate (See the example below). The atomic modification INLV increases always the complexity of the flowgraph. The atomic modification PNH describes the transfer of an edge and a node (Keeping the complexity of the flowgraph) which is contained in a Range(p) to the exit-node t of the flowgraph. The atomic modification PHH describes the cancellation of a Range(p) and the adding of edges and nodes at the exit-node t to keep the same complexity.

Example for the Atomic Modification MEDG: A: PI N: PI R: Author C: Example SU: S

A: P7 N: P7 R: Author C: 2-IFTHEL+U SU: U

1 s

A: CASE-2 N: CASE-2 R: Author C: Example SU: S

A: CASE-3A N: CASE-3A R: Author C: Example SU: S

1 s

1 s

2 ...3... v 4

v 5

:.>665io P2 SCOPE(P1) > SCOPE(P2). The user can use the Measure SCOPE of Harrison and Magel as an ordinal scale if he accepts the partial properties of the measure. Measure N-SCOPE In order to give necessary and sufficient criteria for the use of the Measure N-SCOPE of Harrison and Magel the property is described by atomic modifications in the flowgraph. Definition 8.145 (Measure N-SCOPE: Partial Properties to the Atomic Modifications): For the Measure N-SCOPE of Harrison and Magel the four atomic modifications are defined: M1

*

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

MEDG

>

To add an edge at an arbitrary location in the flowgraph.

INLV

>

Measures SCOPE and PEN: To increase the nesting level NHM(x) of a node x which is a member of Range(d), in the flowgraph. Nesting level of a node x is: NHM(x)=Pred(x)+1 for the Measure SCOPE and NHM(x)=Pred(x) for the Measure PEN: Pred(n) is the set of decision nodes that predicate node n.

M5

*

To transfer an edge from one location in the flowgraph to another location in the flowgraph.

Explanation of the Atomic Modifications: The Measure N-SCOPE is only partially described by the defined atomic modifications. •

The partial property to the atomic modification M1 of the Measure SCOPE to Measure N-SCOPE changes from > to \

429

8 Measures of Harrison and Magel

The atomic modification INLV increases always the complexity because the quotient of |N|/SCOPE decreases. One consequence among others of the normalization of the Measure S C O P E to the Measure N-SCOPE is the change of the partial properties between the Measures S C O P E and N-SCOPE. 8.17.2.6 Extensive Structure and Ratio Scale We give conditions whether the Measures of Harrison and Magel can be used as a ratio scale. We have to show that the Measures of Harrison and Magel are Extensive Structures to the binary operations BSEQ and BALT. Firstly, we consider the Measure SCOPE. Measure SCOPE Considering the binary operations BSEQ and BALT it holds: Binary Operation BSEQ: The adding function of the Measure SCOPE of Harrison and Magel is: SCOPE (P1 o P2) = SCOPE(P1) + SCOPE(P2). That means that the Measure SCOPE of Harrison and Magel is an Extensive Structure and can be used as a ratio scale. Binary Operation BALT: We consider the axiom of associativity and give an example that the Measure SCOPE of Harrison and Magel does not have the property of the axiom of associativity. A: AS1 N: Associativity for BALT R: Author C: Axiom of Associativity SU:

A: AS2 N: Associativity for BALT R: Author C: Axiom of Associativity SU:

8

..1 V

V

11 12



V 4

V

7

13

V

8

!. .>5

V

V

7

V

3

V

...6..

V

. .2.

;

V

.

V

8

. V

...>14

.>4

>Ì5

;

>913

PI

P2

V o

V o

V 014

V

V o

.o . . V

. >o >o

V

>15

t

. . ->5< t

(PloP2)oP3

Pio(P2oP3) MEASURE BASED ON THE RANGES IN G RESULTS OF THE MEASURE(S) SCOPE N-SCOPE

SCOPE N-SCOPE

39.000 0.615

41.000 0.634

Figure 8.299: This example shows that the Measures S C O P E and N-SCOPE of Harrison and Magel do not have the property of the axiom of associativity.

The Measure S C O P E of Harrison and Magel is not an Extensive Structure to the binary operation BALT.

8 Characterization of the Properties of Measures

430 Measure N-SCOPE

We consider the two binary operations BSEQ and BALT. Binary Operation BSEQ: The Measure N-SCOPE is not additive because there is an interaction by N between P1 and P2. Let us consider the axiom of monotonicity.

A: GSEQ10 N: GSEQ10 R: Author C: Sequence SU: 1

V

A: GSEQ5 N: GSEQ5 R: Author C: Sequence SU : D

s

1

A: P2 N : P2 R: Author C: Example SU : S 1

s

V

2

2

V

3

2

3

V 4 V

V 4 V

5

V

. .3. .

5 t

V

6

V

V 6

V

7

s

V

V

. .4..

V

5 . >79=


To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

MEDG >=

To add an edge at an arbitrary location in the flowgraph.

431

8 Measures of Harrison and Magel

PNH

=

Measure SCOPE: To cancel a node x in a range and to add |PRED(x)I nodes at the node t.

PHH

-

Measure SCOPE: To replace a Range(p) by a procedure node and to add SNR(p) + pred (GLB (p)) +1 nodes at trie node t. SNR(p): Sum of the nesting levels of a Range(p).

INLV >

C

Y

Measures SCOPE and PEN: To increase the nesting level NHM(x) of a node x which is a member of Range(d), in the flowgraph. Nesting level of a node x is: NHM(x) =Pred (x)+1 for the Measure SCOPE and NHM(x)=Pred(x) for the Measure PEN: Pred{n) is the set of decision nodes that predicate node n. Remarks: Y: Measure is completely described; N: Measure is not completely described.

Measure: SCOPE Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y Y Y

N

Binary Operation BSEQ: Binary Operation BALT:

Extensive Structure/Ratio Scale

Figure 8.301: The partial properties of the Measure SCOPE and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT.

Measure N-SCOPE: Measure: N-SCOPE Partial Properties of the Measure to Atomic Modifications (AM) AM >=< Ml * MEDG >=

Description of the Atomic Modification To add a node and an edge (Statement) at an arbitrary location in the flowgraph. To add an edge at an arbitrary location in the flowgraph.

INLV >

Measures SCOPE and PEN: To increase the nesting level NHM(x) of a node x which is a member of Range(d), in the flowgraph. Nesting level of a node x i: NHM(x)=Pred(x)+1 for the Measure SCOPE and NHM(x)=Pred(x) for the Measure PEN: Pred(n) is the set of decision nodes that predicate node n.

C

Remarks: Y: Measure is completely described; N: Measure is not completely described.

N

Measure: N-SCOPE Axioms of Extensive Structure Binary Operations Axiom

BSEQ

BALT

Axiom of associativity Axiom of commutativity Axiom of monotonicity Archimedian Axiom

Y Y N

N

Binary Operation BSEQ: Binary Operation BALT:

Figure 8.302: The partial properties of the Measure N-SCOPE and the list of the axioms of the Extensive Structure to the binary operations BSEQ and BALT. The Measures SCOPE and N-SCOPE are sensitive against the nesting level of nodes in structured and unstructured flowgraphs. The Measures SCOPE and N-SCOPE are important extensions of the Measures of Dunsmore and Gannon (Section 8.15.1) and the Measures of Belady (Section 8.15.9). Interesting are the different properties of the Measures SCOPE and N-SCOPE. The partial properties of the measures and the properties to the Extensive Structure are differently. The Measure SCOPE can be used as a ratio scale for the binary operation BSEQ, if one accepts the partial properties of the measure and the binary operation BSEQ. The Measure N-SCOPE cannot be used as a ratio scale.

432

8 Characterization of the Properties of Measures

A disadvantage of the Measure SCOPE is the sensitivity against adding nodes outside of ranges. It can not be distinguished whether the complexity increases by adding a node or increasing the nesting level of a node. Howatt and Baker removed this disadvantage by proposing the Measure PEN. Another disadvantage of the Measures SCOPE and N-SCOPE is, that they do not distinguish structured and unstructured flowgraphs. So, it makes more sense to use the Measure SCOPE in connection with the Measure PIWO of Piwowarski. In order to measure size, nesting and unstructuredness of programs, we would recommend the following measures: (LOC, SCOPE, PEN, NL, MCC-D, UN and PIWO).

8 Measures of Howatt and Baker

433

8.17.3 Measures of Howatt and Baker Names of the Measures: Measures PEN and NL of Howatt and Baker. Author of the Measure: Howatt and Baker. Published in: /HOWA85/, /HOWA85a/, /HOWA86/ /HOWA89/. Definitions of the Measures In 1985/86 Howatt and Baker discussed the Measure SCOPE of Harrison and Magel which is sensitive against nested constructs in structured and unstructured flowgraphs. Additionally they considered the Measures ND and AVG of Dunsmore and Gannon /DUNS79/, which were only defined for structured flowgraphs. Howatt and Baker developed a solid mathematical foundation for the definition of the Measure SCOPE of Harrison and Magel. They derived from the approach of Harrison and Magel four new measures to measure the nesting depth and the loop-predicates (loop-effect) of programs. The discussed measures by Howatt and Baker are: SCOPE ND AVG PIWO Z

Measure SCOPE of Harrison and Magel /HARR81/, /HARR81a/, and /HARR82/. Nesting Depth of Dunsmore and Gannon /DUNS79/. Average Nesting Depth of Dunsmore and Gannon /DUNS79/. Measure of Piwowarski /PIW082/. Measure of Chen /CHEN78/.

The Measure SCOPE is sensitive against nested structures in structured and unstructured flowgraphs. The Measure ND is a nesting level measure proposed by Dunsmore and Gannon. The Measure AVG was proposed by Dunsmore and Gannon and captures the average nesting level of nodes in structured flowgraphs. The Measure PIWO is a modification of the Measure SCOPE by Piwowarski and captures unstructuredness in flowgraphs. The Measure Z is the Measure of Chen (See Section 8.14). The new proposed measures by Howatt and Baker are: PEN NL UNST UNSTR

Predicated Execution Number. Number of Loops. For unstructuredness of flowgraphs (See Section 8.18.3). For unstructuredness of flowgraphs (See Section 8.18.3).

The Measure PEN is similar to the Measure SCOPE of Harrison and Magel. The difference is the raw complexity of the nodes. Harrison and Magel defined a raw complexity of 1 and Howatt and Baker a raw complexity 0 for a node. The Measure NL is also based on the concept of ranges and captures the loops in structured and unstructured flowgraphs. The Measures UNSTR and UNST measure partial unstructuredness in flowgraphs. In order to define the Measures of Howatt and Baker some more definitions are necessary. Definition 8.146 (Pred (x)) Let p a decision node and Range(p) the range of the decision node p. The set of decision nodes that predicate a node xe N is Pred(x)= {p|xe Range(p)} •

434

8 Characterization of the Properties of Measures

Definition 8.147 (Nesting Depth nd(x)) The nesting depth nd(x) of a node xe N is defined: nd(x)=|Pred(x)| • From the definition above we get the Measure ND, which was used by Dunsmore and Gannon to define the Measure AVG. Measure ND Definition 8.148 (Total Nesting Depth ND(G)): For flowgraph: Gd' The total nesting depth of a flowgraph is defined as: ND(G) = I n e N nd(n) • The Measure ND is here defined for unstructured flowgraphs. The original definition of the Measure ND by Dunsmore and Gannon /DUNS79/ was only defined for structured flowgraphs. Remarks: Howatt and Baker build the sum of the nodes ne N' for N'=N-{s,t}. We do not follow this definition. The reason for that is that other authors do not pay attention to the nodes N' and do not distinguish between the nodes ne N, the start-node s and the exit-node t. Measure AVG Definition 8.149 (Average Nesting Depth AVG(G)): For flowgraph: Gd' The Average Nesting Depth AVG(G) is defined as: AVG(G) = ND(G)/|N| • The original definition of the Measure AVG by Dunsmore and Gannon was only defined for structured flowgraphs. Measure PEN Definition 8.150 (Measure Predicated Execution Number (PEN)): For flowgraph: G For a flowgraph G the Measure PEN is defined: PEN(G) = I ^ J P r e d W I •

8 Measures of Howatt and Baker

435

Measure SCOPE Howatt and Baker presented a definition of the Measure SCOPE of Harrison and Magel /HARR81/ using the definitions above: Definition 8.151 (Measure SCOPE of Harrison and Magel): For flowgraph: G Using the definition of the Measure PEN the Measure SCOPE can be defined: SCOPE(G) = PEN(G) + |N| • The difference between the Measures PEN and SCOPE is the raw complexity of the nodes. For the Measure SCOPE the raw complexity of a node is 1 and for the Measure PEN the raw complexity is 0. Measure Z The Measure Z is discussed in connection with the Measure MIN of Chen (See Section 8.14).

Measure NL The Measure NL is sensitive to loops in structured and unstructured flowgraphs. Definition 8.152 (Measure Number of Loops (NL)): For flowgraph: G The number of nodes predicating loops in which node x falls, NL(x) is given by: NL(x)= |{p|pe Range(p) A x e Range(p) A3P[P=FOP(X,P) APC Range(p)]}| The total number of nodes predicating loops of G is: NL(G) = I feN |NL(i)| • The Measure NL is the one measure found in the literature, which captures the loop-effect in structured and especially unstructured flowgraphs. Howatt and Baker argued that the type of predicates has to be distinguished. A simple counting of nodes predicates does not provide a total characterization of the predicatore. As further evidence that this differentiation is necessary, consider program proof techniques. The proof of correctness for alternative and iterative constructs differs greatly. To determine a loop invariant is often much more difficult than developing the weakest preconditions for an IF or CASE statement. Measure SCOPE-NL The Measure SCOPE-NL is also introduced by the author. The reason for that is that the Measure NL does not measure the number of loop-predicates in the flowgraph. Definition 8.153 (Measure SCOPE-NL): For flowgraph: G SCOPE-NL(G)= |DI| with

8 Characterization of the Properties of Measures

436 |DI|

Number of loop-predicates in the flowgraph.

A decision node is a loop-predicate if holds: If {x,p|pe Range(p) de Range(p). •

A

x e Range(p)

A3P[P=FOP(X,P) APC

Range(p)] is true for all

The Measure SCOPE-NL counts the number of loop-predicates in a flowgraph as defined for the Measure NL. 8.17.3.1 Remarks by Howatt and Baker Howatt and Baker point out: "Our principle intent.... is to provide a clear and unambiguous definition of nesting in arbitrary programs (flowgraphs) and to develop one analytical tool for evaluating measures of nesting. We do so because Nesting has, in the last few years, received attention as an aspect of programs which contributes to program complexity but which has not been adequately quantified by the previous, more widely used, measures, e.g. Halstead EFFORT /HALS77/ and McCabe /MCCA76/ cyclomatic complexity. •

We want to encourage others working in software measures to adopt a more analytical approach to this type of research.

The defined vector of measures overcome one deficiency of earlier program complexity measures. Measures of software properties should not be combined into a single-valued measure. One number cannot convey the information that a set of individual measures can; information is lost. We therefore propose that individual measures be made components of a vector of measures. This will provide complete information on each of the individual properties. " We use the definitions of scope, Pred set and nesting depth to carefully define four measures that have appeared in literature. Dunsmore and Gannon /DUNS79/ proposed using the average nesting depth of nodes in a flowgraph G. AVG(g), as a measure of control flow complexity. Working with only structured flowgraph Gs, they defined the nesting depth of a node in the recursive manner used by some compilers in annotating source listings with the nesting depth of statements. An unnested node lies on the nesting level zero. If a predicate node P lies at nesting depth i, then a node is immediatly contained in the Scope(p) lies at nesting depth i+1. (A node n is immediately contained in the scope of a predicate node p if there is no other predicate q that is in the scope of P and that contains n in its scope". 8.17.3.2 Comments by the Author The Measures of Howatt and Baker are well defined. The Measure ND is only defined for structured flowgraphs. For structured flowgraphs the Measures ND and PEN are identical. For our further considerations we discuss only the Measure PEN. The Measures PEN, NL, UNST and UNSTR are modifications and extensions of the Measure SCOPE of Harrison and Magel. Especially the definition of the Measure NL is very interesting and helpful because in the literature exact definition of measures are missing which measure the loop-effect in flowgraphs. One exception is the Measure LC of Hecht, but this measure is only sensitive against the maximal loop-connectness and it is not defined for non-reducible flowgraphs in intervals.

437

8 Measures of Howatt and Baker

W e agree to the statement of Howatt and Baker, that measures of software properties should not be combined into a single-valued measure. The consequence would be in terms of partial properties, that to many partial properties to atomic modifications are necessary to describe the property s of the measure.

8.17.3.3 Examples for the Measures SCOPE, PEN and AVG W e present several examples to explain the Measures PEN and NL of Howatt and Baker. The Measure NL is explained especially in Section 8.17.3.4. Before we discuss the examples the list of the used measures in the examples is presented. That makes it easier to compare the behaviour of the Measures PEN and NL with other measures. MEASURE 1 UNSTRUCT LOC 3 DEC 4 PRIMES 5 H-RED 6 MCC-V 7 MCC-V2 8 MCC-D 9 MCC-EV 10 11 12 13 14 15

OVERVIEW ABOUT MEASURES: T S REF SECTION

AUTHOR

MCC-EVO SCOPE SCOPE-MN SCOPE-D N-SCOPE PEN

COMMENT TO THE MEASURE

Zuse, H. Several authors Zuse, H. Zuse, H. Hecht, M. McCabe, T. McCabe, T. McCabe, T. McCabe, T.

B B B P I B B B U

Author CONT86 Author Author HECH77 MCCA76 MCCA76 MCCA76 MCCA76

8 8.3 8 7,8.15. 8.11 8.4 8.4 8.4 8.4

UNSTRUCT=1 then unstructured else 0 Lines of Code Number of decision nodes Number of primes in F Reducible=u, not reducible=-l. MCC-V=|E I - IN| + 2p, p-1 MCC-V2=I E[- IN I + 1 MCC—D=ID|+1 Essential Compi.: MCC-EV=MCC-D - |MI+

McCabe, T. Harrison; Magel Zuse, H. Zuse, H. Harrison; Magel Howatt, Baker

U NR NR NR NR NR

MCCA76 HARR82 Author Author HARR82 HOWA85

8 8 8 8 8 8

Essential Compi.: MCC-EVO»IDI-IMI Sensitive against nesting Maximal nesting level of n Decision node a in Range(d). Normalized SCOPE-Measure: 1-N/SCOPE Predicate Execution Number

4 17.2 17.2 17.2 17.2 17.3

Figure 8.303: The list of measure which are used to explain and compare the complexities of the flowgraphs in the examples. The first example shows a simple structured flowgraph P1. At the right side the column of the nesting level of the nodes is shown. It is: NDSC(n) PRED(n) PEN. PREDL(n)

Nesting level of the nodes of the Measure SCOPE. Nesting level of nodes as defined in Definition 8.154 for the Measure Nesting level of nodes predicated by loop-predicates.

The columns NDSC, PRED and PREDL show the different nesting levels of nodes in a flowgraph. The next example shows flowgraph PRATH1A consisting of three sequential do-whileloops. A: N: R: C: SU

PRATH1A PRATH1A PRAT84 pp. 341, left S s

1

V

• >2 V

3

GRAPH : PRATH1A N NDSC(N)

V

.. 4 •>582

v 3.. v 4 v • >5

GRAPH: PRATH1B N NDSC(N)

3 4 5 6

7 8 9

8

9 10 11

11

RANGES OF GRAPH: PRATH1B I D GLB(D) L Ï Y Y

3 4 5 e

7

9

11 2 5

2

2

10

3 e 9

1

1

1

2 3 4 5 e i 8

1 2 3

GRAPH: PRATH1B N PREDL

GRAPH: PRATH1B N PRED(N)

10 11

ETR 1-ETR 2 3 4

2 5 8

Y Y Y

RANGE(D) 2 3 4 5 6 7 8 9 5 6 7 8 9 10 8 9 10

10

MEASURES BASED ON RANGES : RESULTS OF THE MEASURE(S) UNSTR LOC EDGES DEC PRIMES MCC-V MCC-EV

UNSTR LOC EDGES DEC PRIMES MCC-V MCC-EV

PRATH1B

PRATH1A

0.000 11.000 13.000 3.000 3.000 4.000 1.000

0.000 11.000 13.000 3.000 3.000 4.000 1.000

439

8 Measures of Howatt and Baker SCOPE-D SCOPE-NL SCOPE N-SCOPE PEN AVG NL H-RED N-LOOPS LC

SCOPE-D SCOPE-NL SCOPE N-SCOPE PEN AVG NL H-RED N-LOOPS LC

3.000 3.000 29.000 0.621 18.000 2.091 18.000

3.000 3.000 20.000 0.450 9.000 1.273 9.000

3.000 3.000

3.000 1.000

0.000

0.000

Figure 8.305: Calculation of the complexities of the Measures SCOPE, PEN, AVG and NL among others for the flowgraph PRAT1B. It is Pred(9)=3, and the decision node 9 is a member of Range(9). This example shows, that the entry-node of a range, where the decision node is a member of the range, is not identical to the decision node. For example, Range(3) has entry-node 2 and the GLB(3)=11. The nesting level is: PRED(3)=1 and Range(3) is an 1-entry range. 1-entry ranges are important for loops. One prerequisite for a loop is that the entry-node dominates all nodes in the loop-body (See the Measure NL). The next example shows flowgraph LM1 consisting of many single and nested loops. A: LM1 N: LM1 R: MCCA76 C: P.213, left. SU:

GRAPH : LM1 N NDSC(N) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

v2

V

V

V

V

V

V

3

3

5

V

..,44

4

1 s

. . .>2

V

LCI LCI Author Example U 2

V

....>2

V

. . ->3

A: N: R: C: SU

V

6 t

5 6

7 t

7 t V

8 t

8 s >9 v

10

.11 V

12

v 13 v 14 t MEASURES BASED ON RANGES: RESULTS OF THE MEASURE(S) UNSTRUCT LOC EDGES DEC PRIMES MCC-V MCC-EV SCOPE-D SCOPE-NL SCOPE N-SCOPE PEN AVG NL H-RED N-LOOPS LC

SE3

SE 4

SE4N

SE5

SE5A

LCI

0 .00 10 .00 11 .00 2 .00 2 .00 3 .00 1 .00 2 .00 2 .00 20 .00 0 .50 10 .00 1 .60 10 .00 0 .00 2 .00 1 .00

0..00 8..00 9 .00 2 .00 2 .00 3 .00 1 .00 2 .00 2 .00 14 .00 0 .43 6 .00 1 .25 6 .00 0 .00 2 .00 1 .00

1..00 8..00 9,.00 2..00 1..00 3..00 2..00 2..00 2..00 19..00 0..58 11..00 1 .88 11 .00 0 .00 2..00 2 .00

1 .00 7 .00 8 .00 2 .00 1 .00 3 .00 2 .00 2 .00 2 .00 15 .00 0 .53 8 .00 1 .57 8 .00 0 .00 2 .00 2 .00

1..00 , 14 .00 17..00 4..00 2,.00 5,.00 3,.00 4..00 4..00 30,.00 0..53 16..00 1..57 16 .00 0 .00 4..00 2..00

1,.00 6..00 8..00 3 .00 2 .00 4 .00 2 .00 2 .00 2 .00 12 .00 0 .50 6 .00 1 .33 4 .00 0 .00 -1 .00 -1 .00

Figure 8.310: Several examples to demonstrate the properties of measures which capture any kind of loops in a flowgraph. Flowgraph SE5A is the result of the binary operation BSEQ: SE5A=SE5oSE5.

444

8 Characterization of the Properties of Measures

In the next examples the four conditions of the Measure NL are explicitly explained by simple flowgraphs. The first example is the flowgraph P4. A: P4 N: P4 R: Author C: Example SU: 1 s DOMINANCE TREE 1 + 2 .6. .

+ 4

v

+ 5

.7. .

+

+ 6

+

+

+

.10. v 11. . V

12 t RANGES OF GRAPH: P4 t D GLB(D) 3 7 11

ETR 1-ETR

e 10 12

RANGE(D) 4 5 8 9 2 3 4 5

Dominator(s) of a Range(d) :

t

#RANGE D ETR MAX 1—DOM DOMINATOR(S) OF RANGE(D)

Current number Current number of the range Decision node of the range Entry node of the Range(a) Maximal entry node: If there are more than one node which dominates the nodes of Range(d) then the maximal dominator is selected Y: All nodes of the Range(d) has one dominator Dominators of the nodes of the Range(d)

DOMINATOR OF THE RANGE(D): # »RANGE D ETR 3 7 11

MAX 1-DOM?

DOMINATOR(S) OF RANGE(D)

3 Y 7 Y 1 Y RESULTS OF THE MEASURE(S) P4

UNSTRUCT LOC MCC-V SCOPE SCOPE-D SCOPE-NL SCOPE-MN PEN NL

0.000 12.000 4.000

26.000

1.000 1.000 3.000 14.000 10.000

Figure 8.311: Flowgraph P4, the list of ranges of P4 and the dominators of the ranges of flowgraph P4. In flowgraph P4 exists a loop from the nodes (11,2). The ranges Range(3) and Range(7) are nested in the Range(11) which decision node is a loop-predicate. Decision node 11 is a member of its own range Range(11). The entry-node of Range(11) is node 2 (See also Measure UNST of Howatt and Baker). Every node of Range(11) is dominated by the node 2. Column 1-DOM is for each range nyn

445

8 Measures of Howatt and Baker

The next list shows the calculation of the Measure NL for the flowgraph P4 in detail. For each node x the results of the four conditions of the Measure NL are given. "Y" means that the condition is fulfilled and a blank means that the condition is not fulfilled. Every condition of the four conditions have to be fulfilled therewith a node x is predicated by a loop-predicate. A: P4 N: P4 R: Author C: Example SU: I s v 2< v

. . .3. ..

v 4

v 5

!..6.. !

!

V

. . .7.. . V

V

9

8

i..io. i V II

;

V

12 t CNR

X

D

1 2 3 4 5

1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 11 11 11 12 12 12

3 7 11 3 7 11

e

7

e 9

10 11 12 13 14 15 16 17 18 19

20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

7 11 3 7 11 3 7 11 7 11 3 7 11

XcR(D)

DcR (D) Y

Y

Y

Y Y

Y

Y Y

Y

Y

Y

Y

Y

Y

Y

7 11

Y Y

Y

7 11

Y Y

Y

Y

Y

Y

Y

7 11 3 7 11 3 7 11

Y

P=FOP(X,D) Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

PcR(D)

NL(X) NL(G)

Y

1

Y

1

Y

1

Y

1

Y

1

Y

1

Y

1

Y

1

Y

1

Y Y Y Y

1

1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9

9 9 10 10 10 10

Figure 8.312: Flowgraph P4 consists of a loop with (11,2). The complexity of the Measure NL(P4)=10. That means that 10 nodes of flowgraph P4 are predicated by a loop-predicate. In the case of flowgraph P4 is the loop-predicate the decision node 11. The loop-predicate 11 predicates each of the 10 nodes of Range(11). The complexity of PEN(P4)=14, because there are the nodes 4, 5, 8 and 9 additionally predicated by the decision nodes 3 and 5.

446

8 Characterization of the Properties of Measures

The next example shows flowgraph P6. Flowgraph P6 is unstructured and consists of the overlapping Range(7) with an alternative predicate and Range(11) with a loop-predicate. A: P6 N: P6 R: Author C: Example SU: U

DOMINANCE TREE

. >610
3. . v 4

To add an edge at an arbitrary location in the flowgraph.

INLV

>

Measures SCOPE and PEN: To increase the nesting level NHM(x) of a node x which is a member of Range(d), in the flowgraph. Nesting level of a node x is: NHM(x)=Pred(x)+1 for the Measure SCOPE and NHM(x)=Pred(x) for the Measure PEN: Pred(n) is the set of decision nodes that predicate node n.

PN

=

Measure PEN: To cancel an edge and a node (statement) in Range(p) and to add |PRED(x)| IFTH-Structures at the node t in the flowgraph.

PH

=

Measure PEN: To replace a Range(p) by a procedure node and to add SNRP(p) + pred(GLB(p)) if-then-structures at the node t. SNRP(p): Sum of the nesting levels of the nodes of Range(p).

Because of the following implications we see, that the partial properties to the atomic modifications M1, MEDG, INLV, PN and PH describe the property of the Measure PEN (PEN is abbreviated by jo.): P1 P1 P1 P1 P1

M1 *~MEDG #>

INLV

•=PN •=PH

P2 P2 P2 P2 P2

=> =>

H(P1) H(P1)

=>

n( P1)

=>

H(P1) H(P1)

=>

> > > =

=

H(P2) H(P2) H(P2) H(P2) H(P2)

8 Measures of Howatt and Baker

451

Explanation of the Atomic Modifications: The Measure P E N is completely described by the partial properties to the defined atomic modifications. The partial properties of the Measure P E N are very similar to the Measure S C O P E . The atomic modification M1 increases the complexity if a node and an edge are added in a Range(p). To add an edge and a node outside of ranges does not change the complexity. That is differently to the Measure S C O P E . The atomic modification MEDG increases or remains the complexity unchanged (See the example of the atomic modification MEDG of the Measure SCOPE). The atomic modification PN is a little bit more complicated. If a node and an edge in a Range(p) is deleted, then are to add |pred(x)| lf-then-structures at the node t in order to keep the same complexity as before. An if-then-structure increases the complexity always by 1. The atomic modification PH is necessary to delete ranges and to get a sequence of if-then-structures.



Example for the Atomic Modifications PN and PH: A: PIE N: PIE R: Author C: Example SU: s

A: PWSE M : PWSE R: Author C: Example SU:

1 s

.1.

2 . . .3... V

V

3

. . .4.

V

13

.5.

V

. . .7... V

V

9

8

V

V

V

12

V V

6

7

>8
7
= >=

«

*

s

< *

=

BH

C

> >

N N Y N N N

s

> NUMBER OF MEASURES:

PI

PMAX

PAPS

PAE

PINS

>=

>

>

>

N2

N3

PADD

PNST

> *

> *

NUMBER OF MEASURES:

C Y N N

3

Figure 9.9: The partial properties of the Measures of Belady.

It is a disadvantage of the measures above that they are not extensible to unstructured flowgraphs. The Measure BAND-CYC has unclear properties. 9.2.9 Partial Properties of the Measures of Schmidt and Gong The Measure C S G of Schmidt and Gong /SCHM85/ and some extensions of this measure by Roth (Measure CR) and Zuse (Measures CD and CN), which are based on the dominance tree of a flowgraph, are presented. # 1 2 3 4

OVERVIEW ABOUT MEASURES: T S REF SECTION

MEASURE

AUTHOR

CSG CR CD CN

Schmidt; Gong Roth Zuse, H. Zuse, H.

D D D D

SCHM85 ROTHS7 Author Author

8.16 8.16 6.16 8.16

COMMENT TO THE MEASURE Dominance and postdominance Modified Measure CSG Modified Measure CSG Modified Measure CSG

SUMMARY OF THE PROPERTY OF MEASURES: TN

Measures CD,CN (Dominance tree Td): To add a branch Bn at an arbitrary location in the dominance tree T. Bn: A branch from node nl to n2, but from n2 exists no path to the exit node t.

TD

Measures CD,CN (Dominance tree Td): To add a branch Bd at an arbitrary location in the dominance tree T. Bd: A branch from node d to n, but from n exists no path to the exit node t.

TDT

Measures CD,CN (Dominance tree Td): To add a branch Bdt at an arbitrary location in the dominance tree T under the condition that no branch Bdt is changed to Bd. Bdt: A branch from node d to n, but from n exists a path to the exit node t.

TNT

Measures CD,CN (Dominance tree Td): To add a branch Bnt at an arbitrary location in the dominance tree T. Bnt: A branch from node nl to n2, but from n2 exists a path to the exit node t.

TCBD Measures CD,CN (Dominance tree Td): Dominance tree T: To change a branch Bdnn at an arbitrary location in T to a branch Bd. Ml

To add a node and an edge (Statement) at an arbitrary location in the flowgraph.

M5

To transfer an edge from one location in the flowgraph to another location in the flowgraph.

MEDG To add an edge at an arbitrary location in the flowgraph. BF

To change a backward edge to a forward edge in a flowgraph. Backward edge: Let G=(N,E,s,t) be an RFG (Reducible Flowgraph). Edge (x,y) is backward if and only if y dominates x.

520

9 Results and Research in the Future

RNST To nest two arbitrary non-overlapping ranges Range(p) in Range(q) by replacing one node of Range(q) by Range(p). Ranges are defined by the conditions of Howatt and Baker. RNST To nest two arbitrary non-overlapping ranges Range(p) in Range(q) by replacing one node of Range(q) by Range(p). Ranges are defined by the conditions of Howatt and Baker. ROV

To create from two not overlapped Range(p) and Range(q) an overlapping range OVL(p,q)

C

Remarks: Y: Measure is completely described; N: Measure is not completely described. TN

CSG CR CD CN

>

METVPA:

TD

>

>

TDT

>

TNT

=

= =

TCBD

Ml

= =

= * > = * > = = = « =

NUMBER OF MEASURES:

M5

MEDG =

>

>

BF >

>

RNST =

=

>

>

RNST < < =

ROV

= = >

C N N


3

. .2

v . .3

3

. .2

1 s

1

v 4

v ..4

v 5

v . .5

v 5

v ->5

V . >7

v .>7

1 s v 2.. v >3. .

3

v 3

v • >4

6

A: LCI N: LCI R: Author C: Example SU: U

V • >2

v 4

V • >€

A: LC2 H: LC2 R: Author C: Example SU: U

A: SE4 N: SE4 R: Author C: Exmp. SU:

48 . . .

. .

V 13

. .

V 18 . . . . . . . . v v v->v v 9. .>15 16 19 20 . . . . . . . . >101721112212< t

15

RESULTS OF THE MEASURE(S) SA ALC BAND BLA-HA BLA-W CD CN CR DEC DTOT DTOTU EJ-E EJ-M ET KNOTS LAMBDA LOC MCC-D

7..000 23,.000 7..000 7,.000 0,.000 7..000 0..000 7,.000 7,.000 7..000 7..000 1..000 7..000 0..000 0..000 0..000 14 .000 16..000 8 .000

UP 5 10..000 -1..000 1,.000 1..000 9 .000 20 .000 0..900 10 .000 -1 .000 29 .000 1 .000 1 .000 1 .000 0 .000 0 .000 21 .000 11 .000 22 .000 11 .000

%

>

42.86

>

-85.71 -85.71 900.00 185.71 90.00 42.86

> > > >

T> Tit

TIT)

314.29 -85.71 0.00 -85.71 0.00 0.00 2100.00 -21.43 37.50 37.50

>

>

> >

9 Complexity to Reference Programs and Program Versions MCC-EVO MCC-V2 MWD-HB MWD-MH N-LOOPS NL NIC PATH PEN PIWO PRATH-E PREISER PRIMES REACH SBSM-P SBSM-SQF SCOPE SCOPE-D SCOPE-NL UN UO UOD UODD UOV VINAP-PD VINAP-SUM

0..000 7..000 7.,000 7..000 0..000 0..000 16..000 128..000 7,.000 8..000 14,.000 23,.000 7,.000 120,.000 7,.000 7,.000 23 .000 0,.000 0,.000 0 .000 0 .000 0..000 0 .000 0 .000 7 .000 7 .000

9..000 900.,00 10.,000 42.,86 10..000 42.,86 10.,000 42.,86 0.,000 0.,00 0..000 0..00 -1..000 ??????73? 11..000 -91.,41 69..000 885.,71 77..000 862.,50 11.,000 -21.,43 -1..000 ????????? 1..000 -85..71 112..000 -6..67 1..000 -85..71 1..000 -85..71 91..000 295..65 0..000 0..00 0..000 0..00 0,.000 0..00 14,.000 1400,.00 19..000 1900..00 0..000 0..00 3300,.00 33,.000 100,.000 1328,.57 10,.000 42,.86

559 > > > >

>

>

> >

> >

>

>

Figure 9.52: The complexities of the flowgraph SA (Reference program) to the flowgraph UP5 calculated by measures which are described as a ratio scale for BSEQ (only measure for structured and unstructured flowgraphs). The % is the percentage of more, less or equal complexity to the reference program SA. ??????? indicates that the percentage could not be calculated because the measure was only defined for structured flowgraphs. > shows if the complexity of the flowgraph UP5 is greater than the complexity of flowgraph SA. For example, the program UP5 is 295.65% more complex than the reference program SA measured with Measure SCOPE. A: PP10 N: PP10 R: Author C: Example SU: S

A: UP5 N: UP5 R: Author C: Example SU:

OS V . . .O . . . v v o o ..>oo8

V

13 . V 7

. . V v 9..>15

. V 14

V

. . . v->v 16 19

V 18 V 20

V . . , . o ... .>6< >101721 o < . . . . . . . v .. .o... ... ,>1K. .. >22o12< V t ... o... V

V

o o . .>oooooo •>•>•> 1 T> -90..00 1..000 1.,000 -90.,00 9.,000 900.,00 20.,000 0.,00 0.,900 90.,00 10..000 0..00 -1..000 ? ? ? ? ? ? ? ? ? 29..000 190..00 1..000 -90..00 0..00 1..000 -90..00 1..000 0..00 0..000 0..000 0..00 21..000 110..00 11..000 -45..00 22..000 -46.,34 11..000 0..00 900..00 9..000 10..000 0..00 0..00 10,.000 10,.000 0..00 0,.000 0..00 0..000 0..00 -1..000 ? ? ? ? ? ? ? ? ? 11,.000 -98..93 69..000 245..00 77..000 600..00 11,.000 -45,.00 -1..000 ? ? ? ? ? ? ? ? ? -90..00 1..000 112..000 -86,.17 1..000 -90,.00 -90,.00 1..000 91..000 49..18 0,.00 0,.000 0 .000 0,.00 0,.000 0,.00 14,.000 1400,.00 19,.000 1900,.00 0 .000 0 .00 33 .000 3300 .00 100 .000 900 .00 10 .000 0 .00

>

> > >

> >

> >

>

> > > >

Figure 9.53: The reference program PP10 consists of 10 if-then-else constructs. Flowgraph PP10 consists of the same number of decision nodes as flowgraph UP5.

The examples above show very clearly that it makes sense to define reference programs and to collect them in a database. It also shows, that it is easy to compare versions of programs. 9.8 Validation of a Measure For most managers and programmers the most important question is how to validate a measure or the validation of measures. That is indeed the most critical and difficult task we face. We want to consider some validation cases. 1.

For a software complexity measure is no validation necessary. The property of the measure is described by partial properties to the atomic modifications. The meaning of the numbers can be explained by the partial properties. That is similar to the question of the validation of a measure which measures the performance (in PS) of an engine. Nobody would require a validation of this measure. Such software measures are denoted structural measures. Another question is whether a selected software complexity measure is an appropriate measure for software complexity measurement. The problem is here not the software complexity measure Itself, but the empirical relation "equal or more complex". Here is the question, what is meaning of the term software complexity?

9 Validation of Measures 2.

561

The second case is the validation of a measure related to the number of errors in a program or the effort to maintain a program. In this case it is indeed necessary to validate the measure and to make carefully controlled experiments. But, to make well prepared experiments is not simple.

Bowles /BOWL83/ points out to the validation of measures: "A metric is validated when it can be shown to measure what we claim to measure. An ideal approach of metric validation is controlled experimentation. In case of complexity, this requires multiple versions of functionally equivalent modules or systems which differ only in their quantities of attributes included in the computation of the complexity metrics". The statement of Bowles "...what we claim... to measure" is the question how the empirical relation "equal or more complex" really looks like. Basili and Reiter /BASI81/ describe the pre-experimental preparations necessary to ensure that results may be generalized to a larger population. The problem for validation is the empirical relation and especially the meaning of the empirical relation. As Kriz /KRIZ88/ pointed out, the numerical results have no empirical meaning themselves. They have to be translated back into empirical statement. A measurement theoretic interpretation of measurement is: There exist three relational systems. 1. 2. 3.

The formal relational system. The relational system of the measure. The empirical relational system of a person.

But, another criterion is very important, that is the type of scale, which is connected with the software complexity measure. A measure is not per se an ordinal or a ratio scale. There consist conditions for the use of a measure as a certain scale. On the kind of scale which is connected with the measure depends the kind of the statistical operation. At this time the validation of software complexity measures related to errors in the program or the maintainability cannot be done with satisfaction. But it is important to notice that measurement in the area of software engineering is very important. Data of the measurement of the complexity of the software design, of the complexity of programs, the change of the complexity of program versions, etc. have to be collected in data bases for a evaluation in the future and to be interpreted with a well defined set of measures. Measurement is necessary because the human brain is not able to interpret the complexity always verbally with the same statements. The term "complexity" will have a different meaning today and in one year. Collecting data of the software life-cyle by measurement and the interpretation of the numerical values is important for the evaluation of the software life-cycle process. •Sped- . •fica. . tion .

. .Design .

. . .

. Code

M e a s u r e m e n t of Software

. . .

.Mainte.nance . .

Life-cycle

Figure 9.54: Every stage in a software life-cycle has to be measured and collected in databases.

562

9 Results and Research in the Future

Without collected data over years the evaluation of software quality and maintainability is impossible. We require the measurement of many attributes in the software life-cycle with well selected measures. Another question is if the empirical relation "equal or more complex" is really additive. We think, the requirement of additive measures for software complexity measurement is not well founded. 9.9 Correlation between Software Complexity Measures To determine correlations between measures and between existing measures (Intermetric correlations) is a well known approach. Correlations are used to validate measures. We want to discuss this more precisely and cite Fenton /FENT89a/: m

It is generally assumed that the well known existing measure is valid when a good correlation with such a measure means that the new measure must be also valid. It is relatively straight forward to perform this type of validation since the well known existing measures will generally be easy to compute. • n

Management need to be convinced that the proposed measures are not "pie in the sky" and the simplest way to do this is to demonstrate close correlation with existing measures known to the management.

We want do discuss this a little bit more in detail. A complete discussion of the problem of correlations between measures would be beyond the scope of this book. But, the discussion is important because very often experiments and correlations are done in the wrong way. Very often papers can be found in the literature where the correlations between software complexity measures are calculated. But, what does it mean if there are high correlations between software complexity measures or measures and errors? Can we replace one measure to the other measure? This question is important! Many measures are very difficult to implement, like the Measure NL. When there is a high correlation between an simple and difficult to implement software complexity measure, then the second one could be replaced by the simple to implement measure? We do not think sol Every measure has special partial properties. We need a hypotheses why there is a high correlation between measures. We do agree to Fenton /FENT89a/, who writes that in the software engineering area it has become accepted that a measure is valid if it correlates with any process data that can be extracted, i.e. bugs found, change made, maintenance costs, etc. The many claims made to the effect that measures like Halstead and McCabe have been validated are equally by studies which show that they correlate no better with the process data than the simple Measure LOC. A good example for that is the investigation by Hamer and Fredwin /HAMA82/ and Li and Cheung /LI87/. The question is here whether the Measures of Halstead and McCabe are really validated and the correlation between the measure and the errors of a program are really are causal. If there are high correlations then question is whether the correlations between the objects are causal. But, mostly the carrying out of experiments and the interpretation of the results is imperfect. Doing such kind of experiment it is necessary to have a hypotheses why there could be correlations between the measures. The collection of the programs for the experiment have to be selected very carefully. That is also true for the

9 Correlations between Measures

563

selection of the software complexity measures. It is not sufficient to calculate the correlations of only three software complexity measures (MCC-V, LOC and EFFORT) as done by Henry and Lewis /LEWI89/. W e want to recommend among others the book of Kriz /KRIZ88/, who describes very impressive how to do experiment and how to do not. Another important book about mismeasurement of men was written by Gouls /GOUL81/.

9.10 Open Problems and Research in the Future The research area of software measure became a major research field during the last years. Especially in the USA, software measures are a major topic on conferences on software maintenance, like the Conference on Software Maintenance C S M or the annual "Software Metric Workshop" of the University of Portland/Oregon. In Europe was created the ESPRIT Project METKIT No. 2384 by the European community in 1988. The goal of this project is the education of students and people of the companies in software measurement. The discussed list of measures cover up only the intra-module complexity measures. The measures have to be considered from two sides: 1.

2.

As structural measures: These measures analyze the structure of the program. A prerequisite for these measures is that they capture only one attribute (partial property) of the program, otherwise the numbers are not interpretable. That is not be true for every measure because they capture more than one attribute (SCOPE, N-SCOPE, WHIT, EJ-DSC, etc.) Considering the measures in this way, the measures give informations of the structure of programs or flowgraphs. The numbers are not interpreted in the terms of complexity, maintainability and reliability. As complexity measures, or as measures for maintainability, or reliability: In these cases the numbers of the measures are interpreted in a psychological way; the intuitive meaning of the numbers is here an important question. The meaning of the numbers is interpreted as relations: equal or more like complexity, equal or better to maintain, equal or more reliable, etc. Customers are doing that if they are calculating correlations and if they are formulating the question of validation. Software design measures are a part of this type of measures.

Our investigation did not solve the problem of the definition of the empirical relation: "equal or more complex". That was not the goal of this book. We used an descriptive approach in order to describe the properties of the measures. The conditions for the use of measures were investigated and given. Knowing the properties of measures the user can select measures by certain criteria. The following steps seem for us to be important for the next future. 1. 2. 3.

To complete the descriptions of the partial properties of the discussed measures by atomic modifications. To generate a catalog of measures where the partial properties are described in a uniform way by atomic modifications. To generate a catalog of intra-modular measures which are described by partial properties to the atomic modifications.

564 4. 5. 6. 7. 8. 9.

9 Results and Research in the Future To develop an extended set of standardized software complexity measures for intra-modular software complexity measurement. To generate a catalog of inter-modular (cohesion, coupling) measures which are also described by partial properties to the atomic modifications. To generate a catalog of software design measures which are described by partial properties to the atomic modifications. To generate a catalog of data flow complexity measures which are also described by partial properties to atomic modifications. To carry out well prepared experiments with a carefully selected set of measures and programs. To generate an expert system using the description of the measures by atomic modifications which can be interpreted as rules. An expert system would be very helpful to analyze and select software complexity measures.

We say it again, it is not clear how the empirical relation "equal or more complex" really looks like. It is till today not clear whether this relation is an Extensive Structure or additive. Is software maintainability additive? Does the effort to write a program have the property of the axiom of monotonicity or not as required by Halstead with the Measure Effort?. Because the questions above can not be solved today, the only one way to measure the properties of software during the software life-cycle, is the use of well described measures, where the interpretation of the numbers is clear. We think, that teaching in software measurement is very important and absolutely necessary. To make the wrong decision based on numbers can be dangerous. Open questions are: 1. 2. 3. 4. 5. 6.

7.

What is complexity, maintainability and reliability of software? What type of attributes of software can we measure? Are these attributes in any way connected with complexity, maintainability and reliability of software? Is it in general possible to measure on the level of the ratio scale? Are the binary operations realistically? What is the numerical system for the Extensive Structure and the ratio scale? Is it additivity or another function, as Weyuker and Pressman proposed. Is software measurement only possible on the level of an ordinal scale as Romeu /ROME83/ pointed out? Then statements like, program A is twice as complex as program B, would not be meaningful. The consequence would be the the use of non-parametric and rank order statistics. Produces a good software design good maintainable and reliable software?

That were only some questions and ideas to the future activities in the area of software complexity measurement. Because the research field of software complexity measurement is a very young discipline, it is necessary to create solid groundwork for software (complexity) measurement.

10 Glossary of Terms The purpose of this glossary is to provide an explanation for terms used in this book. For the definitions of terms not included in this glossary see /IEEE83/, /IEEE89/, /IEEE90/, /SMIT88/ and /ALVE88/. Algorithm: "A finite set of well defined rules for the solution of a problem in a finite number of steps; for example, a complete specification of a sequence of arithmetic operations for evaluating sin(x) to a given precision" /IEEE83/. Algorithmic Complexity: The algorithmic complexity is the number of the operations required to execute a program. It is also called the computational complexity. All-Path Condition: The All-Path condition was introduced by Howatt and Baker /HOWA85/ to define an one-entry range in a flowgraph. Arithmetic Mean: A prerequisite for the calculation of the arithmetic mean is at least the level of an interval scale. For the ordinal scale the calculation of the arithmetic mean is not meaningful. In this case the calculation of the median is meaningful. Atomic Modification: The concept of atomic modifications was introduced by the author. It is a change in a flowgraph, like adding an edge, transfering an edge, adding a node in a range, etc. An atomic modification is used to describe partial properties and the property s of a measure as a ordinal scale (complete description). Axiom of Weak Associativity: P1, P2 and P3 are arbitrary flowgraphs, o is a binary operation and •> the empirical relation. P1 o (P2 o P3 )=(P1 o P2 ) o P3. The axiom of weak associativity is a member of the Extensive Structure. Remark: In the book we left out the term weak. Axiom of Weak Commutativity: P1 o P2 *=P2 o P1. The axiom of weak commutativity is a member of the Extensive Structure. Axiom of Weak Monotonicity: P1 •> P2=> P1 o P3 •> P2 o P. The axiom of weak monotonicity is a member of the Extensive Structure. Archimedian Axiom: If P3 •> P4 then for any P1 ,P2 there exists a natural number n, such that P1 o nP3 •> P2 o nP4. The Archimedian axiom is a member of the Extensive Structure. Base: A base is denoted as the set of independent paths (Cyclomatic number) /BERG73/ in a graph. It is important to notice that the set of independent paths is not unique. McCabe /MCCA76/ used the cyclomatic number for his complexity measure.

566

10 Glossary of Terms

Binary Operation: A binary operation is the empirical concatenation of two objects, in our case programs/ flowgraphs. A binary operation is required by the Extensive Structure, in our investigation the binary operations BSEQ=P1 o P2 and BALT=P1 • P2 between two flowgraphs are used. Binary Predicate: A binary predicate is a decision node with an outdegree of 2 edges (0(n)=2). Complete Description of a Measure: A measure ¡s completely described if and only if its property s is completely described by partial properties to atomic modifications, it Is the reflexive and transitive closure of the partial properties of the measure. Complexity: "The degree of complication of a system or system component determined by such factors as the number and intricacy of interfaces, the number and intricacy of conditional branches, the degree of nesting, the types of data structures, and other system characteristics" /IEEE83/. Concatenation of Flowgraphs: Flowgraphs can be concatenated in several ways. A concatenation of objects, here flowgraphs, is required by the Extensive Structure (Binary operation). In our investigation the concatenations BSEQ (sequential) and BALT (alternative) are used. Concatenation operations of flowgraphs are also discussed by other authors, for example, Weyuker /WEYU88/ and Bache /ALVE88/. Correlation Between Measures: Important for the calculation of correlation between measures is the correct use (among others) of correlation coefficients to the level of the scale of the numbers. For example, the CHI-Square correlation coefficient can be used for a ranking scale, like the ordinal scale. The Pearson correlation coefficient requires at least the interval scale. Cyclomatic Number: The cyclomatic number is the number of independent paths in a strongly connected graph. It is calculated for a strongly connected graph G by the formula: CVC(G)= |E|-|N|+1 /BERG73/. |E| is the number of edges, |N| the number of nodes and G an arbitrary graph. For a weakly connected flowgraph F the cyclomatic number is calculated by the formula: CYC(F)= |E|-|N|+2 /MCCA76/. Data Flow Complexity: Data flow complexity is the complexity of programs based on the data flow of a program. Data Structure Complexity: Data structure complexity is the complexity of the data structures in a program. Dynamic Software Complexity Measures: Dynamic software complexity measures analyze the complexity of the execution of a program, for example, the numbers of interrupts. Descriptive and Normative Approach: In measurement theory are distinguished two different approaches /ROBE79/: " The prescriptive/ normative interpretation and the descriptive approach. The prescriptive or normative interpretation looks at the axioms as conditions of rationality. A truly rational man, given ideal conditions (unlimited computational ability), unlimited re-

10 Glossary of Terms

567

sources, etc.). should make judgements that satisfy the axioms, or else he is not acting rationally. Theories can be built on the definition of a rational man, and procedures for a rational man to make decisions based on his judgements can be developed. A second interpretation is that these axioms are descriptive. The give conditions on behaviour which, if satisfied, allow measurement to take place. Whether or not measurement takes place then depends then on whether or not an individual's judgements satisfy the axioms". The descriptive approach is used in this book. Empirical Relation: An empirical relation is a relation between empirical objects. An example is the empirical relation "equal or more complex than" for programs or flowgraphs as used by the author. Empirical Subrelation: An empirical subrelation is a piece of an empirical relation. For example, a program becomes more complex by adding an edge. If an empirical subrelation is identical to the partial property of a measure then the idea of complexity of the person and the measure are corresponding. Entry-node of a Prime or a Range: The entry-node of a prime is per definition always unique. A range can contain more than one entry-node. The entry-node of a range is the decision node if the range consists only of an alternative predicate. In other cases, the entry-node is determined by the dominators of the nodes in the range and the all-path condition /HOWA85/, /HOWA85a/. Explosion Number: The explosion number of a prime decomposition tree was introduced by Ejiogu /EJI085/. It is the effect of rotation of branches of the root node. Extensive Structure: Generally speaking, a theory of extensive measurement is a set of assumptions, or axioms, formulated in terms of an ordering •> , of objects with respect to some property, and a concatenation operation o between the objects that permits the construction of a scale f satisfying a •> b f(a) > f(b) and f(a o b) = f(a) + f(b), where f is a function and a and b are objects. The first part of the formula is the weak order and the second part the additive property. Fenton-Whitty Scheme: The Fenton-Whitty scheme is a notation to describe the decomposition of flowgraphs into primes and into the decomposition tree. The Fenton-Whitty scheme makes it possible to describe measures, which are based on the prime decomposition, in three steps /ALVE88/. First Occurrence Path (FOP): The First Occurrence Path was introduced by Howatt and Baker /HOWA85/. A FOP (x,y) from node x to node y is the set of all paths from x to y such that node y occurs exactly once on each path. The First Occurrence Path is used to isolate those paths from node x to y that do not contain any cycles on y. Flowgraph: A flowgraph is the representation of the control flow of a program. It can be described by the quadrupel (E,N,s,t), where E is the set of edges, N the set of nodes, s the startnode and t the exit-node.

568

10 Glossary of Terms

Greatest Lower Bound (GLB): The greatest lower bound (GLB) for complexity measures was introduced by Harrison and Magel /HARR81/. The unique lower bound that precedes all other lower bounds is called the greatest lower bound (GLB). Hybrid-Measure: A hybrid-measure is a combination of two or more different measures, like the Measures of McCabe and Halstead, the Measure H-SCOPE of Harrison and Magel, the Measure of Oviedo, which combines control flow and data flow complexity, and the Measure CSG of Schmidt and Gong. Homomorphism: A homomorphism is, in our case, a mapping from the empirical relational to the formal relational system which preserves all relations and operations between the objects /ROBE79/. Idea of Complexity/View of Complexity: As an idea of complexity is denoted the question to a person, manager, etc.: "Why is one program more complex than another one?". It is the intuitive idea of complexity of a person. With a measure are always connected partial properties. That is the idea of complexity behind the measure. The set of the partial properties of a measure is called the property s of a measure. If a person wants to use a software complexity measure the intuitive idea of complexity of the person has to correspond with the property s of the measure. Independent and Dependant Paths: An independent path cannot be determined by a linear combination of other paths in the graph. The number of independent paths (Cyclomatic number) of a graph G is calculated by the formula CYC(G)= |E|-|N|+1 /BERG73/. For a flowgraph F the cyclomatic number is CYC(F)= E|-|N|+2 /MCCA76/. McCabe used the cyclomatic number for the definition of his software complexity Measure MCC-V. Interpretation of the Numerical Values of the Measurement Process: It is important to give an interpretation of the numbers of a measurement process. Kriz /KRIZ88/ used the term interpretation in the following way: "The numerical results of measurement have no empirical meaning. They have to be translated back into empirical statements, a process called interpretation". Inter-Modular Complexity: The complexity of a program system consisting of several modules. Intervals: Given a node h, an interval l(h) is the maximal single entry subgraph for which h is the entry-node and in which all closed paths contain h. The unique interval node h is called the interval head or simply the header node /ALLE70/. Hecht /HECH77/ writes about intervals: "One approach to interprocedural data flow analysis is to progressively propagate local informations outward from a procedure's innermost "loops" to its outermost "loops", and then reverse the process. Intuitively, this is somewhat analogous to hierarchical bottom-to-top-to-bottom information movement in an organization". Intra-Modular Complexity: The complexity of a single module/program.

10 Glossary of Terms

569

Leaves: Leaves in a prime decomposition tree are the nodes with an outdegree of 0. Lines of Code: "A line of code is any line of program text that is not a comment or blank line, regardless of the number of statements or fragments of statements on the line. They specifically includes all lines containing program headers, declarations, and executable and non executable statements" /CONT86/. Loop: In /AHO86/ a loop is defined by the following conditions: There must be at least one way to iterate the loop, i.e., at least one path back to the header. All nodes in the collection are strongly connected; that is, from any node in the loop to any other, there is a path of length one or more, wholly within the loop, and The collection of nodes has a unique entry. That is the only way to reach a node of the loop from a node outside the loop is to go through the entry. A loop that contains no other loops is called an inner loop. A loop must have a single entry point, called the header. This entry point dominates all nodes in the loop, or it would not be the sole entry to the loop. Loop-Predicate The term loop-predicate was introduced by Howatt and Baker /HOWA86/. A loop-predicate is a decision node which represents a loop. There are four conditions for a loop. Lower Bound (LB): The set of nodes that lie on all paths from the immediate successor of a given node n to the terminal node t are called lower bounds (LB) Measure Demonstration System (MDS): The "Measure Demonstration System" (MDS) is a lab to investigate and demonstrate software complexity measures based on the flowgraph of programs. It is used in this book to calculate the examples. MDS was not intended to be a commercial tool available for a general distribution. The first version of this system, named METRICS, was developed by the author at the IBM Thomas Watson Research Center in Yorktown Heights during the years 1987 and 1988. In the year 1988 the system METRICS was released by IBM Yorktown Heights for the use at the "Technische Universität Berlin" (Technical University of Berlin). The system MDS is a revised form and a considerable enlargement and improvement of the system METRICS by the author. That was done during the year 1989 at the "Technische Universität Berlin". MDS is running under VMSP/CMSSP and is written in PL/1. A modified version of MDS, written in the programming language C, will be available for IBM PS/2 from the middle of 1990. MDS contains more than one hundred software complexity measures based on flowgraphs. The properties of the measures are described by partial properties (to atomic modifications) and their concatenation property with respect to the axioms of the Extensive Structure. Meaningfulness of Statements: A statement is meaningful if and only if its truth value is invariant against all admissible transformations /ROBE79/. Measure: A measure n is a mapping A B which for every empirical object a e A yields a formal object (measurement value) n(a) e B.

570

10 Glossary of Terms

Measure and Scale: With a measure is not connected a scale per se. A measure can be used as an ordinal or an interval scale. It is not right to say: "The Measure of McCabe is an ordinal scale". It is important to notice that the conditions for the use of a measure as a certain scale have to be defined. Measurement: " Measurement is the process of empirical, objective assignment of numbers to the properties of objects and events in the real world in such a way to describe them" /FINK84/. Metric: A metric is a criterion to determine the difference or distance between two entities, like the distance of a query and a document in Information Retrieval Systems. A well known metric is the Metric of Euclid, which measures the shortest distance between two points. Another metric is the City-Block-Metric (also called Taxi-Driver-Metric), which measures the distance between two locations in Manhattan. A function f is called a metric if it satisfies the following three properties (x,y) is the distance from location x to y: f(x,y)=0 for x=y. f(x,y)=f(y,x) for all x and y (Symmetric Property) f(x,z)if(x,y) + f(y,z) for all x,y,z (Transitive property). Micro-Level and Macro-Level Measures: Micro-level measures are intra-modular measures and macro-level measures are intermodular measures. Minimal Base: The minimal base is a special type of base as used by Whitworth and Szulewski /WHIT80/. It is the base where the sum of the nodes, which belong to a base, is a minimum. Module/Program: The terms modules and programs are used as synonyms. Monadicity: The notion of monadicity was introduced by Ejiogu /EJI085/ in 1985. The monadicity is summed through all explosion numbers. The monadicity measures the bushiness of the prime decomposition tree. Partial Property of a Measure: A partial property of a measure is described by an atomic modification. More precisely: If a flowgraph P results from a flowgraph P' by an atomic modification then the complexity can increase, decrease or remains unchanged. The sensitivity of the measure to an atomic modification is the partial property of the measure. We say: The Measure X has the partial property (less complex, equal complex or more complex) with respect to an atomic modification M. Partial Description of a Measure: A measure is partially described if its property is partially described. Predicate: A predicate is a decision node. Prime: Primes are 1-entry and 1 -exit subflowgraphs which are not further decomposeable.

10 Glossary of Terms

571

Prime Decomposition Tree: A prime decomposition tree is the graphical representation of the nesting levels of the primes in the flowgraph. Product Measure: Product measures quantify attributes of the software product. Property of a Measure: The term property is used very common. With the property of a measure can be denoted: 1) The behaviour/property of a measure generally. 2) The partial description of a measure by partial properties. 3) the behaviour/property of a measure related to the Extensive Structure. Property s of a Measure: As the property s of a measure is denoted the complete description of the measure by partial properties as an ordinal scale (reflexive and transitive closure). Psychological Complexity: The psychological complexity of a program is the difficulty to understand, to read, to maintain, etc. the program. QUALMS: The software system QUALMS was developed by the Project "Structured-Based Software Measurement" /ALVE88/. Quality: IEEE definition: "A totality of features and characteristics of a product or service that bears on its ability to satisfy given needs" /IEEE83/. BSI definition: Quality is the totality of features of a product or service which bear on its ability to satisfy a given need. ITT definition: Quality is conformance with specification. One is the intrinsic or extrinsic characteristics of an item /ALVE88/. Quality Measure: "A quantitative measure of the degree to which software prosesses a given attribute that affects its quality" /IEEE83/. Range and Scope: Ranges or scopes are used as synonyms. They are a set of nodes to a decision node d and the greatest lower bound of a decision node d in a flowgraph. Relational Systems: Connecting measurement theory and software measures three relational system can be considered: 1)The formal relational system, 2)The relational system of the measure, 3)The empirical relational system of a person. Do do software measurement means that the relational system 3 has to correspond with relational system 2. Scale: The Triple (A,B,p.) is denoted as a scale. A is the empirical relational system, B is the formal relational system and p. is a measure. Scales are also defined by admissible transformations. For real scales there is a classification of scales according to their admissible transformations /STEV46/. The common hierarchy of scale is: the nominal scale with any one to one transformation, the ordinal scale with a strictly increasing transformation, the interval scale with the transformation g(x) = a x + b, a > 0, the ratio scale with g(x) = a x, a > 0 and the absolute scale with g(x) = x.

572

10 Glossary of Terms

Software Measure: A software measure is defined by a rule by which a given software related product can be quantified. Software Life-Cycle: The software life-cycle consists of a set of discrete activities occurring in a given order during the development and use of software and software systems. The time periods during which these activities occur are refered to as phases. At the current time a consensus has not developed as to which phases comprise the software life-cycle. However, here are some of the phases in the life-cycle: concept exploration, requirements, design, implementation, test, installation and checkout, operation and maintenance /IEEE83/. Stable Set: The stable set for software complexity measures was introduced in 1986 by Szentes /SZEN86/. A set S c N of nodes is called a stable set if no edges join two distinct nodes in S /BERG73/. Static Analysis: " The process of evaluating programs without executing the program" /IEEE83/. Static Software Complexity Measures: Static software complexity measures analyze the static structure of programs or flowgraphs, like unstructuredness, lines of code, paths, etc. Structuredness of Flowgraphs: The structuredness of flowgraphs is defined in different ways. One definition is that a flowgraph consists only of the Dijkstra-Structures and the extended Dijkstra-Structures. Another definition is based on decomposition of a flowgraph into primes. If there are, as a result of the prime decomposition, only primes with one decision node, then the flowgraph is structured. A further definition is the reducibility in intervals as defined by Hecht /HECH77/. Structural Measure: Structural measures analyze the static structure of flowgraphs. Weak Order: The conditions for the weak order are a binary relation, in our case: "equal or more complex", the axiom of transitivity and the axiom of completeness.

11 References /ADAM90/

Adamov, Rade; Richter, Lutz.: "A Proposal for Measuring the Structural Complexity of Programs", The Journal of Systems and Software 12, pp.55-70,1990.

/AH086/

Aho, Alfred V.; Sethi, Ravi; Ullman, Jeffrey D.: "Compilers, Techniques and Tools", Addison-Wesley Publishing Company, Reprint, 1986.

/ALBR83/

Albrecht A.J.; Gaffney, S.H.: "Software Function, Source Lines of Code and Development Effort Prediction: A software Science Validation", IEEE Transactions of Software Engineering Vol. 9, No. 6 , 1 9 8 3 , pp. 639-648.

/ALLE70/

Allen, F.E.: pp.1-19.

/ALLE76/

Allen, F.E.; Cocke, J.: "A Program Data Flow Analysis Procedure", Communications of the ACM, March 76, Vol. 19„ No. 3, pp.137-147,1976.

/ALVE88/

Edited by: Elliott, J.J; Fenton, N.E.; Linkman, S.; Markham, G.; Whitty, R.: "Structure-Based Software Measurement", Alvey Project SE/069, 1988, Department of Electrical Engineering, South Bank, Polytechnic, Borough Road, London, SE1 OAA, UK.

/BACH87/

Bache, R.: "Metricating A-KINDRA BT Project 610287", Document W021, South Bank 1987.

/BACH87a/

Bache, R.: "Structural Metrication within an", Axiomatic Framework, In: ALVE88..

/BACH89/

Bache, Richard; Müllerburg, Monika: "An Automatic Method of Measuring Testability", 6th International Conference on Testing, Computer Software,, Washington D.C., May 1989.

/BAIL81/

Bailey, C.T.; Dingee W.L.: "A Software Study Using Halstead Metrics", Bell Laboratories DEnver, CO. 80234, 1981.

/BAIL88/

Bail, William G.; Zelkowitz, Marvin V.: "Program Complexity Using Hierarchical Abstract Computers", Computer Language, Vol. 13, No. 3/4, pp. 109-123, 1988.

/BASI80/

Basili, V.: "Tutorial on Models and Metrics for Software Management and Engineering", Computer Society Press, EHO-167-7, COMPSAC80.

/BASI81/

Basili, V.; Reiter, R.W.: "A Controlled Experiment Quantitatively Comparing Software Development Approaches", IEEE Transactions on Software Engineering, Vol. SE-7, No. 3, May 1981, pp. 299-320..

/BASI84/

Basili, V.; Perricone, Barry T.: "Software Errors and Complexity: An Empirical Investigation", Communications of the ACM, Vol. 27, No. 1, Jan. 1984, pp. 42-52.

/BASI87/

Basili, V.; Rombach, Dieter H.: "TAME: Integrating Measurement into Software Environments", TR-1764 ; TAME-TR-1-1987.

/BAST87/

Bastani, Farokh, B.; Iyengar, Sitharama: "The Effect of Data Structures on the Logical Complexity of Programs.", Communications of the ACM, Vol. 30, No. 3 , 1 9 8 7 .

"Control Flow Analysis", SIGPLAN NOTICES, July 1970,

574

11 References

/BAUE89/

Bauer, Michael; Träger, Axel; Lange, Steffen: "Darstellung Statischer Softwarekomplexitätsmaße", Supervisor: Bollmann, P; Zuse, H., Diploma Thesis at the Technische Universität, Berlin, FR 5-3, D - 1 Berlin 10, West Germany.

/BELA79/

Belady, L.A.: "On Software Complexity", In: Workshop on Quantitative, Software Models for Reliability, PP.90-94,, 1979.

/BENY79/

Benyon-Tinker, G.: "Complexity Measures in an Evolving large system", Proc. ACM Workshop Quant. Software Models, 1979, pp. 117-127.

/BELA80/

Belady, L.A.; Evangelisti, C.J.; Power, L.R.: "A Graphic Representation of Structured Programs", IBM Systems Journal, Vol. 19, No. 4, pp. 542-553,1980.

/BELA81/

Belady, L.A.; Evangelisti, C.J.: "System Partioning and Its Measure", The Journal of Systems and Software 2, pp.23-29,1981.

/BERG73/

Berge, C. 1973.

/BLAI85/

Blaine, David J.; Kemmerer Richard A.: "Complexity Measures for Assembly Language Programs", The Journal of Systems and Software, No. 5, pp. 229-245, 1985.

/BLAS85/

Blaschek, G.: "Statische Programmanalyse", Elektronische Rechenanlagen, 27. Jahrgang, Heft 2„ 1985.

/BOBB86/

Bobbie, Patrick: "A Family of Software Architectures for the Support of Life Cycle Entities in a Distributed Envirement", The Center for Advanced Computer Studies, of the University of Southwestern Louisiana, 1986.

/BOEH79/

Boehm, B.W.: "Software Engineering: R and D Trends and Defense Needs", Research Directions in Software Technology, P. Wegner (ED.) The MIT Press, Cambridge,, MA, 1989, pp.44-86..

/B0EH81/

Boehm, B.W.: "Software Engineering Economics,", Prentice Hall, 1981.

/BOHR75/

Bohrer, R.: "Halstead's Critrion and Statitical Algorithm", Proc. 8th Annual Computer Science/Statistics, Interface Symposium, Feb. 1975.

/BOLL77/

Bollmann, Peter;: "Untersuchung von Effektivitätsmaßen für DokumentenRetrieval-Systeme", Dissertation, TU-Berlin, 1977.

/B0LL81/

Bollmann, P.; Cherniavsky, V.S.: "Measurement-Theoretical Investigation of the MZ-Metric.", In: R.N. Oddy, S.E. Robertson, C.J. van, Rijsbergen, P.W. Williams (ed.)lnformation, Retrieval Research, Butterworth, 1981.

/BOLL84/

Bollmann, Peter: "Two Axioms for Evaluation Measures in Information Retrieval .", Research and Development in Information, Retrieval, ACM, British Computer Society Workshop, Series, pp. 233-246,1984.

/BOLL85/

Bollmann, P; Zuse, H.;: "An Axiomatic Approach to Software Complexity Measures", Third Symposium on Empirical Foundations of, Information and Software Science III, Edited by Jens Rasmussen and Pranas Zunde, Plenum Press, New York, Roskilde, Denmark, October 21-24,1985.

"Graphs and Hypergraphs", American Elsevier, New York,

11 References

575

/BORT79/

Bortz, Jürgen: "Lehrbuch Springer Verlag, 1979.

der

Statistik.

Für

Sozialwissenschaftler",

/BOSC87/

Bosch, Karl: "Elementare Einführung in die angewandte Statistik", Vieweg Studium, Vieweg & Sohn, Braunschweig und Wiesbaden, 1987.

/BOWL83/

Bowles, Adrian John: "Effects of Design Complexity on Software Maintenance,", Dissertation 1983., Northwestern University, Evanston, Illinois.

/CARD90/

Card, David N.; Glass, Robert L.: "Measuring Software Design Quality", Prentice Hall, Engewood Cliffs, New Jersey, 1990.

/CERI86/

Cerino, Deborah A.: "Software Quality Measurement Tools and Techniques", COMPSAC 86, pp. 160-167,1986.

/CHAP79/

Chapin, N.: "A Measure of Software Complexity", AFIPS National Computer Conference, Spring 1979, pp.995-1002..

/CHEN78/

Chen, E.: "Program Complexity and Programmer Productivity", IEEE Transactions on Software Engineering, Vol SE-4, pp. 187-194, May 1978.

/CHER71/

Chemiavsky, V; Lakhuty, D.G.: "On the Problem of Information System Evaluating", Naucno.-Tecneskaja Informatija, Ser 2, No. 9„ Russian, 1971:English Translation:, Automatic Documentation, and Mathematical Linguistics, 4, pp. 9-26.

/CHIF89/

Chikowsky, E.J.: "Software Development: Computer-Aided Software Engineering (CASE)", IEEE Computer Society Press Technology Series, IEEE Computer Society Order Number 1917,1989.

/CHRI81/

Christensen, K.; Fitsos, G.P.; Smith, C.P.:: "A Perspective on Software Science.", IBM Systems Journal, Vol.: 20, No.: 4, pp. 372-387,1981.

/CONT86/

Conte, S.D.; Dunsmore, H.E.; Shen, V.Y.: "Software Engineering Metrics and Model", Benjamin/Cummings Publishing Company,, Menlo Park, 1984.

/COOK83/

Cook, Curtis R.: "Software Complexity Measures", Northwest Software Quality Conference:, Measuring Software Quality, Corvallis, Oregon 1983.

/COTE88/

Cote, V., P. Bourque; Oligny, S.; Rivard, N.: "Software Metrics: An Overview About Recent Results", The Journal of Systems and Software,, No. 8, pp. 121-131,1988..

/CSM89/

Proceedings: Conference on Software Maintenance: IEEE, October 16-19,1989",

/CURT79/

Curtis, B.: "In Search of Software Complexity", In: Workshop on Quantitative, Software Models for Reliability, PP.95-106,, 1979.

/DAVI88/

Davis, John Steven; LeBlanc, Richard J.: "A Study of the Applicability of Complexity Measures", IEEE Transactions on Software Engineering, Vol. 14, No. 9, Sept. 89, pp. 1366-1372..

/DEMA82/

DeMarco, Tom;: "Controlling Software Projects Management, Measurement and Estimation", Englewood Cliffs, N.J.: Prentice Hall, 1982.

/DEMA87/

DeMarco, Tom; Buxton, John: "The Craft of Software Engineering", Addison Wesley Publishing Company, 1987.

"Miami, Florida,

576

11 References

/DEMI81/

DeMillo, Richard A.; Upton, Richard J.: "Software Project Forecasting", In /PERL81/, pp.77-94,1981..

/DIJK68/

Dijkstra, E.W.: "Goto Statements Considered Harmful", ACM, 11(3), pp. 147-148, March 1968.

/DIJK72/

Dijkstra, E.W.: "The Humble Programmer, CACM, Vol. 15, No. 10, Oct. 1972.

/DREG89/

Dreger, Brian, J.: "Function Point Analysis", Prentice Hall, Advanced Reference Series,, Computer Science, 1989.

/DREN86/

Asam, Robert; Drenhard, Norbert; Maier, Hans-Heinz: "Qualitätsprüfung von Softwareprodukten: Definieren und Pr en von Benutzerfreundlichkeit, Wartungsfreundlichkeit und Zuverlässi", Siemens Aktiengesellschaft, Berlin und München,, 1986.

/DUNS78/

Dunsmore, H.E.; Gannon J.D.: "Programming Factors: Language Features That Help Explain Programming Complexity", Proc. ACM Annual Conference, Washington, D.C., Dec. 1978, pp. 554-560..

/DUNS79/

Dunsmore, H.E.; Gannon J.D.: "Data Referencing: An Empirical Investigation", IEEE Computer, 12(12), pp. 50-59,1979..

/DUNS82/

Dunsmore, H.E.: "Software Metrics: An Overview of an Evolving Method Empirical Foundations of Information and Software", Science, Proceedings of the First Symposium,, Atlanta, GA, pp. 183-192, Nov. 1982.

/ECKE80/

Eckes, Thomas; Roßbach, Helmut: "Clusteranalysen", Verlag W. Kohlhammer, 1980.

/EHRE86/

Ehrenberg, A.S.C.: "Statistik oder der Umgang mit Daten: Ein praktische Einführung mit Übungen", VCH Verlagsgesellschaft mbh, Germany, 1986.

/EJI084/

Ejiogu, LEM O.: "A Simple Measure of Software Complexity", Sigplan Notices, V20 #3, March 1985.

/EJI085/

Ejiogu, LEM O.: "A Simple Measure of Software Complexity", Computer World 1984/April.

/EJI087/

Ejiogu, LEM O.: "The Critical Issues of Software Metrics", Sigplan Notices V22, No. 3, March 87..

/ELSH75/

Elshoff, J.:: "An Analysis of Some Commercial PL/I Programs.", IEEE Transactions of Software Engineering, Vol.: SE-2, No.: 2, , pp. 113-120, Dec. 1975.

/ELSH76/

Elshoff, James L.:: "Measuring Commercial PL/I Programs Using", Halsteadt's Criteria., SIGPLAN Notices, pp.38-46, Vol.: 11, No.: 5, May 1976.

/ELSH83/

Elshoff, James L.; Marcotty, Micha'el:: "On the Use of the Cyclomatic Number to Measure Program Complexity.", SIGPLAN Notices, pp. 231-243, Vol.: 13, No.: 3, Sept. 83.

/ELSH84/

Elshoff, James L.:: "Characteristic Program Complexity Measures.", IEEE Transactions on Software Engineering, pp. 288-293, Vol. SE-9,1984.

/EMDE71/

Van Emden, M.H.: "An Analysis of Complexity", Mathematisches Zentrum, Amsterdam, 1971.

11 References

577

/EMER84a/

Emerson, Thomas J.: "Program Testing, Path Coverage, and the Cohesion Metric", IEEE COMPSAC, 1984, pp. 421-431.

/EMER84b/

Emerson, Thomas J.: "A Discriminant Metric for Module Comprehension", 7th International Conf. on SW-Eng. 1984, pp.294-431.

/EVAN83/

Evangelisti, W.M.: "Software Complexity Metric Sensitivity to Program Structured Rules", The Journal of Systems and Software 3, pp.231-243, 1983.

/EVAN84/

Evangelisti, W.M.: "An Analysis of Control Flow Complexity", COMPSAC 84, Nov. 7-9, pp. 388-396,1984.

/FENT85/

Fenton, N.E.: "The Structural Complexity of Flowgraphs in Graph Theory and its Applications to Algorithms", and Computer Science, J. Wiley and Sons, 1985.

/FENT87/

Fenton, N.E.; Kaposi, Agnes: "Metrics and Software Structure", Information and Software Technology, Vol. 29, No. 6, July/August 1987.

/FENT88/

Fenton, N.E.;: "Software Measurement", In:/ALVE88/.

/FENT89/

Fenton, N.E.;: "The Mathematics of Complexity in Computing and Software Engineering", Centre for Software Reliability, City University, Northhampton Square, London EC1V OHB, May 1989.

/FENT89a/

Fenton, Norman: "Software Measurement: Educational Report", METKIT ESPRIT Project No. 2384, Internal Report.

/FENT90/

Fenton, N.; Ince, D.; Littlewood, Bev; Mellor, P; Tiilor, D.: "Software Metrics: A Rigorous Approach", City University, London, 1990, Appears as a book by Publisher: Chapman Hall, April 1991.

/FEUE79/

Feuer, A.R.; Fowlkes, Edward B.: "Relating Computer Maintainability to Software Measures", National Computer Conference, pp. 1003-1012,, 1979.

/FINK84/

Finkelstein, L.; Leaning, M.S.: "A Review of the Fundamental Concepts of Measurement", Measurement, Vol. 2, No. 1, Jan-Mar 1984.

/FISH88/

Fishburn, Peter C.: "Nonlinear Preference and Utility Theory", AT&T Bell Laboratories, 1988.

/FITZ78/

Fitzsimmons, A.; Love, Tom:: "A Review and Evaluation of Software Science.", Computing Surveys, pp. 3-18, Vol.: 10, No.: 1, March 1978.

/F!TZ78a/

Fitzsimmons, Ann; Love, Tom:: "A Review And Evaluation Of Software Science.", Computing Surveys, Vol.: 20, No.: 1, pp. 2-18, March 1978.

/FROM87/

Fromm, Hansjörg; Steinhoff, Alfons (Editors): "Software - Metriken", Arbeitsgespräch der Fachgruppe Software Engineering, IBM Bildungszentrum Herrenberg, 12.-13.3.87.

/GANN83/

Gannon, J.D.; Hecht, M.S.; Herbold, R.J.: "Prime Program Decomposition", Proc. of the 16th Annual Hawaii International, Conference on System Sciences, 1983.

/GARE79/

Garey, M.R.; Johnson D.S.: "Computers and intractability", W.H. Freeman & Co., 1979.

11 References

578 /GIGE81/

Gigerenzer, Gerd: "Messung und Modellbildung in der Psychologie", Ernst Reinhard Verlag München, Basel, 1981.

/GILB77/

Gilb, T. Software Metrics: chusetts, 1977",

/GLAS89/

Glass, Robert: "Editor's Corner: Software Metrics: of Lightning Rods and Buit-up Tension", The Journal of Systems and Software 10, pp. 158-158,, 1989.

/GOUL81/

Gould, S.J.: "The Mismeasure of Man", New York, Norton and Co, 1981.

/GOHA76/

Gordon, R.; Halstead, M.: "An Experiment Comparing Fortran Programming Times with the Software Physics Hypothesis", Proc. AFIPS Nat. Comp. Conf., 1976.

/GRAD87/

Grady, Robert B.; Caswell, Deborah L : "Software Metrics: Establishing a Company-Wide Program", Prentice Hall 1987.

/GUTT77/

Guttag, J.: "Abstract Data Types and the Development of Data Structures", Conference on Data, Salt Lake City, 1976, CACM, Vol. 20, No. 6, June 77, pp.396-404.

/HALL83/

Hall, Nancy R.: "Complexity Measures for Systems Design", Polytechnic Institute New York, June 1983.

/HALS77/

Halstead, M.H.: "Elements of Software Science", New York, Elsevier North-Holland, 1977.

/HAMA82/

Hamer, P; Frewin, G.: "Halstead's Software Science - A Critical Examination", Proc. 6th Internation Conference on Software Engineering, pp. 197-206, 1982.

/HAME85/

Hamer, P; Frewin G.: "Software Metrics: A Critical IN:Pergamon Infotech State of the Art Report, 13(2), 1985.

/HANS78/

Hansen, W.: "Measuring Program Complexity by the Pair (Cyclomatic Number, Operators Count)", ACM SIGPLAN Notices, Vol. 13, pp. 19-33, 1978.

/HARR81/

Harrison, Warren; Magel, Kenneth;: "A Complexity Measure Based on Nesting Level,", ACM SIGPLAN Notices, Vol. 16, No. 3, pp. 63-74,1981.

/HARR81a/

Harrison, Warren; Magel Kenneth;: "An Topological Analysis of the Complexity of Computer Programs with less than three binary Branches", ACM SIGPLAN Notices, Vol. 16, No. 4, pp. 51-63,1981.

/HARR82/

Harrison, Warren; Magel Kenneth; Kluczny Raymond; DeKock Arlan;: "Applying Software Complexity Metrics to Program Maintenance", Computer 1982 No. 9.

/HARR86/

Harrison, Warren; Cook, Curtis: "Are Deeply Nested Conditionals Less Readable?", The Journal of Systems and Software 6, pp. 335-341,1986.

/HARR87/

Harrison, Warren; Cook, Curtis: "A Micro/Macro Measure to Software Complexity", The Journal of Systems and Software, No. 7, pp. 213-219, 198, /HARR88/ Harrison, W., Software Science and Weyuker*s Fifth Property, Internal Report at: CSU CS University of Portland, PortlandOregon.

"Winthrop Publishers, Cambridge, Massa-

Overview",

11 References

579

/HAYS63/

Hays, William L.: "Statistics for the Social Sciences", Second Edition, Holt, Rinehart and Winston, 1963.

/HECH75/

Hecht, M.S.; Ullman, J.D.: "A Simple Algorithm for Global Data Flow Analysis Programs.", SIAM Journal on Computing 4 , 1 9 7 5 , 519-532.

/HECH77/

Hecht, M.S: "Flow Analysis of Computer Programs", Elsevier, New York, 1977.

/HENR81/

Henry, S.; Kafura, D.: "Software Metrics Based on Information Flow", IEEE Transactions on Software Engineering Vol. 7, No. 5, 1981, pp. 510-518..

/HILT89/

Hiltz, Starr Roxanne; Johnson, Kenneth: "Measuring Acceptance of Computer-Mediated Communication Systems", Journal of the American Society for Information, Science, 40(6), pp. 386-397,1989..

/HOEC84/

Höcker, Hans; Itzfeld, Wolf; Schmidt Monika;: "Timm, Michael", Comparative Descriptions of Software Quality Measures, GMD-Study, No. 81, Gesellschaft für Mathematik und Datenverarbeitung, March 1984..

/HOWA85a/ Howatt, James W.; Baker, Albert L.: "Definition and Design of a Tool for Program Control Structure Measures", COMPSAC 85, pp. 214-220,1985. /HOWA85/

Howatt, James W.; Baker, Albert L.: "A New Perspective on Measuring Control Flow Complexity", Technical Report No. 85-1, January 2 9 , 1 9 8 5 .

/HOWA86/

Howatt, James W.; Baker, Albert L.: "Rigorous Definition and Analysis of Program Complexity Measures:", An Example Using Nesting, TR #86-7, July 1986.

/HOWA89/

Howatt, James W.; Baker, Albert L : "Rigorous Definition and Analysis of Program Complexity Measures: An Example Using Nesting", The Journal of Systems and Software 10„ pp. 139-150,1989.

/IEEE83/

Standard Glossary of Software Engineering Terminology: "Febr. 83, IEEE Std. 723-1983.",

/IEEE89/

IEEE,: "Standard Dictionary of Measures to Produce Reliable Software", The Institute of Electrical and Electronics Engineers, Inc 345 East 47th Street, New York, NY 10017-2394, USA, IEEE Standard Board, 1989.

/IEEE89a/

IEEE,: "Guide for the Use of Standard Dictionary of Measures to Produce Reliable Software", The Institute of Electrical and Electronics Engineers, Inc 345 East 47th Street, New York, NY 10017-2394, USA, IEEE Standard Board, Corrected Edition, October 2 3 , 1 9 8 9 .

/INF085/

Infotech,: "The Software Development Process: State of the Art Report, 13:2", Pergamon Infotech Limited,, Maidenhaid, Berkshire, England.

/ITZF83/

Itzfeld, Wolf; Timm, Michael: "Beschreibungssystematik für Maße der Softwarequalität.", Angewandte Informatik, Friedrich Vieweg & Sohn, Verlagsgesellschaft mbH, 7/1983, pp.273-281..

/ITZF84/

Itzfeld, Wolf; Schmidt, Monika; Timm, Michael: "Spezifikation zur Validierung von Software Qualitätsmaßen", Angewandte Informatik, Friedr. Vieweg & Sohn, Verlagsgesellschaft mbH, 1/1984..

580

11 References

/IVAN87/

Ivan, Ion; Ashire Romulus;: "Program Complexity: Comparative Analysis, Hierarchy, Classification", SIGPLAN Notices, V22, No. 4, April 1987.

/IYEN82/

Iyengar, N.; Paramewaran, N.; Fuller, J.: "A Measure of Logical Complexity of Programs", Computer Languages, No. 7, pp.147-160,1982.

/JAYA87/

Jayaprakash, S.; Lakshmanan, K.B.; Sinha, P.K.: "MEBOW: A Comprehensive Measure of Control Flow Complexity", COMPSAC 87, pp. 238-244, 1987.

/JENS85/

Jensen, Howard A.; Vairavan, K.: "An Experimental Study of Software Metrics for Real-Time Software", IEEE Transactions on Software Engineering,, Vol. SE-11, No. 2, Feb. 1985, pp. 231-234.

/KAFU82/

Kafura, Dennis; Henry, S.: "Software Quality Metrics Based on Intercennectivity", Journal on Systems and Software, Vol 2 , 1 9 8 2 .

/KAFU87/

Kafura, Dennis; Geereddy, R.Reddy: "The Use of Software Complexity Metrics in Software Maintenance", IEEE Transactions on Software Engineering, Vol. SE-13, No. 3, March 1987.

/KERN74/

Kernighan, Brian; Plauger, P.J.: "The Elements of Program Style", New York, 1974.

/KEAR86/

Kearney, Joseph K.; Sedlmeyer, Robert L.; Thompson, William B.; Gray, Michael A.; Adler, Michael A.: "Software Complexity Measurement", CACM Vol. 29,No. 11,1986.

/KITC87/

Kltchenham, B.: "Towards a Constructive Quality Model", IEEE Transactions of Software Engineering, Vol. 2, No. 4, pp. 105-113,1987.

/KODR78/

Kodres, Udo R.: "Discrete Systems and Flowcharts", IEEE Transactions on Software Engineering, Vol. SE-4, No. 6, Nov. 1978.

/KRAN71/

Krantz, David H.; Luce, R. Duncan; Suppes; Patrick; Tversky, Amos: "Foundations of Measurement,", Academic Press, Vol. 1,1971.

/KRIZ81/

Kriz, Jürgen: "Methodenkritik Empirischer Soziaforschung", Eine Problemanalyse sozialwissenschaftlicher Forschungspraxis, Teubner Studienskripten, 1981..

/KRIZ88/

Kriz, Jürgen: "Facts and Artefacts in Social Science: An Ephistemological and Methodological Analysis of Empirical Social Science Research Techni", McGraw Hill Research, 1988.

/LEDG75/

Ledgard, Henry F.; Marcotty, Michael: "A Genealogy of Control Structures", CACM, Vol. 18, No. 11, Nov. 1975.

/LEMM88/

Lemming: "Maß und Messen, Austellungskatalog aus Anlaß der Gründung", der Physikalisch-Technischen Reichsanstalt am 28. März 1887, Braunschweig and Berlin, Physikalisch-Technische Bundesanstalt.

/LENG79/

Lengauer, T.; Tarjan, R.E.: "A Fast Algorithm for Finding Dominators in a Flowgraph", ACM Transactions on Programming Languages, and Systems Vol. 1, No. 1, pp.121 -141, July 1979.

/LESS87/

Lesshaft, Karl; Roth Christian: "Ein Verfahren zur Quantifizierung von Software-Komplexität", Angewandte Informatik 6/87.

11 References

581

/LEVI86/

Levitin, Anany V.: "How To Measure Software Size, And How To Do Not", pp. 314-818, COMPSAC 86.

/LEWI89/

Lewis, John; Henry, Sallie: "A Methodology for Integrating Maintainability Using Software Metrics", Proceedings: Conference on Software Maintenance, Miami, Florida, IEEE, October 16-19, pp. 32-39,1989.

/LI87/

Li, H.F.; Cheung, W.K.;: "An Empirical Study of Software Metrics", IEEE Transactions on Software Engineering, Vol. Se-13, NO. 6, June 1987.

/LI87a/

Li, Eldon: "On the Cyclomatic Metric of Program Complexity", California Polytechnic State University School of, Business, Quality DATA PROCESSING, Journal of the Quality Assurance Institute, 1987, Also in: AFIPS 1987.

/LICH85/

Lichtblau, U.: "Decompilation of Control Structures By Mean o f , Graph Transformations, In: Formal Methods and Software Development, TAPSOFT, No. 186, Springer Verlag, Editor: Hartmut Ehrig, Christian Floyd, March 85.

/LIGI89/

Ligier, Yves: "A Software Complexity Metric System Based on Intra- and Inter-modular Dependencies", IBM RC 14831 (#65457) 5/11/89.

/LIPA83/

Lipaev, V.V.; Pozin, B.A.; Stroganova, I.N.: "Complex Systems and their Programming Software: Complexity of Program Module Testing", Programmirovanie, No. 6, pp. 335-337,1983.

/LIPA83a/

Lipaev, V.V.; Pozin, B.A.;: "Complexity of Structural Testing of Program Modules with Loops", Programmirovanie, No. 6, pp. 335-337,1983.

/LIST82/

Lister, A.M.:: "Software Science - The Emperor's New Clothes ?", The Australian Computer Journal, Vol.: 14, No.: 2, May 1982.

/LOVE76/

Love, L. T.; Bowman, A.B.:: "An Independent Test of the Theory of Software Physics.", SIGPLAN Notices, pp. 42-48, Nov. 1976.

/MAGE86/

Magel, Kenneth;: "Efficient Calculation of the Scope Program Complexity Metric", Sigplan Notices, V21, No. 9, pp.49-56, Sept. 86.

/MARC87/

Marco, Allen; Buxton, John: "The Craft of Software Engineering", Addison Wesley, 1987.

/MCCA76/

McCabe, T.: "A Complexity Measure", IEEE Transactions of Software Engineering, Vol. SE-1, No. 3, pp. 312-327, 1976.

/MCCA89/

McCabe, T; Bulter, Charles W.: "Desgin Complexity Measurement and Testing", CACM, Vol. 32, No. 12, Dec 89, pp. 1415-1424.

/MCCA77/

McCall J.A.; Richards P.K.; Walters G.F.: "Factors in Software Quality", Vols I, II and III, US Rome Air Development Center, Reports NTIS AD/A-049014, 015, 055,1977.

/MELT88/

Melton, Austin C.; Baker Albert L.: "Biemann, James M. Gustafson David A.", A Mathematical Perspective for Software Measures Research, TR-CS-88-6, Department of Computing and Information Sciences, Nichols Hall, Kansas State University, Manhattan, KS 66506, April 88.

582

11 References

/MENN89/

Mennert, Andreas: "Analyse von Kontrollflußgraphen", Studienarbeit, Technische Universität Berlin,, Department of Computer Science, 1989..

/MENN90/

Mennert, Andreas: "Reduktion von Kontrollflußgraphen", Diplomarbeit, Technische Universität Berlin,, Department of Computer Science, 1989..

/MOAW83/

Moawad, Ramadan; Hassan, Mohamed: "Structural Approach Towards Software Reliability Evaluation", COMPSAC 83, pp. 9 - 1 6 , 1 9 8 3 .

/MOLE88/

Mole, David; Leelasena, Lasitha: "A User's Guide to the QUALMS System", in: ALVE88..

/MUN086/

Munoz, Jose Luis: "Complexity Measure During Software Design", University of Connecticut, 1986.

/MUNS89/

Munson, J.; Khoshgoftaar, T.: "The Dimensionality of Program Complexity", Proceedings of the 11th Annual International, Conference on Software Engineering, May 1989,, pp. 245-253..

/MUNS89a/

Munson, J.; Khoshgoftaar, T.: "Regression Modelling of Software Quality: An Empirical Investigation", Appears in: Information and Software Technology, Special Issue on Software Quality Assurance,, JanVFeb. 1989..

/MYER77/

Myers, G.L.: "An Extension of the Cyclomatic Measure of Program Complexity", SIGPLAN Notices, Vol 12, No. 10, pp.61-64,1977.

/NARE84/

Narens, Louis: "Abstract Measurement Theory", The MIT Press, Cambridge, Massachusetts, London, England, 1984.

/NAVL86/

Navlakha, J.K.;: "Minireview of Software Productivity Metrics", pp. 4-5, COMPSAC 86.

/NAVL87/

Navlakha, J.K.;: "A Survey of System Complexity Metrics", The Computer Journal, Vol. 30, No. 3,1987.

/ORTH74/

Orth, Bernhard: "Einführung in die Theorie des Messens", Verlag W. Kohlhammer, 1974.

/OVIE8O/

Oviedo, Enrique I.: "Control Flow, Data Flow and Programmers Complexity", Proc. of COMPSAC 80, Chicago IL, pp.146-152,1980.

/OULS82/

Oulsham, G.: "Unravelling Journal, Vol 25, No. 3,1982.

/PAIG78/

Paige, M.: "An Analytical Approach to COMPSAC 78, Chicago, 1978, pp. 527-532.

/PARI88/

Parikh, Girish: "Techniques of Program and System Maintenance", Second Edition, QED Information Sciences, Inc, 1988.

/PERL81/

Perlis, Alan; Sayward, Frederick, Shaw, Mary;: "Software Metrics:", An Analysis and Evaluation, The MIT Press, 1981.

/PIW082/

Piwowarski, Paul;: "A Nesting Complexity Measure", Sigplan Notices, pp. 44-50,, Vol. 17, no. 9 , 1 9 8 2 .

/POOR88/

Poore, J.H.: "Derivation of Local Software Quality Metrics (Software Lifecycle)", Software-Practice and Experience,, Vol. 18, No. 11, pp. 1017-1027, Nov. 1988.

Unstructured

Programs", The Software

Computer

Testing",

Proc.

11 References

583

/POTI82/

Potier, D.; Albin, J.L.; Ferreol, R.; Bilodeau, A.: "Experiments with Computer Software Complexity and Reliability", COMPSAC 82, pp.94-103..

/POZI81 /

Pozin, B.A.: "A Method of Test Structuring for Debugging", Programmirovanie, No. 2, pp. 98-103,1981.

/PRAT84/

Prather, Ronald E.: "An Axiomatic Theory of Software Complexity Measure", The Computer Journal, Vol. 27, No. 4, 340-347,1984.

/PRAT87/

Prather, Ronald E.: "On Hierarchical Software Metrics", Software Engineering Journal, March 1987.

/PRE 179/

Preiser, S.; Storm, I.L.: "An Index of Complexity for Structured Programming", IEEE Proceedings of the Workshop on Quantitative, Software Models, New York, 1979, pp.130-133..

/PRES82/

Pressmann, Roger S.: "Software Engineering: proach,", First Edition, McGraw Hill, 1982.

Practitioner's Ap-

/PRES87/

Pressmann, Roger S.: "Software Engineering: proach,", Second Edition, McGraw Hill, 1987.

Practitioner's Ap-

/PUTN78/

Putnam, L.H.: "A General Empirical Solution to the Macro Software Sizing and Estimating Problem", IEEE Transactions of Software Engineering, SE-4 (4), pp. 345-361, July 1978.

/RAMA82/

Ramamoorthy C.V.; Bastani F.B.;: "Software Reliability - Status and Perspectives", IEEE Transactions of Software Engineering, SE-8 (4), pp. 354-371, July 1982.

/RAMA84/

Ramamoorthy C.V.; Prakash, Atul; Tsai, Wei-Tek; Usuda, Yutaka: "Software Engineering: Problems and Perspectives", IEEE Computer, Oct. 84, pp.191-209..

/RAMA85/

Ramamoorthy C.V.; Tsai, Wei-Tek, Yamaura, Tsuneo; Bhide, Anupam: "Metrics Guided Methodology", COMPSAC 85, pp. 111-120.

/RAMA86/

Ramamurthy, Bina; Melton, Austin: "A Synthesis of Software Science Metrics and the Cyclomatic Number, COMPSAC 86, pp. 308-313.

/RECH86/

Rechenberg, P.: "Ein neues Maß für die Softwaretechnische Komplexität von Programmen.", Informatik Forschung und Entwicklung, pp.26-37, 1986.

/REDW85/

Redwine, Samule T.; Riddle, William E.: "Software Technology Maturation", IEEE Compsac, pp. 189-200,1985.

/REYN84/

Reynolds, Robert: "Metrics to Measure the Complexity of Partial Programs", The Journal of Systems and Software, No. 4, pp. 75-91,1984.

/RODR87/

Rodriguez, Volney; Tsai, W.T.;: "A Tool for Discriminant Analysis and Classification of Software Metrics", Software Development, Butterworth & Co, Vol. 29, No. 3, April 1987.

/ROBE79/

Roberts, Fred S.;: "Measurement Theory with Applications to Decisionmaking, Utility, and the Social Sciences", Encyclopedia of Mathematics and its Applications, Addison Wesley Publishing Company, 1979.

584

11 References

/RODR86/

Rodriguez, Volney; Wei-Tek, Tsai;: "Software Metrics Interpretation through Experimentation", COMPSAC, Oct. 86, pp. 368-374,1986.

/ROMB85/

Rombach, H.D.: "Quantitative Bewertung von Software Qualitätsmerkmalen auf der Basis struktureller Kenngrößen", Dissertation, Universität Kaiserslautern, 1984.

/ROMB87/

Rombach, H.D.; Basiii, V.R.: "A Quantitative Assessment of Software Maintenance: An Industrial Study", IN: Proc. Conf. on Software Maintenance CSM87, Austin (Texas), pp.134-144, Sept. 1987.

/ROMB89/

Rombach, H.D.; Bradford, T. Ulery: "Improving Software Maintenance Through Measurement", Proceedings of the IEEE, Vol. 77, No. 4, April 89..

/ROME83/

Romeu, Jorge L.; Gloss-Soler, Shirley A.: "Some Measurement Problems Detected in the Analysis of Software Productivity Data and Their Statistical Consequences", Proc. of the IEEE Computers Society's, International Computer Software and Applications, Conference (COMPSAC), Nov. 7-11,1983..

/ROTH 87/

Roth, Christian: "Ein Verfahren zur Quantifizierung der Strukturiertheit von Software", ln:Software - Metriken: Arbeitsgespräch der Fachgruppe Software Engineering, IBM Bildungszentrum Herrenberg, 12.-13.3.87.

/RUBE68/

Rubey, R.J.; Hartwick, R.D.: "Quantitative Measurement Program Quality", ACM, National Computer Conference, pp. 671-677,1968.

/SAMA87/

Samadzadeh-Hadidi, Mansur: "Measurable Characteristics of the Software Development Process Based on a Model of Software Comprehension", Dissertation, University of Southwestern, Louisiana, USA, May 1987.

/SCHA73/

Schaefer, Marvin: "A Mathematical Theory of Global Program Optimization", Prentice Hall, 1973.

/SHATZ86/

Shatz, S.M.;: "On Complexity Metrics oriented for Distributed Programs", COMPSAC 86, pp. 247-253.

/SCHM84/

Schmidt, Monika:: p. 41-46,1984.

/SCHM85/

Schmidt, Monika;: "Ein Komplexitätsmaß basierend auf Entscheidungen und Verschachtelungen", In: 13. Fachtagung Technische, Zuverlässigkeit., Nürnberg, VDE-Verlag GmbH Berlin, Offenbach,, Mai 1985.

/SCHM85a/

Schmidt, Monika;: "A Complexity Measure Based on Selection and Nesting", ACM SIGMETRICS-Performance Evaluation Review,, V13, No. 1, June 85.

/SCHN79/

Schneidewind, N.F.;: "Software Metrics for Aiding Program Development and Debugging", National Computer Conference, 1979, pp. 989-994.

/SCHN79a/

Schneidewind, N.F.; Hoffmann, H-F.: "An Experiment in Software Error Data Collection and Analysis", IEEE Transaction on Software Engineering, Vol. SE-5, No. 3, May 1979, pp.107-117.

"Das Aktuelle Schlagwort.",

Informatik

Spektrum,

11 References

585

/SHAB88/

Shabalin, A.N.: "Growth of Complexity of a Developing Program", Programmirovante, No. 6, pp.23-28, Nov.-Dec. 1988.

/SHEP88/

Sheppard, Martin: "An Evaluation of Software Product Metrics", Information and Software Technology, Vol. 30, No. 3, April 1988, pp. 177-188..

/SHER85/

Sherif, Y.S.; Steinbacher J.: "Computer Quality Measurements and Metrics", Microelectronics and Reliability, Vol. 25, No. 6, pp. 1105-1150, 1985.

/SMIT88/

Smith, R.: "Glossary of Terms", November 1988, RT31:QGS002, Issue 2.0.

/STET81/

Stetter, Franz: "Software Technologie", Wissenschaftsverlag, Bibliogrpahisches Institut, Mannheim, Zürich, 1981.

/STET84/

Stetter, Franz: "A Measure of Program Complexity", Computer Languages, Vol. 9, No. 3/4, pp.203-208, 1984.

/STEV46/

Stevens S.S.: "On the Theory of Scales and Measurement", Science 103, 1946, pp. 677-680.

/STEV59/

Stevens S.S.: "Mathematics, Measurement, and Utility", IN: C.W. Churchmann and P.Ratoosh (eds.)„ Measurement: Definition and Theories, Wiley,, New York, pp. 18-63,1959.

/STIC78/

Stickney, M.E.: "An Application of Graph Theory to Software Test Data Selection", ACM Software Engineering Notes, Vol. 3, No. 5, pp. 72078, Nov. 1978.

/SULL75/

Sullivan, J.E.: "Measuring the complexity of Computer Software", Mitre Corporation, P.O. Box 208, Bedfort, MA 01730,.

/SZEN82/

Szentes, J.: "SOMIKA An Automated System for Measuring Software Quality", In: /Software Qualitätssicherung/, German, Chapter od ACM, pp. 188-202, 1982.

/SZEN86/

Szentes, J.; Gras, J.: "Some Practical Views of Software", Complexity Metrics and a Universal Measurement Tool, First Australian Software Engineering Conference, Canberra, May 14-16,1986..

/SZUL81/

Szulewski, P.A.; Whitworth, M.H.; Buchan, P.; DeWolf, J.B.: "The Measurement of Software Science parameters in Software Designs", ACM SIGmetrics, Spring 1981, pp. 75-92.

/TAI80/

Tai, Kuo Chung: "A Program Complexity Metric Based on Data Flow Information in Control Graphs", pp. 239-249, COMPSAC, 1984.

/TARJ80/

Tarjan, R. E.; Valdes, J.: "Prime Subprogram Parsing of a Program", Conference Record of the Seventh Annual, ACM Symposium on Principles, of Programming Languages (Las Vegas, NV)., New York: ACM. 95-105..

/TAYE78/

Tayer, Thomas A.; Lipow, Myron; Nelson, Eldred C.: "Software Reliability: A Study of Large Project Reality", North Holland Publishing Company, 1978.

/TSAI86/

Tsai, W.T.; Lopez, M.A.; Rodriguez, V.; Volovik, D.: "An Approach Measuring Data Structure Complexity", COMPSAC 86, pp. 240-246.

586

11 References

/WAGU87/

Waguespack, Leslie J.; Badlani, Sunil: "Software Complexity Assessment: An Introduction and Annoted Bibliography", ACM SIGSOFT, Vol 12, No. 4, pp.52-71, 1987.

/WALS79/

Walsh, T.: "A Software Reliability Study Using a Complexity Measure", Proceedings National Computer Conference, 1979, pp.761-768.

/WEBS73/

Webster: "Webster's New Collegiate Dictionary", Meriam, Co., 1973.

/WEIN75/

Weinberg, G.M.; Geller, D.P.; Plum, T.W-S.: "If-then-else Considered Harmful.", ACM Sigplan Notices 10(8), pp.34-44,1975.

/WEYU85/

Weyuker, Elaine J.: "Evaluating Software Complexity Measures", Januar 85, Technical Report #149, Courant Institute of Mathematical Sciences, 251 Mercer Street, New York, N.Y. 10012.

/WEYU88/

Weyuker, Elaine J.: "Evaluating Software Complexity Measures", IEEE Transactions of Software Engineering, Vol. 14, No. 9, Sepr. 88..

/WHIT80/

Whitworth, M.H.; Szulewski, P.A.;: "The Measurement of Control Flow and Data Flow Complexity in Software Designs.", Proc. of 4th Computer Software and Applications, Conference, IEEE Oct. 80,pp.735-743..

/WILL77/

Williams, M.H.: "Generating Structured Flow Diagrams: The Nature of Unstructuredness.", The Computer Journal 20(1), pp.45-50,1977..

/WOOD79/

Woodward, M.R.; Hennell, M.A.; Hedley: "A Measure of Control Flow Complexity in Program Text", IEEE Transactions on Software Engineering, Vol. 5, pp.45-50,1979.

/YAU80/

Yau, S.S.; Collofello, J.S.; MacGregor, T.M.: "Some Stability Measures for Software Maintenance", Proc. COMPSAC, 1978, pp.60-65.

/YIN78/

Yin, B.H.; Winchester, J.W.: "The Establishment and Use of Measures to Evaluate the Quality of Software Designs", Proc. ACM Software Quality Ass. Workshop, 1978, pp.45-52.

/ZOLN81/

Zolnowski, Jean, Cochrane; Simmons, Dick, B.;: "Taking the Measure of Program Complexity", National Computer Conference, pp. 329-336,1981.

/ZUSE85/

Zuse, Horst: "Meßtheoretische Analyse von statischen Softwarekomplexitätsmaßen", TU-Berlin 1985, Fachbereich Informatik,, Dissertation im FB 20 (Ph. D. Thesis).

/ZUSE87/

Zuse, Horst; Bollmann, P.: "Using Measurement Theory to Describe the Properties and Scales of Static Software Complexity Metrics", IBM Thomas Watson Research Center, Yorktown Heights, RC 13504,1987.

/ZUSE89/

Zuse, Horst; Bollmann, P.: "Using Measurement Theory to Describe the Properties and Scales of Static Software Complexity Metrics", Sigplan Notices, Vol. 24, No. 8, pp.23-33,, August 89.

/ZUSE89/

Zuse, Horst: "User Manual of the System MDS (Measure Demonstration", System), Internal Report at the Department of Computer, Science, Technische Universität Berlin-West, FR 5-3, Franklinstraße 28/29,1990.

Name

Index

Adamov ... 140 Aho ... 515,526 Albrecht ... 34,61 Allen ... 221 Bache ... 3-5,60-61,90,92,95,97,100, 139, 146, 191, 296-302, 309, 319, 329, 545, 566 Baker ... 1, 30-31, 67, 69, 83, 89, 93, 101, 103-106,133-134, 137, 139, 185-187, 202, 216, 221, 224-225, 235, 238-241, 244-247, 252, 272, 287, 289, 336-337, 348, 352, 366, 383, 385-387, 400-401, 403-405, 410, 412-414, 432-437, 441, 444, 449-450, 452-455, 458, 464, 468-471, 482-484, 490-491, 493, 505, 520-522, 525, 527, 545, 565, 567, 569 Basili ... 32,35,538,551,561 Belady ... 25,89,100,114-115,139, 265, 362-366, 368-369, 371-373, 400, 413, 431,519 Benyon-Tinker ... 34 Berge ... 101,154,179 Bhide ... 1 Blaine ... 30 Blaschek ... 265,345-346,348,352, 355-357, 359-361,518 Boehm ... 28, 80 Bohrer ... 145 Bollmann ... 23, 57 Bowles ... 140,216,561 Bradford ... 27 Caswell ... 29 Chapin ... 34,139 Chen ... 32,250,252-255,257-258, 260-263, 433, 435, 516 Cherniavsky ... 23, 47 Cheung ... 3,37,139,562 Cocke ... 221 Conte ... 25,146 Cook ... 139 Cote ... 25 Curtis ... 30,34

Davis ... 139 DeKock ... 3 DeMarco ... 44 DeMillo ... 29 Dijkstra ... 58, 78-79, 234, 298, 302 Dingee ... 145 Dunsmore ... 32-33,139-140,265, 269-270, 272-273, 276, 280, 300, 363, 400, 413, 431, 433-434, 436, 517, 519 Ejiogu ... 1-2,118-119,265,333-335, 338-339, 342-344, 346, 518, 567, 570 Elshoff ... 145 Emerson ... 34,138 Evangelisti ... 30,88-89 Fenton ... 32,48,77,92,100,146,200, 205, 265, 280, 296-299, 304, 309, 320-321, 328-329, 545, 562 Finkelstein ... 43 Fishburn ... 46, 51 Fitzsimmons ... 145 Frewin ... 29 Gaffney ... 34 Gannon ... 72,139-140,265,269-270, 272-273, 280, 300, 363, 400, 431, 433-434, 436,517, 519 Gilb ... 133,163,170-173,175,177-178, 200, 513 Glass ... 26 Gordon ... 145 Grady ... 29 Gras ... 35, 37,123,179,193, 514 Hall ... 139,169,332 Halstead ... 1-2,7,9,25,27-29,33,35, 92, 138-139,142-145, 169, 334, 415-416, 436, 533, 543, 546, 551, 562, 564, 568 Hamer ... 29, 562 Hansen ... 93

Name Index

588

Harrison ... 3,9,12,30,35-36,83,89, 94-95, 97, 101, 138-139, 280, 373, 400, 403-405, 412-418, 424-425, 427-430, 433, 435-436, 440-441, 458, 464-465, 488, 490, 520-521, 568 Hassan ... 234-235,237,240-241,515 Hecht ... 1,9,25,72,81-83,101,133, 221-224, 229-231,233-235, 238-240, 251, 374, 436, 458, 469, 515, 524-526, 543, 568, 572 Hedley ... 83, 92,138, 458-459, 462, 524 Hennell ... 83,138, 458-459, 462, 524 Henry ... 1,28,34-36,169,563 Herbold ... 72 Howatt ... 1, 30-31, 67, 69, 83, 89, 93, 101, 103-106,133-134, 137, 139, 185-187, 202, 216, 221, 224-225, 235, 238-241, 244-247, 252, 272, 287, 289, 336-337, 348, 352, 366, 383, 385-387, 400-401, 403-405, 410, 412-414, 432-437, 441, 444, 449-450, 452-455, 458, 464, 468-471, 482-484, 490-491, 493, 505, 520-522, 525, 527, 545, 565, 567, 569 IEEE ... 2,29,571 Itzfeld ... 36 Iyengar ... 139 Jayaprakash ... 3,31,96-97,138, 460, 463, 545 Kafura ... 1,28,34 Kaposi ... 32,77,146,200,265,280, 296, 299, 304, 320-321, 328-329, 545 Kemmerer ... 30 Kernighan ... 88-89 Kitchenham ... 28 Kodres ... 58 Krantz ... 41,46,51 Kriz ... 41-42, 54,106,145, 554, 561, 563, 568 Lakshmanan ... 31,96-97,138,460,463 LeBlanc ... 139 Lengauer ... 101

Levitin ... 146,149 Lewis ... 35-36,169,563 Lichtblau ... 58 Lipaev ... 139 Lipow ... 140 Upton ... 37 Lister ... 145 Lopez ... 87,100 Love ... 145 Luce ... 50-51,165 Müllerburg ... 139 Magel ... 3,9,30,35-36,83,89,94,97, 101, 138-139,280,373, 400, 403-405, 412-418, 424-425, 427-430, 433, 435-436, 440-441, 458, 464-465, 488, 490, 520-521, 568 McCabe ... 1, 5, 9,12, 21, 25, 28-30, 32-33, 35-36, 39, 44, 51, 53, 55, 62-65, 71, 82-83, 88-89, 92-93, 97, 100-101, 108,111, 120, 125, 139-140,145,151-155,159-163, 165,167-170,172,175-178, 206, 210, 234, 239,241,269,300, 304-305, 332, 363, 374-375, 382, 385, 387-388, 399, 436, 458-459, 464-465, 469, 472, 489, 491, 513-515, 521, 539, 543, 545, 551, 562, 565, 568, 570 McCall ... 28 Melton ... 139 Moawad ... 234-237,240-241,515 Munoz ... 139-140 Myers ... 140 Narens ... 46, 51 Nelson ... 140 Oulsham ... 20-21,83-84,458 Oviedo ... 1, 60, 92,133,195-199, 513, 524, 568 Paige ... 206 Piwowarski ... 17,83,89-90,94,97, 100, 138-139,400,403,416, 432-433, 457-458, 460, 462, 464-467, 470-472, 475-477, 481-484, 486-491, 500, 503-504, 509, 520-522

589

Name Index

Plauger ... 88-89 Potior ... 170,172,176 Pozin ... 139 Prather ... 92,100,139,265,281-285, 290-296, 320, 325, 329, 458, 548 Preiser ... 265,330-332,517 Pressmann ... 45, 58, 95 Putnam ... 28 Ramamoorthy ... 1-2,139 Rechenberg ... 139 Reiter ... 561 Reynolds ... 28,34,139 Richter ... 140 Roberts ... 26-27,39,41,45-46,50-51, 128 Rodriguez ... 87,100 Rombach ... 27, 538 Romeu ... 36, 564 Roth ... 374-375,378,380-382, 387-388, 399, 519-520 Rubey ... 1,25 Samadzadeh-Hadidi ... 140 Schmidt ... 123,374-379,385-388, 395-399, 519-520, 539, 568 Schneidewind ... 160,200,242, 244-245, 247, 249, 515-516 Shabalin ... 139 Sheppard ... 2, 33 Sherif ... 32 Sinha ... 31, 96-97,138, 460, 463 Standard ... 2 , 2 9 Stetter ... 139 Stevens ... 43 Stickney ... 206 Storm ... 265,330-332,517 Stroganova ... 139 Sullivan ... 34 Szentes ... 35-37,123,170,172, 176, 179, 193, 514,572 Szulewski ... 34,101,123,206-208, 210,215-216,218, 513, 570 Tai ... 60,139 Tarjan ... 72,101 Tayer ... 140 Timm ... 36 Tsai ... 1,87-88,97,100

Valdes ... 72,101 Volovik ... 87,100 Waguespack ... 25 Walsh ... 160 Webster 35 W e y u k e r 3 - 5 , 45, 48, 60-61, 92-96, 100, 119,191,199, 545, 564, 566 Whitty ... 77 Whitworth ... 101,123,206-208,210, 215-216,218, 513,570 Williams ... 20-21,83-84,458 Winchester ... 34 Woodward ... 32,83,92,138,458-459, 461-462, 524 Yau ... 34 Yin ... 34 Zolnowski ... 140 Zuse ... 23, 36, 45, 58, 94, 97, 138-139, 374-375, 390, 460, 462, 506, 519

Subject

Index

absolute scale ... 43, 45, 96,137,150, 203-205, 532, 534, 542, 571 adding function ... 128,134,148, 165-166, 173, 198, 203, 231-232, 240, 247, 253, 262-263, 276, 292-293, 297, 316, 318, 327, 331, 371, 397, 429, 454-455, 462, 486, 508 additive property ... 50, 97,111, 152, 234, 567 additivity ... 44-45,65,97-98,100,564 admissible transformation ... 43-46,64, 557, 569, 571 air pollution ... 26 air quality ... 44 algorithmic complexity ... 28, 33, 565 analyze measure ... 33 antiquity ... 49 archimedian axiom ... 50, 57, 59, 62, 97, 101, 116,120, 128, 137, 232, 240, 278, 280, 316-317, 531-532, 534, 539-540, 565 arithmetic mean ... 3, 7, 22-23, 43-46, 49, 280, 533, 557, 565 artefacts ... 34 assemble ... 459 assembly ... 79 assembly language ... 44,84, 459 assignment statement ... 80 associativity ... 50, 57, 59-60, 97,101, 115-117, 120,128, 137,219,240, 248-249, 276, 278, 293-294, 315-316, 318, 327-328, 343-344, 360, 372, 429-430, 454-455, 487, 508, 531-532, 534, 536, 539-540, 565

atomic modification ... 4-5,39,51-57, 63-65, 99-101, 106, 110-113, 115, 120-127, 129-131,133-135, 147-149, 161-164,167-169, 171-172, 175,177-178, 185-188, 192, 197-199, 202-204, 216-217, 219-220, 229-230, 232, 237-240, 245-247, 249, 260-263, 267-268, 273-276, 278, 290-292, 294, 309-314,318, 325-328,331, 338-342, 344, 352-357, 361, 366-370, 372, 386-395, 398, 425-430, 437, 450-454, 456, 461-462, 483-487, 504-507, 509, 512-514, 520,523,529-531, 536-537, 554, 557, 560, 563-566, 569-570 BALT ... 58-61,100-101,112,114-117, 127-128, 130-131, 133-134, 136-137, 143,148-149, 152, 165-169, 173-175, 177-178, 188, 191-193, 198-199,203-205, 218-220, 230-233, 240-241, 247-249, 262-264, 276-280, 292-294, 314, 316-319, 327-328, 331, 343-344, 357, 360-361, 371-373, 395, 398-399, 429-431, 454-457, 462, 486-488, 507-509, 531-532, 534, 536, 540-542, 566 base ... 7,151-152,159,193, 206-207, 209-211, 216, 220, 234, 297, 333, 345, 413, 489-490, 500, 558, 565, 570 behaviour ... 2 , 1 2 , 1 7 , 2 1 , 3 9 - 4 0 , 5 4 , 104, 134, 168, 212, 227, 237, 249, 290, 303, 305, 334, 373, 437, 443, 511,567 behaviour/property ... 4 7 , 6 6 , 1 3 3 , 5 7 1

Subject Index

binary operation ... 5, 40-41, 46, 49-51, 57-62, 65, 90, 92-93, 96-97, 100-101, 111-112,114-120, 127-128, 130-131, 134, 136-137, 139,143-145,148-149, 151-152, 165-169,173-175,177-178, 188-189, 191-193,198-199, 203-205, 218-220, 228, 230-234, 240-241, 247-249, 253, 262-264, 269, 276-280, 292-294, 314-319, 327-328, 331, 342-344, 357-361, 371-373, 395-399, 429-431, 443, 454-457, 462, 486-488, 504, 507-509, 531-534, 536, 539-542, 545, 554, 557-558, 564, 566 binary predicate ... 67-68, 566 bjn-structure ... 80-81 black-box ... 2 bottom-to-top-to-bottom ... 568 brightness ... 26, 41 B S E Q ... 58-62,65,90,92-93,96-97, 100-101, 111-112,114-120, 127-128, 131,133-134, 136-137, 139,143-145, 148-149, 151-152, 165-169, 173-175, 177-178, 188-189, 191-193, 198-199, 203-205, 218-220, 228, 230-234, 240-241, 247-249, 253, 262-264, 269, 276-280, 292-294, 314-319, 327-328, 331, 342-344, 357, 359, 361, 371-373, 395-399, 429-431, 443, 454-457, 462, 486-488, 507-509, 531-534, 536, 539-542, 545, 554, 557, 559, 566 bushiness ... 334, 570 change-metric ... 553 chi-square ... 42, 566 code measure ... 2, 33 cohesion ... 2,138,564 collected data ... 561 commutativity ... 57,59-60,91-92, 95-98, 100-101, 114, 116-118,120, 137, 139, 191,531-532,534, 539-540, 565 completeness ... 37, 47-48, 92, 572

591

complexity measure ... 1-2,4-5,25,28, 30, 32-33, 36-37, 39, 49, 55, 57, 60, 62, 64, 66-67, 87-89, 91-94, 99, 115, 128, 138-139, 149-150, 154, 191, 199, 206, 233, 269, 334-335, 363, 511, 530, 546, 560, 563, 565, 568 comprehension ... 34 comprehensive ... 552 computational ... 3 1 , 3 3 , 4 0 , 5 6 6 computational complexity ... 2, 28, 31, 160, 565 computer-aided ... 169 concatenation ... 3, 40-41, 58, 60, 90, 94-96, 127-128, 144, 149, 152,165, 169, 174, 228, 253, 360, 396, 566, 569 concatenation operation ... 4-5, 45, 58-59,92,511,566-567 connected graph ... 70-71, 85,154, 566 consistency ... 87, 99 control flow ... 30-31,60,83,88,95-98, 160,176,195, 199, 207-208, 250, 413, 416, 436, 458, 482, 490-491, 567-568 control measure ... 32 correlation ... 169, 562, 566 correlation coefficient ... 42,145,566 cost ... 28,30 coupling ... 2, 564 coverage ... 32, 281 cyclomatic number ... 1, 28, 35-36, 71, 85,92, 151, 154, 157, 169,209, 565-566, 568 d-structure ... 79-80,260,524 d-structures ... 11, 78-80, 84, 101, 250, 252-254, 256,413 data analysis ... 27 data flow ... 1-2,28, 60, 87, 94,139, 195-196,199, 208, 564, 566, 568 data structure ... 87-88, 566 decomposeable ... 18,72,570 decomposition ... 2, 9, 72-73, 75, 77, 83, 99-100,152, 265-267, 296-298, 319-322, 333, 345, 356, 413, 458, 515, 517-518, 521,567, 572

592

decomposition tree ... 74-76, 84, 92, 101, 134, 266, 273-275, 290, 292, 297, 299, 311, 325-326, 339, 345, 347, 353-356, 518, 523-524, 526-527, 529, 537, 544, 548, 567, 569-571 dependant paths ... 568 descriptive ... 33, 40, 566-567 descriptive approach ... 4,39-40,128, 133, 563,567 descriptive measure ... 2, 32 design ... 2,27,87,159-160,206-208, 334, 572 design complexity ... 140 design diagrams ... 33 design measure ... 2, 33 design metric ... 34 design phase ... 33,160 discrete ... 58, 572 dislikes ... 26 distance ... 29,345-346,570 do-while-loop ... 8 5 , 1 3 6 , 2 6 6 , 2 8 3 do-while-structure ... 200, 299 documentation ... 32-33 dominance tree ... 5, 9, 71 -72, 84,101, 103, 374-377, 388-390, 401, 405-408, 519-520, 528, 544, 548 dominator ... 71, 221, 374, 400-401, 404, 406-407, 494-496 dynamic ... 566 dynamic measure ... 32 D1 ... 85, 136, 200, 250, 253-254, 256-258, 260-261, 266-267, 274, 281-282, 290, 297-299, 304-305, 313, 321-324, 330, 355, 524, 528 D2 ... 85, 136, 200, 253, 266, 281-284, 290, 297-299, 304, 323, 330 D3 ... 85,136,266,297-299,304 educational toolkit ... 34 effort ... 1,28,31,34-36,61,142-143, 145,159,208, 250,561,564 Egypt ... 25 elevation measure ... 345 empirical knowledge ... 39 empirical relation ... 40-42, 47-49, 51, 54-55, 57, 65, 85, 99,128,133,135, 138,150, 546, 549, 560-563, 565, 567

Subject Index

empirical subrelation ... 49,51,54-55, 57, 64-65, 85, 567 engine ... 560 entry-node ... 73-74, 76,78, 84, 97, 154, 270, 299, 338, 362, 439, 444, 446, 468-471,495, 567-568 estimation ... 28 evaluation ... 1, 7, 23, 47,193, 216, 551, 561 events ... 43,570 execution path ... 69-70, 403 exit-node ... 58, 62, 67-68, 72, 74, 76, 84, 90, 97, 128,133, 136, 139, 154, 206, 291, 297, 299, 374-377, 388, 424, 426, 434, 459, 567 experiment ... 46, 562-563 explosion number ... 333-335, 339, 526, 567 extensive attributes ... 49 extensive measurement ... 4, 49-50, 59, 169 extensive structure ... 4-5,39,49-51, 57-59, 62, 64-66, 91-98, 100-101, 106, 111-112,114-116, 118-120, 127-131, 133-135,137, 145, 148-149, 165-168,173-175, 177-178,188,190-193,198-199, 203-205, 218-220, 230-233, 240-241, 247-249, 262-264, 276, 278-280, 292-294, 314, 316-319, 327-328, 331-332, 342-344, 357-361, 371 -373, 375, 395, 397-399, 418, 429-431, 454-457, 462, 486-488, 507-509, 511, 531-534, 538-542, 545-547, 553-554, 564-567, 571 fault measure ... 33 Fenton-Whitty ... 72-74,78-79,84,99, 101, 133-134,152, 164, 200, 258, 265-267, 269, 281, 293, 296-297, 299, 304, 309, 324, 333, 345, 525, 538, 567 finds ... 25 football players ... 44 function point ... 34 fundamental measure ... 39 fundamental science ... 39

Subject Index

593

G L B ... 85,400,403-407,409-410,425, 439, 450, 453, 464, 525-526, 568 graph theory ... 58,250,514

intuitive decision ... 7 intuitively ... 3 1 , 3 9 , 9 5 , 9 7 , 2 2 2 , 5 4 3 , 568

hardness ... 44 header ... 81-82,221,251,568-569 hierarchical ... 72,139,568 hierarchy ... 571 history ... 25, 32 homomorphism ... 4, 39, 41, 64, 88, 99, 203-205, 568 human brain ... 561 hybrid-measure ... 399, 489, 568 hypotheses ... 4, 37,128,133, 538, 562

kelvin scale ... 44-45 knot ... 93,459,462,524

if-then-eise-structure ... 78, 85, 136, 200, 253-254, 256, 260-261, 266, 299, 469, 524 if-then-structure ... 79,85,136,200, 266, 299, 323, 451 immediate dominator ... 71, 374, 400-401, 404, 406, 494 immediate processor ... 67 immediate successor ... 67-68, 403, 405, 569 independency ... 96 intelligence ... 26,41-42,44 inter-modular ... 34,140, 531, 564, 568, 570 interaction ... 35, 83, 95,160, 248, 396, 430, 458 interface ... 34 interpretation ... 4, 7, 27, 40, 42,54-55, 57, 99, 106-110, 112-114, 154, 346, 364, 470, 474, 499, 554-556, 561-562, 564, 566-568 interprocedural ... 568 interrupts ... 566 intersection ... 32, 251 interval ... 3, 28, 37, 44, 81, 96, 145, 221,229,524,557, 568 interval scale ... 3, 36-37, 39, 43-46, 62, 95-96,137, 532, 565-566, 570-571 intra-modular ... 2 - 5 , 7 , 3 4 , 9 9 , 1 0 2 , 1 0 7 , 133, 138,151, 538, 542, 545-547, 549-550, 563-564, 568, 570 intuitive ... 12,22,25,30-31,41,47-48, 51,57, 59,91,95, 99,119,123, 215, 328, 334, 338, 352, 511, 530, 533, 563, 568

LB ... 85,252-253,400,403-404,569 leaves ... 2 7 , 7 6 , 8 1 , 2 2 1 , 2 9 7 , 3 3 3 , 3 3 9 , 345-347, 349, 354, 360-361, 518, 526, 569 life-cycle ... 29, 32, 34,159, 572 likes ... 26 linear flowgraph ... 79,83-84,93,96, 138, 458-460, 462-463, 524 logical complexity ... 2,170,172,241 loop ... 81-83,93,222-223,225, 229-230, 234-235, 238, 241, 286, 362, 379, 387, 399, 405, 409, 412, 421, 435, 439, 441, 444-445, 453, 469, 482,515,524,526,569 loop-effect ... 20, 221, 234, 239, 241, 433, 435-436, 457, 515, 543 loop-predicate ... 235, 238, 401, 436, 438, 441, 444-446, 449, 452-453, 525, 548, 569 loudness ... 2 6 , 4 1 , 4 5 lower bound ... 9, 85,101, 252, 400-401, 403-409, 413, 450, 464, 568-569, 571 lower limit ... 35 macro-level measure ... 570 maintainability ... 1, 3, 7, 25, 30, 35, 49, 93, 458,530,551,561-564 maintenance ... 1,27, 31, 35,309, 562, 572 management ... 32-33, 458, 562 manager ... 3 - 4 , 3 1 , 4 8 , 9 9 , 5 1 1 , 5 3 8 , 568 manhattan ... 570 mass ... 30, 39, 45, 49-50 mathematical ... 30, 34, 42, 54, 87-88, 91,169, 200, 319, 400, 404, 433, 515 520 M D S ... 5,7,9,68,72,99-103,106-110, 112, 115,134, 136-137, 139, 283, 293, 298-299, 330, 424, 466, 512, 569

594

meaningful ... 3,26-27,37,43,45-46, 96,107, 145, 280, 299, 533, 557, 564-565, 569 meaningfulness ... 4, 27, 39, 43, 45-46, 557, 569 measure chump ... 44 measure limits ... 35 measurement goal ... 27, 98, 542 measurement process ... 7,40, 46, 88, 241,538, 551-553,557, 568 measurement scale ... 36, 44 measurement theory ... 3-4, 36-37, 39, 41,47, 62, 65, 88, 94, 100, 120, 128,131,133, 138, 205, 511, 566, 571 median ... 42,145, 280, 557, 565 merit ... 26-27 M E T K I T ... 34, 563 metric ... 27-31, 87-88, 90-91, 93, 97-98, 193, 299, 309, 538, 561, 563, 570 metrication ... 29, 91 micro-level measure ... 7, 570 micro/macro complexity ... 139 minimal base ... 101,206-212,220,570 modifiability measure ... 33 modularity measure ... 33 monadicity ... 333-334, 570 monotonic transformation ... 64,111, 120, 125,151, 163, 170, 172, 175, 252, 280,514, 516, 540,557 monotonicity ... 5 0 , 5 7 , 5 9 , 6 1 , 6 6 , 91-98, 100-101,114, 116, 118-120, 128, 137, 144-145, 173-174, 177, 190, 199,218, 248, 277-278, 342-344, 359, 397-399, 430, 531-534, 539-540, 564-565 nesting ... 9,18,73, 77, 84, 89-91, 97-98, 120, 139, 160, 168, 222, 265-266, 268-270, 280-282, 291, 294, 296-297,300-301, 303-305, 309, 312-314, 319-320,322, 325-326, 329, 334, 348, 353, 361, 363, 375, 379, 382-383, 387-388, 399, 416, 432-434, 436, 450, 464, 467, 471, 474, 491, 524, 534, 543, 545, 548, 566

Subject Index

nesting level ... 9, 30, 32, 74, 76, 84, 115,137,139,260-261,266, 269-272, 275-276, 280, 284-286, 290-292, 297, 299-303, 311-313, 335, 339, 345, 349, 354-355, 361-363, 365-366, 388, 400, 410, 412-419, 425, 427-428, 431-433, 436-437, 439, 450, 452, 455, 457, 520, 524-528, 571 network ... 58 network complexity ... 139,169,332 nominal ... 96 nominal scale ... 43-44,137,532,547, 571 non-negative ... 92-93,96 non-parametric ... 44, 564 non-trivial ... 73,75,133, 256, 274, 286, 291, 297, 299, 302, 311, 355 normalized measure ... 362, 520, 538-539 normative ... 40, 566 normative approach ... 566 numerical ... 1 , 4 2 , 4 6 , 5 0 , 5 4 - 5 5 , 6 3 , 9 6 , 107, 112-113, 296, 561, 564, 568 ordinal ... 3-4,36-37,39-40,43,48, 50-51,62,96,99, 107, 120, 128-129, 450, 561,570 ordinal level ... 36 ordinal scale ... 3-5,21,36-37,43-44, 46-47, 49-51, 56-57, 59, 63-65, 93, 96,98,100-101, 107, 111, 116, 120, 123, 125,127-128, 130-131, 133-138, 148, 163, 198, 262, 275, 280, 292, 311-312, 356, 369, 428, 452, 454, 486, 511-512, 514, 516, 523, 531-532, 539, 557, 564-566, 570-571 organization ... 29, 32, 538, 568 overlapping range ... 386-387, 446, 462, 467-468, 484, 490, 500-501, 505-507, 527-528, 554 pair ... 55, 67, 123, 140, 497, 501, 505, 528 partial property ... 52-56,85,110-111, 114-115, 121-122, 124-125, 135, 168, 275, 427-428, 489, 512-514, 529-530, 537, 542, 563, 567, 570

595

Subject Index

path ... 9,67,69,71-73,82-83,85,89, 101, 103, 152-159, 195, 200-201, 204, 206-210, 212-213, 222, 243, 251, 261, 281, 374-377, 388-390, 400-405, 415, 441, 448, 457, 464, 469-472, 494-495, 528, 548, 567-569 Pearson ... 566 percentage ... 21, 558-559 percentage calculation ... 45 performance ... 30,560 person ... 22,48-49,54-55,57,59-61, 65,115,131, 294, 530, 542, 561, 567-568, 571 physical ... 2 6 , 3 0 , 3 5 , 4 1 , 5 0 , 8 9 , 1 5 3 physical science ... 29,39 physics ... 3-4, 26, 39, 41 portable ... 30 possible paths ... 101,155-158,200, 202, 208 postdomlnator ... 72,374-377 pre-experimental ... 561 predicate ... 80, 235, 252, 261, 403, 410, 412, 414, 426, 433, 436, 438, 446, 449, 453, 464, 469-470, 482, 490-491, 526, 567, 570 predicate node ... 67,69, 252,404-405, 425, 428, 436, 450, 453, 464, 490, 524-525 predictive ... 33 preference ... 26, 44 prime ... 72-77,84-85,90-92,101, 133-134,152-153,163-164, 200, 202-203, 256, 265-266, 268-270, 273-276, 281-286, 290, 292, 294, 296-297, 299-301, 303, 307-313, 317, 319, 324-326, 331, 333, 339, 345, 347, 353-356, 362, 366, 369, 517-518, 523-524, 526-530, 537-538, 544, 548, 567, 569-572 probabilities ... 25 procedure node ... 68-69, 74, 77, 85, 254-255, 260, 265, 296, 299, 306, 309-310, 425, 450, 526, 529 process measure ... 2,32-33 product measure ... 2, 32-33,571 productivity ... 1,27-28,36,250,334 productivity measurement ... 36

program complexity ... 1, 30-31, 34-35, 44, 48-49, 95, 99, 127, 139, 252, 380, 413, 436, 458, 542 program quality ... 195 program version ... 27, 557-558, 561 program-change-metric ... 33 project ... 3,28-30,33-35,83,265,281, 296, 302-303, 305, 309, 318-320, 458, 563, 571 project size ... 36 proper subflowgraph ... 73 psychological ... 2 , 1 6 0 , 3 3 4 , 5 6 3 psychological complexity ... 1, 28, 30-31, 33,160, 571 psychological friends ... 34 quality measure ... 2, 27, 571 Q U A L M S ... 571 quantifyable ... 25 quantitative ... 26-27,29-31,571 range ... 36,84-85,134,186-187,216, 245-247, 338, 362, 379, 386-387, 404-405, 409-410, 412, 414-415, 421, 423, 425-426, 428, 433, 435-436, 438-439, 441, 444-451, 453, 457, 468-472, 476-484, 491-492, 494-497, 501-502, 505-507, 524-528, 548, 565, 567, 571 ranking ... 12,14,18,21-23,55,97,99, 107, 121,130, 215-216, 290, 337-338, 352, 382, 385, 417, 464, 466, 511, 557, 566 ratio ... 3, 37, 48, 96,120,137,145, 205, 491, 498, 500, 509, 532 ratio scale ... 3-5, 21, 36-37, 39, 43-46, 49-51, 57, 62, 64-66, 91-92, 94-100, 107, 111-112,114-115, 119-120, 127-131, 133-138,145, 148-149, 165-166, 169, 173, 177-178, 188, 198-199, 203-204,218,220, 230-231, 234, 240-241, 247-248, 262-263, 276, 280, 292-294, 314, 316, 318,327,331,342,344, 357-358, 371, 395, 399, 429, 431, 450, 454-455, 458, 462, 486, 507-509, 531-534, 539-542, 545, 547-548, 554, 557-559, 561, 564, 571

596

readability ... 34, 93 real number ... 41,48, 64-65 real scale ... 4 1 , 4 3 , 4 8 , 5 7 1 receiving node ... 67-68, 84, 265 reducibility ... 9, 81-83,101,152, 223, 233, 458, 547, 572 reducible ... 17,63,82-84,133, 221-225, 229-230, 233, 235-236, 238, 260,387,440,458, 515, 523-525, 543 reference programs ... 66, 558, 560 reflexivity ... 47 relational system ... 4, 39-42, 46, 48-50, 55, 57, 65, 88, 128, 131, 135-136, 138, 203,511,561,568,571 reliability ... 1-3,7,28,49,334,530, 563-564 reliable software ... 2, 29, 564 repeat-until-loop ... 85,136,266 representation ... 7, 9, 32, 39, 50, 67, 80, 84, 87-88, 92, 101, 103-104, 156, 256, 299, 304, 333, 345, 567, 571 resource ... 34 resource measure ... 2 retrieval ... 23 retrieval system ... 29, 47, 570 rotation ... 333,339,526,567 scale ... 3-4,21-22,25,36,39-40,43, 45-46, 48-51, 65, 96, 100, 107,120, 137, 145, 532, 557, 561, 566-567, 570-571 scale types ... 43 scales ... 2-5, 25, 36-37, 39, 41, 43-46, 62, 65, 107-108, 121, 128,133, 418, 511,571 science ... 2 6 , 3 9 , 1 4 6 scope ... 25, 31,138, 404, 436, 464, 562, 571 sensitivity ... 20, 52-54, 88-89, 93, 97-98, 121-122, 264, 268, 390, 431, 450, 502, 522, 536-537, 570 significance ... 26,107 similarity transformations ... 45 single-valued ... 31,436-437 social science ... 39 sociology ... 26,39

Subject Index

software complexity ... 1-5,7,9-10,20, 22-23, 25-28, 30, 32-35, 37, 39, 41-48, 51-52, 55, 57, 60, 62, 64-66, 78, 81 -82, 87-91, 93-100, 102, 110, 119, 121,133, 135, 138-139, 142, 149,151,159-160, 168-169, 191, 194, 221, 299, 301, 333-334, 344, 458, 464, 466, 511-512, 514-515, 517, 519, 530, 534, 538-540, 542, 544-547, 549-551, 557, 560-564, 566, 568-569, 572 software design ... 87,92,169,206, 208, 215-216, 220, 319, 544, 561, 563-564 software life-cycle ... 1,561-562,564, 572 software maintenance ... 35, 563 software measure ... 1,3-4,25,29, 35-37, 96, 139, 334, 436, 531, 560, 563, 572 software measurement ... 3-4, 7, 22, 25-29, 42, 48, 55, 83, 92, 96, 99, 107, 119, 138, 265, 296, 299, 319, 458, 517, 545, 563-564, 571 software quality ... 33, 562 software reuse ... 1, 551 software science ... 1 - 2 , 2 9 , 4 2 , 3 3 4 source code ... 7,9,30,32,67,139-140, 142,146,169,330,543, 547 spagetty code ... 44, 552 specification ... 2, 33-35, 61, 565, 571 stable set ... 5,9,179-180,185-187, 193, 514, 545,572 standardized measure ... 2, 4, 542, 549, 551 static analysis ... 2 , 5 4 2 , 5 7 2 static complexity ... 138 static measure ... 2, 32 statistical operation ... 22,145, 557, 561 statistics ... 3, 21, 42, 44-45, 65,145, 564 structural complexity ... 2 , 4 , 2 4 1 , 3 2 8 structural measure ... 33,297,299,319, 560, 563, 572 structured program ... 11, 30,36, 72, 89, 93,139, 152, 319, 464, 552-553 structuredness ... 152,309,334,458, 469-470, 547, 572 style ... 30,88,160 subjective ... 26, 32

597

Subject Index

subprogram ... 309 substitution ... 97 successor ... 195 symmetric property ... 29, 570 taxi-driver-metric ... 570 temperature ... 3, 39, 43-44 testability ... 139,458 testability measure ... 33,139 testable ... 3 0 , 6 2 , 1 2 0 testing ... 1-2,89,139,153,160,168, 281,290 time ... 2 5 , 2 8 , 3 0 , 3 2 , 3 5 - 3 6 , 4 4 , 5 0 , 5 6 , 87, 114, 193,210,561,572 time factor ... 34 tool ... 100,436,569 topological ... 2 totality ... 333,571 transformation ... 23, 43, 46, 64, 98, 126,140,162-163, 542, 557, 571 transitive ... 29, 47, 56-57, 85,123, 243, 566, 570-571 transitivity ... 47-48, 572 trivial prime ... 74-78, 90,136,152, 200, 256, 265-267, 269, 273, 275, 281-287, 290-293, 297-299, 302, 313, 325-326, 333, 339, 353-354, 356, 527, 529, 537 unclear properties ... 519,538 understandability ... 30, 33, 93 unstructured ... 5,11,16-17,19-20,30, 68, 78, 83-84,89, 98,103,133,139, 152-153, 169,183-185, 212-215, 220, 224, 227, 229, 235, 241, 269-272, 280, 295, 301, 308, 319, 324, 329, 337-338, 344, 373, 380, 382-383, 385-386, 399-400, 406-407, 410,413, 422-423, 431-435, 446, 457-459, 464-466, 468-470, 474, 478, 482, 488-491, 493, 497-505, 509, 516, 519-523, 544-545, 548-549, 551-554, 558-559 unstructuredness ... 9,17,21,78,82-84, 89, 93, 138, 152, 154, 227, 314, 383, 387, 400, 422, 432-433, 457-458, 460, 463-471, 474, 490-493, 498-504, 509, 520-522, 544, 549, 551, 572

upper limit ... 89,153 validate ... 296,560-562 validation ... 27, 560-563 validation case ... 560 variable definition ... 195 variable reference ... 195-196 vector ... 31, 436 viewpoint ... 47, 252 volume ... 1, 27-28, 32, 39,142,146, 265, 296, 299 weak order ... 4,39,47-48,50-51,57, 65, 92, 98, 116,169, 531, 567, 572 well-developed ... 26, 39 white-box ... 33 wooden board ... 39, 41, 57 world ... 30,39,570

Measure

Index

ALC ... 133,163, 170-173, 175, 525 ALPHA ... 106-108,113-114,118,123, 179-193, 514, 525,527,534, 538-539, 545 AVG ... 104,270,272,362,433-434, 436-437, 439, 534, 539, 545, 548 BAND ... 84,89,106,108,114-115, 265, 362-364, 366-369, 371-373, 413, 415, 525-526, 534, 545 BAND-CYC ... 362-364,369-373,519, 525-527, 538 BLA-H ... 265,345-347,349,352-353, 355-361, 523, 525-527, 534, 539, 548 BLA-HA ... 345, 347, 349, 352-353, 357-360, 523, 525-527 BLA-W ... 265,345-347,350,352-361, 523-527, 548 BLA-WR ... 265,345-346,350,352, 356-360, 525-527, 539 CD ... 374-381,383,385,388-392, 395-399, 519, 525, 527-528, 539, 548 CF ... 133,195-199 CN ... 374-381,383,385,388-393, 396-399, 519, 525, 527-528 CR ... 374-383,385,387-388,391-399, 519,523,525,527-528 CSG ... 21,123,374-383,385-388, 391-392, 394-399, 519-520, 523, 525, 527-528, 539, 545, 568 DAVE ... 265,269-272,275,277-280, 363, 526-527, 539, 545 DEC ... 133,303,424,547 DMAX ... 120,265,269-272,275, 278-280, 300, 363, 526-527, 534, 545 DTOT ... 140,265,269-276,278-280, 363, 524, 526-527, 545 DTOTU ... 269,271-272,280,524-525, 527-528, 545, 548 E-BAND-CYC ... 363,366

EJ-DSC ... 265,333-334,337-338, 342-344, 526-527, 563 EJ-E ... 333,335,346,548 EJ-ISC ... 118-120,265,333-339, 341-344, 346, 526-527, 534 EJ-L ... 333, 335, 346, 548 EJ-M ... 333,335,346,548 E T . . . 134, 548 H-RED ... 17,133,222,547 H-SCOPE ... 138,400,413,415-416, 425, 568 HALST-D ... 142,144-145,533,545 HALST-E ... 143-145,533,545 HALST-N ... 142,144,533,547 HALST-V ... 142,144-145,533,545, 547 HALST-VC ... 142, 144, 533, 547 IDSL ... 81-82,101,221-225,229-233, 235, 515, 524-525, 543, 547 KNOTS ... 92-93,138,459,461-463, 524-525 LAMBDA ... 265,282,295-296, 320-329, 526-527, 545, 548 LC ... 20,82,101,221-233,235, 237-238, 240, 436, 450, 515, 524-525, 534, 543, 548 LOC ... 1,28,32-33,36,53-54,56,92, 106, 108,112, 118, 133, 139, 145-150, 169, 247, 299, 303, 334, 424, 432, 513-514, 525, 530, 534, 548, 562-563 MCC-D ... 107,151-152,163,170,172, 175, 269, 432, 457, 460, 464-465, 468, 472, 484, 489, 525, 548 MCC-EV ... 82,107,151-154,163-164, 166, 168-169, 300, 458-460, 521, 524-525 544 MCC-EV0 ...'82,107, 151-153, 163-164, 166, 168-169, 458, 460, 524-525, 544

Measure Index

MCC-V ... 35-36,53-56,62-65,89,92, 106-108,111,120-126, 128-130, 151-155,157,161-163,165-169, 202, 206, 209-210, 212, 220, 305, 363, 374-375, 378, 382, 385, 387, 399, 450, 514-515, 525, 534, 536, 539-540, 543, 548, 554, 563, 568 MCC-V-Q ... 106-109,111,120-125, 128-131, 151,514,525, 540 MCC-V2 ... 12,22-23,62,64-65, 106-108, 110-111,120,128-131, 151, 161-163,165-169, 176-178, 234-241, 514, 525, 534, 536, 540, 548 554 557 MIN ... 32,250-264,435,516,523-525, 534 545 MINQ ... 516,523-525 MWD-HB ... 20,234,237-241,525,548 MWD-LC ... 20,235-241,525,543 MWD-MH ... 20,234-235,237-241, 524-525 N+E ... 547 N-BAND ... 265,362-364,369,371-373, 545 N-LOOPS ... 221,229,233,515, 525-526, 548 N-MCCABE ... 35,170-172,176-178, 525 539 N-REACH ... 242-243,246-249,516, 525, 527, 539 N-SCOPE ... 12,18,84,373,413, 415-418, 424-425, 428-432, 520, 524-525, 539, 545, 563 NL ... 2 0 , 8 5 , 9 3 , 1 0 4 , 1 3 9 , 2 2 1 , 2 3 5 , 238, 240-241, 400, 406, 412, 432-433, 435-442, 444-445, 447, 449-450, 452-457, 488, 525-526, 543, 548, 562 NPAIRS ... 497 NT ... 133,548 NTC ... 265,281-285,290,292-294, 296, 320-321, 329, 536, 545, 548 PAIRS ... 490,497 PATH ... 200-205,210,517,525-527, 534, 542-543, 548

599

PEN ... 20,84,104,139,400,412, 414-416, 425, 428, 432-437, 439-442, 445, 447, 450-452, 454-457, 466, 488, 524-527, 536, 543, 548, 555 PIWO ... 1 7 , 1 9 , 9 0 , 9 4 , 9 7 , 1 1 5 , 1 3 8 , 406, 432-433, 457, 462, 464-467, 470-478, 482-484, 486-489, 491, 500, 504, 509, 520-522, 525-528, 548-549, 554-556 PRATH-E ... 265,282,295-296, 320-329, 526-527, 545, 548 PREISER ... 265,330,525-527,545 PRIMES ... 133,256,259,266, 283-284, 299, 340, 547 REACH ... 242-249,516,525,527,548 RLC ... 170-175,177-178,525 S-REACH ... 242-243,247-249,516, 548 SBSM-N ... 265,280,301,303, 312-313, 315, 317-318, 526-527, 534, 548 SBSM-P ... 265,306,310-312,316, 525-527 SBSM-P1 ... 302,315,548 SBSM-S ... 265,303,308,312, 315-317, 525-527, 548 SBSM-SQF ... 302,548 SBSM-V ... 146,265,299,306,309, 315-316, 525-527, 529 SCOPE ... 12,18, 20, 84, 89, 94, 97, 104,138-139,269, 271, 373, 400, 412-422, 424-425, 427-433, 435-437, 439-440, 442, 450-451, 457, 464-466, 488, 520, 524-527, 530, 534, 536, 543, 545, 548, 554-555, 559, 563 SCOPE-D ... 414-415,424,438,440, 449-450, 548 SCOPE-MN ... 270,414,424,545,548 SCOPE-NL ... 225, 234-236, 435-436, 438, 440, 442, 449, 525-526, 548 STABLE ... 118,179-182,184-186, 188-193, 514, 525, 527,545 STRUCT ... 133

600

UN ... 138-139,432,457,460-463, 488-489, 491-492, 500-501, 504-506, 508, 521-522, 525, 527, 548, 554, 556 UNST ... 433,436,444,490-491, 498-500, 504, 508-509, 521-522, 525 UNSTR ... 224,227,400,433,436, 490-491, 493, 497, 504-505, 508-509, 521-522, 525, 528 UNSTRUCT ... 133,474,547 UNSTZ ... 490-491,493,497-500,504, 508-509, 521-522, 525 UO ... 490-492,500-501,503-504,506, 508-509, 521-522, 525, 527, 549 UOD ... 490-492,500-501,504, 506-509, 521-522, 525, 528, 549 UODD ... 490-492,500-504,507-509, 521-522, 525, 528, 549

Measure Index

UOV ... 138-139,460-463,467,474, 488-493, 500-501, 504, 506, 508-509, 521-522, 525, 528, 549, 554, 556 UPAIRS ... 497 VINAP-PD ... 21,265,300-302, 306-309,313-314, 318-319, 525-528 VINAP-SUM ... 21,265,300-302, 306-308, 313-314,318-319, 525-528 WHIT ... 12,20-21,206-208,211-212, 214-216, 218-220, 525, 527, 534, 538, 563 WHIT-MAX ... 206-208,538 WHIT-MIN ... 206-208,538 WHIT-REL ... 206-208, 538

Definition Index A Path 5.10 ... 69 Admissible Transformation 4.3 ... 43 An Execution Path 5.11 ... 69 Atomic Modification 4.7 ... 51 Atomic Modifications M1, MEDG and M5 7.1 ... 122 Average Nesting Depth AVG(G) 8.149 ... 434 Average Width-Band-Complexity AVG 8.110 ... 362

Immediate Successor IS 5.8 ... 68 Immediate Successors of a Node n 8.129 ... 403 Indegree and Outdegree of Nodes 5.2 ... 67 Interval 5.27 ... 81 Interval 8.37 ... 221 Inverse Proper Dominator of p 8.132 ... 404 Irreducibility of a Flowgraph 5.19 ... 73

Backward Edge (Hecht) 5.31 ... 82 Backward Edge (Hecht) 8.38 ... 221 Binary Predicate 5.6 ... 67 Branches in a Dominance Tree Td 8.123 ... 388

Length of a Path LP(p) 8.35 ... 208 Loop 5.30 ... 82

Complete Description of a Measure by Partial Properties 4.12 ... 56 Control Structures for MIN 8.63 ... 254 Cyclomatic Number 8.15 ... 154 Directed Graph 5.1 ... 67 Dominator 5.14 ... 71 Dominator 8.125 ... 400 Dominator and Postdominator 8.116 ... 374 Elevation-Measure BLA-H 8.99 ... 345 Elevation-Measure BLA-HA 8.100 ... 345 Empirical Subrelation 4.6 ... 51 Empirical Subrelation of a Measure 4.10 ... 54 Entry- and Exit-node of a Prime p 5.25 ... 74 Entry-Node of Range'(d) 8.162 ... 469 Extensive Structure 4.5 ... 50 First Occurrence Path FOP 8.127 ... 402 Flowgraph 5.3 ... 67 Flowgraph with a Bridge 8.57 ... 250 Flowgraph without a Bridge 8.58 ... 250 Immediate Dominator 5.15 ... 71 Immediate Dominator 8.126 ... 400 Immediate Processors IP 5.7 ... 67

Meaningfulness 4.4 ... 43 Measure Absolute Logical Complexity ALC 8.18 ... 170 Measure ALC: Partial Properties to the Atomic Modifications 8.20 ... 171 Measure ALPHA 8.24 ... 180 Measure ALPHA: Partial Properties to the Atomic Modifications 8.27 ... 187 Measure BAND (Original Definition) 8.108 ... 362 Measure BAND-CYC-Complexity 8.111 ... 363 Measure BAND-CYC: Partial Properties to the Atomic Modifications 8.115 ... 369 Measure BAND: Partial Properties to the Atomic Modifications 8.113 ... 366 Measure BLA-H: Partial Properties to the Atomic Modifications 8.104 ... 353 Measure BLA-HA: Partial Properties to the Atomic Modifications 8.103 ... 353 Measure BLA-W: Partial Properties to the Atomic Modifications 8.105 ... 353 Measure BLA-WR: Partial Properties to the Atomic Modifications 8.106 ... 356 Measure CD: Partial Properties to the Atomic Modifications 8.124 ... 389 Measure C F of Oviedo 8.29 ... 195 Measure CF: Partial Properties to the Atomic Modifications 8.31 ... 197 Measure CPIWO of Piwowarski 8.160 ... 465

602

Measure CR: Partial Properties to the Atomic Modifications 8.122 ... 387 Measure CSG of Schmidt and Gong 8.117 ... 375 Measure CSG: Partial Properties to the Atomic Modifications 8.121 ... 386 Measure C2: Partial Properties to M1, MEDG and M5 7.3 ... 123 Measure C2: Partial Properties to the Atomic Modifications 7.4 ... 126 Measure DAVE 8.68 ... 270 Measure DAVE: Partial Properties to the Atomic Modifications 8.71 ... 275 Measure DF of Oviedo 8.30 ... 195 Measure DMAX 8.69 ... 270 Measure DMAX: Partial Properties to the Atomic Modifications 8.72 ... 275 Measure DTOT 8.66 ... 269 Measure DTOT: Partial Properties to the Atomic Modifications 8.70 ... 273 Measure DTOTU 8.67 ... 269 Measure E-BAND-CYC 8.112 ... 363 Measure EJ-DSC: Degree of Software Complexity 8.96 ... 333 Measure EJ-ISC: Image of Software Complexity 8.95 ... 333 Measure EJ-ISC: Partial Properties to the Atomic Modifications 8.98 ... 339 Measure Essential Complexity: MCC-EV 8.14 ... 152 Measure H-RED 8.40 ... 222 Measure H-SCOPE 8.143 ... 416 Measure HALST-D: Difficulty 8.6 ... 142 Measure HALST-E: Effort 8.7 ... 143 Measure HALST-N: Number of Operators and Operands 8.3 ... 142 Measure HALST-V: Volume 8.5 ... 142 Measure HALST-VC: Vocabulary of the Program 8.4 ... 142 Measure Highest Number of Selection Nodes in a Prime 8.79 ... 300 Measure IDSL: Partial Properties to the Atomic Modifications 8.45 ... 229 Measure KNOT 8.157 ... 459 Measure KNOTS: Partial Properties to the Atomic Modifications 8.158 ... 461 Measure LAMBDA 8.90 ... 320

Definition Index

Measure LAMBDA: Partial Properties to the Atomic Modifications 8.92 ... 326 Measure LC: Partial Properties to the Atomic Modifications 8.46 ... 230 Measure LN-ABS: Absolut-Number of Nodes in Loops 8.44 ... 223 Measure LN-SUM: Loop-Nodes-Sum 8.43 ... 223 Measure LOC 8.8 ... 146 Measure LOC: Partial Properties to the Atomic Modifications 8.9 ... 147 Measure M 8.93 ... 330 Measure M: Partial Properties to the Atomic Modifications 8.94 ... 331 Measure Maximal Intersection Number MIN 8.60 ... 251 Measure MCC-D of McCabe 8.13 ... 152 Measure MCC-V: Partial Properties to the Atomic Modifications 4.13 ... 63 Measure MCC-V: Partial Properties to the Atomic Modifications 4.14 ... 63 Measure MCC-V2 of McCabe 8.12 ... 151 Measure MWD-MH( Original Definition by Moawad and Hassan) 8.47 ... 234 Measure N-BAND: Partial Properties to the Atomic Modifications 8.114 ... 369 Measure N-LOOPS 8.39 ... 221 Measure N-MCCABE: Partial Properties to the Atomic Modifications 8.22 ... 177 Measure N-REACH: Partial Properties to the Atomic Modifications 8.55 ... 246 Measure N-SCOPE 8.142 ... 415 Measure N-SCOPE: Partial Properties to the Atomic Modifications 8.145 ... 428 Measure NL: Partial Properties to the Atomic Modifications 8.156 ... 452 Measure NTC of Prather (Original definition) 8.73 ... 281 Measure NTCW of Prather defined by the Fenton-Whitty Scheme 8.74 ... 281 Measure NTCW: Partial Properties to the Atomic Modifications 8.75 ... 290

Definition Index

Measure Number of Levels of Nesting 8.80 ... 300 Measure Number of Loops (NL) 8.152 ... 435 Measure Number of Primes ... 300 Measure of Halstead: Operands and Operators) 8.2 ... 142 Measure OV of Oviedo 8.28 ... 195 Measure PAIRS 8.171 ... 490 Measure PATH 8.32 ... 200 Measure PATH: Partial Properties to the Atomic Modifications 8.33 ... 202 Measure PEN: Partial Properties to the Atomic Modifications 8.155 ... 450 Measure PIWO of Piwowarski 8.159 ... 464 Measure PIWO of Piwowarski (By the Author) 8.166 ... 472 Measure PIWO: Partial Properties to the Atomic Modifications 8.168 ... 483 Measure PIWOH of Howatt and Baker 8.167 ... 482 Measure PRATH-E 8.89 ... 320 Measure PRATH-E: Partial Properties to the Atomic Modifications 8.91 ... 325 Measure Predicated Execution Number (PEN) 8.150 ... 434 Measure REACH: Partial Properties to the Atomic Modifications 8.54 ... 245 Measure Relative Logical Complexity RLC 8.19 ... 170 Measure RLC: Partial Properties to the Atomic Modifications 8.21 ... 172 Measure S-REACH: Partial Properties to the Atomic Modifications 8.56 ... 247 Measure SBSM-N: Partial Properties to the Atomic Modifications 8.87 ... 312 Measure SBSM-P: Partial Properties to the Atomic Modifications 8.85 ... 310 Measure SBSM-P1 of the author 8.83 ... 302 Measure SBSM-S: Partial Properties to the Atomic Modifications 8.86 ... 312

603

Measure SBSM-SQF of the Author 8.82 ... 302 Measure SBSM-V: Partial Properties to the Atomic Modifications 8.84 ... 309 Measure SCOPE by Howatt and Baker 8.138 ... 414 Measure SCOPE of Harrison and Magel 8.137 ... 413 Measure SCOPE of Harrison and Magel 8.151 ... 435 Measure SCOPE-D by the Author 8.141 ... 414 Measure SCOPE-MN 8.140 ... 414 Measure SCOPE-NL 8.153 ... 435 Measure SCOPE: Partial Properties to the Atomic Modifications 8.144 ... 425 Measure STABLE 8.25 ... 180 Measure STABLE: Partial Properties to the Atomic Modifications 8.26 ... 185 Measure u 4.1 ... 40 Measure UN 8.176 ... 492 Measure UN: Partial Properties to the Atomic Modifications 8.183 ... 505 Measure UNST 8.173 ... 491 Measure UNSTR 8.172 ... 491 Measure UNSTR: Partial Properties to the Atomic Modifications 8.182 ... 505 Measure UNSTZ 8.181 ... 493 Measure UO 8.178 ... 492 Measure UO: Partial Properties to the Atomic Modifications 8.185 ... 506 Measure UOD 8.179 ... 492 Measure UOD: Partial Properties to the Atomic Modifications 8.186 ... 506 Measure UODD 8.180 ... 492 Measure UODD: Partial Properties to the Atomic Modifications 8.187 ... 507 Measure UOV 8.177 ... 492 Measure UOV: Partial Properties to the Atomic Modifications 8.184 ... 506 Measure Volume 8.77 ... 299 Measure WHIT 8.34 ... 206 Measure WHIT: Partial Properties to the Atomic Modifications 8.36 ... 216 Measure Z 8.61 ... 252

604

Measure Z' by Howatt and Baker 8.62 ... 252 Measure: Interval-Derived Sequence Length k of Hech 8.42 ... 222 Measure: Loop-Connectness LC 8.41 ... 222 Measure: Normalized Reachability 8.52 ... 242 Measure: Reachability 8.51 ... 242 Measure: Relative Reachability (By the Author) 8.53 ... 242 Measures MCC-EV and MCC-EVO: Partial Properties to the Atomic Modifications 8.1 ... 163 Measures MCC-V and MCC-V-Q: Partial Properties to M1, MEDG and M5 7.2 ... 122 Measures MCC-V and MCC-V2: Partial Properties to the Atomic Modifications 8.16 ... 161 Measures MCC-V2, MWD-MH, MWD-HB and MWD-LC: Partial Properties to the Atomic Mod ... 238 Measures MIN and Z: Partial Properties to the Atomic Modifications 8.64 ... 260 Measures VINAP-SUM and VINAP-PD: Partial Properties to the Atomic Modifications ... 313 Measures: EJ-L, EJ-E and EJ-M 8.97 ... 333 Modification of the Measure MCC-V 8.11 ... 151 Modified Measure CD by H. Zuse 8.119 ... 375 Modified Measure CN by H. Zuse 8.120 ... 375 Modified Measure CR of Roth 8.118 ... 375 Modified Measure MWD-HB by the Author 8.48 ... 234 Modified MWD-LC by the Author 8.49 ... 235 Modified Topic 8.163 ... 469 Nested Ranges NEST(p.q) 8.174 ... 491 Nesting Depth nd(x 8.147 ... 434 Nesting Level L(n) 8.109 ... 362 Nesting Level NHM(n) of a Node n 8.139 ... 414

Definition Index

Nesting Level of a Prime 5.22 ... 74 Non-reducibility 5.29 ... 82 Number of Procedure Nodes in a Prime 5.24 ... 74 Original Definition by McCabe(Cyclomatic Number) 8.10 ... 151 Overlapped Ranges OVL(p,q) 8.175 ... 491 Partial Description of the Property s a Measure 4.11 ... 56 Partial Property of a Measure 4.8 ... 52 Postdominator/SCHM85/ 5.16 ... 72 Pred (x 8.146 ... 433 Predicate Node 5.4 ... 67 Prime 5.20 ... 73 Procedure Node by Howatt and Baker /HOWA86/ 5.9 ... 69 Procedure Node by the Fenton-Whitty scheme/ALVE88/ 5.23 ... 74 Proper Maximal Subflowgraph 5.21 ... 73 Proper Subflowgraph 5.18 ... 73 Property s of a Measure 4.9 ... 54 Range'(p) 8.161 ... 469 Receiving Nodes 5.5 ... 67 Reducibility 5.28 ... 82 Region 8.59 ... 251 Relative-Width-Measure H 8.102 ... 346 Scale 4.2 ... 40 Scope of a Decision Node by Harrison and Magel 8.133 ... 404 SEP(p,q), NEST(p.q) and OVLP(p,q) 8.165 ... 471 Sequential Predicates 8.65 ... 261 Set of Nodes MP on FOP(m,n) 8.128 ... 403 Set of Pairs(S) of Ranges 8.169 ... 490 Set of Predicates in Node x (Nesting level of node x) 8.135 ... 410 Set of Unstructured Pairs of Ranges 8.170 ... 490 Some Simple Measures 8.1 ... 133 Stable Set of Nodes 8.23 ... 179 Strongly Connected Graph G 5.13 ... 70 Struct(p.q) and Unstruct(p.q) 8.164 ... 470

Definition Index

Structural Measure 8.76 ... 297 Subflowgraph 5.17 ... 73 Sum of the Nesting Levels of a Range(d) 8.136 ... 412 The Greatest Lower Bound GLB(p) 8.131 ... 403 The Lower Bound LB(p) 8.130 ... 403 The Range to a Decision-Node p by Howatt and Baker 8.134 ... 405

605

Total Nesting Depth ND(G) 8.148 ... 434 Trivial Prime 5.26 ... 74 VINAP-Measures (VINAP-PD and VINAP-SUM 8.81 ... 301 Weakly Connected Graph G 5.12 ... 70 Width-Measure BLA-W 8.101 ... 345

Studien zur Wirtschaftsinformatik Herausgegeben von Karl Kurbel, Uwe Pape, Hans-Jochen Schneider Die Wirtschaftsinformatik steht als interdisziplinäres Fachgebiet zwischen den Wirtschaftswissenschaften, insbesondere der Betriebswirtschaftslehre, und der Informatik. Sie behandelt die Entwicklung und den Einsatz computergestützter Anwendungssysteme in Unternehmen und Verwaltungen. Neben Systemen der operativen Ebene gehören dazu Planungssysteme und Entscheidungsunterstützungssysteme ebenso wie inner- und zwischenbetriebliche Informationsund Kommunikationssysteme. Ziel dieser Buchreihe ist es, den „State of the art" darzustellen, die Forschung zu fördern, die Lehre zu unterstützen und zu einer Strukturierung des Wissensgebiets beizutragen. Die Bände der Reihe wenden sich an Wissenschaftler, Entwickler, Anwender und an Studenten der Wirtschaftswissenschaften, der Informatik und der Wirtschaftsinformatik. Band 1 Detlef Karras / Lutz Kredel / Uwe Pape

Entwicklungsumgebungen für Expertensysteme Vergleichende Darstellung ausgewählter Systeme 15,5 x 23 cm. X, 217 Seiten. Mit einigen Abbildungen. 1987. Gebunden. ISBN 3-11-011294-9 Band 2 Lutz Kredel

Wirtschaftlichkeit von Bürokommunikationssystemen 15,5 x 23 cm. XVI, 368 Seiten. Mit 48 Abbildungen. 1988. Gebunden. ISBN 3-11-011767-3 Band 3 Karl Kurbel / Peter Mertens / August-Wilhelm Scheer (Herausgeber)

Interaktive betriebswirtschaftliche Informationsund Steuerungssysteme 15,5 x 23 cm. VI, 354 Seiten. Mit 115 Abbildungen. 1989. Gebunden. ISBN 3-11-012100-X Band 4 Peter Pfeiffer

Technologische Grundlage, Strategie und Organisation des Informationsmanagements 15,5 x 23 cm. XV, 337 Seiten. Mit 91 Abbildungen. Gebunden. ISBN 3-11-012362-2

WALTER DE GRUYTER • BERLIN • NEW YORK Genthiner Straße 13, D-1000 Berlin 30, Tel.: (030) 2 60 05-0, Fax 2 60-05-2 51 200 Saw Mill River Road, Hawthorne, N.Y. 10532, Tel.: (914) 747-0110, Fax 747-1326

Programmierung komplexer Systeme Herausgegeben von Fevzi Belli und Hinrich Bonin Die Reihe beschäftigt sich mit Realisierungs- und Zuverlässigkeitsaspekten komplexer Software-Systeme. D e n Schwerpunkt bilden konkrete Handlungsgrundsätze u n d implementierungsnahe Techniken f ü r Informations- und wissensbasierte Systeme. Dabei rücken Probleme bei der Modellierung, Analyse, Konzeption, Konstruktion und Validation komplexer Systeme in den Mittelpunkt, vor allem im Hinblick auf Programmierungsaspekte. Eine g e m e i n s a m e Eigenschaft der Einzelbände ist ihre Innovationskomponente. Diese K o m p o n e n t e wird auch durch die Einbeziehung von Werken interdisziplinären Charakters gewährleistet. Konkrete Anwendungssysteme, insbesondere aus technischen Bereichen einschließlich Büro- und Verwaltungsautomation, vermitteln den Praxisbezug. Band 2 Günter Becker

Softwarezuverlässigkeit Quantitative Modelle und Nachweisverfahren 15,5 x 23 cm. IX, 162 Seiten. Mit 35 Abbildungen. 1989. G e b u n d e n . ISBN 3-11-012227-8 Band 5 Ulrich Hoffmann

Einführung in die systemnahe Programmierung Anwenderprogramme und Datenstrukturen 15,5 x 23 cm. XII, 371 Seiten. Mit 136 Abbildungen. 1990. Paperback. ISBN 3-11-012466-1 In Vorbereitung Band 1 Hinrich Bonin

Software-Konstruktion mit LISP Erläuterungen und Auswahl von LISP-Konstruktionen 15,5 x 23 cm. Ca. 300 Seiten. 1991. Paperback.

ISBN 3-11-011786-X

Band 3 Günter Matthiessen

Logik für Software-Ingenieure 15,5 x 23 cm. Ca. 270 Seiten. 1991. G e b u n d e n .

ISBN 3-11-012228-6

WALTER DE GRUYTER • BERLIN • NEW YORK Genthiner Straße 13, D-1000 Berlin 30, Tel.: (0 30) 2 60 05-0, Fax 2 60-05-2 51 200 Saw Mill River Road, Hawthorne, N.Y. 10532, Tel.: (914) 747-0110, Fax 747-1326