skip to main content
article
Free Access

Enumeration of structured flowcharts

Published:01 July 1985Publication History
Skip Abstract Section

Abstract

An analysis of structured flowcharts is presented, where size is measured by the number, n, of decision nodes (IF-THEN-ELSE and DO-WHILE nodes). For all classes of structured flowcharts considered, the number of charts is approximately, cn-3/2γn, for large n, where c>and γ are parameters that depend on the class. It is also shown that most large flowcharts consist of a short sequence of basic charts (IF-THEN-ELSE and DO-WHILE charts). The average length of such sequences is 2.5.

References

  1. 1 BAKER, A. L., AND ZWEBEN, S. H.A comparison of measures of control flow completely. IEEE Trans. Softw. Eng. SE-6, 6 (Nov. 1980), 506-511.Google ScholarGoogle Scholar
  2. 2 BENDER, E. A. Asymptotic methods in enumeration. SlAM Rev. 16 (1974), 485-515. Errata, 18 (1976),292.Google ScholarGoogle Scholar
  3. 3 BOHM C., AND JACOPINI, G.How-diagrams, Turing machines, and languages with only two formation rules. Commun. ACM 9 (May 1966), 366-371. Google ScholarGoogle Scholar
  4. 4 DIJKSTRA, E. W. Go to statement considered harmful. Commun. ACM 11 (Mar. 1968), 147-148. Google ScholarGoogle Scholar
  5. 5 KNUTH, D. E. Structured programming with GOTO statement. Comput. Surv. 6, 4 (Dec. 1974), 26 i-30 i. Google ScholarGoogle Scholar
  6. 6 MCCABE, T. J.A complexity measure. IEEE Trans. Sofiw. Eng. SE-2, 4 (Dec. 1976), 308-320.Google ScholarGoogle Scholar
  7. 7 SCHNEIDEWINDE, N. J. AND HOFFMAN, H. M. An experiment in software error data collection and analysis. IEEE Trans. Softw.Eng.SE-5,3(May 1979) 276-286.Google ScholarGoogle Scholar

Index Terms

  1. Enumeration of structured flowcharts

      Recommendations

      Reviews

      Michael W. Whitelaw

      This paper features a result just begging to be applied to further research on the bias in programmer styles. The authors provide a means of measuring programmer bias in their choice of control structures by examining the sequency of BJ m flowcharts. BJ m flowcharts are charts which allow IF-THEN-ELSE, SEQUENCE, and DO-WHILE with up to m midloop exits. A flowchart can be considered as a selection of different types of nodes from a pool containing all types of nodes. This paper determines the asymptotic value for the number of possible flowcharts for a given number of nodes ( n) by using generating functions. For large BJ m charts, the average number of nodes of various types are calculated. The authors note that allowing arbitrary midloop exits only increases the fraction of DO-WHILE-type nodes by ten percent. Finally, the authors calculate the average sequency (the number of IF-THEN-ELSE and DO-WHILE-WITH- m-EXITS charts concatenated to form the final chart). The authors note the average sequency lies between 2.4 and 2.5 for n :2WZ ? and m :2WZ ? The authors observe that programmers tend to produce programs with much higher sequency. They informally suggest that either the problems that we choose to solve are inherently sequential or that IF-THEN-ELSE and DO-WHILE constructs are inadequate to overcome our sequential organizational tendencies. There are many alternative possible explanations. One is that we have no “natural” sequential organizational tendency but that, in the languages that we use, the sequence concept is more effectively implemented than the IF-THEN-ELSE or DO-WHILE concepts so the language pushes us to use the sequence concept rather than a basic preference by programmers. These and other conjectures explaining the difference between empirically observed behavior of programmers and “expected” behavior should provide some interesting research topics.

      Access critical reviews of Computing literature here

      Become a reviewer for Computing Reviews.

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image Journal of the ACM
        Journal of the ACM  Volume 32, Issue 3
        July 1985
        245 pages
        ISSN:0004-5411
        EISSN:1557-735X
        DOI:10.1145/3828
        Issue’s Table of Contents

        Copyright © 1985 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 July 1985
        Published in jacm Volume 32, Issue 3

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader