home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / PASCAL / METRIC.ZIP / METRIC.LIS < prev    next >
Encoding:
File List  |  1987-06-12  |  38.5 KB  |  885 lines

  1.  
  2.                      A Software Metrics Tutorial
  3.                                  and
  4.                        METRIC 1.0 User's Guide
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                            Warren Harrison
  12.                         SET Laboratories, Inc.
  13.                             P.O. Box 03963
  14.                           Portland, OR 97203
  15.  
  16.  
  17.  
  18.  
  19.                               DISCLAIMER
  20.  
  21.  
  22.      The field of software metrics is an evolving discipline. 
  23.      This document, and METRIC 1.0 software is made available on 
  24.      an "as-is" basis. No claim is made that any of the 
  25.      techniques discussed in this document nor implemented in 
  26.      METRIC 1.0 will accurately predict software size, cost, 
  27.      effort or errors in every situation. SET Laboratories, Inc. 
  28.      does not warrant the fitness of METRIC 1.0 for any 
  29.      particular purpose. The user accepts full responsiblity for 
  30.      any and all damages, costs, losses, expenses, and other 
  31.      liabilities resulting from the use of METRIC 1.0 and/or this 
  32.      document. Use of the techniques discussed in this document 
  33.      or use of the METRIC 1.0 software package should not be 
  34.      undertaken until the entire document is read completely. Use 
  35.      of the METRIC 1.0 package is an implict agreement on the 
  36.      part of the user that this disclaimer has been read, is 
  37.      understood, and the user agrees to all conditions and 
  38.      statements included in the disclaimer. 
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.      
  60.      Copyright 1987 by SET Laboratories, Inc.
  61.  
  62.      Software Metrics Tutorial and METRIC 1.0 User's Guide           2
  63.      SET Laboratories, Inc.
  64.  
  65.  
  66.  
  67.  
  68.  
  69.      INTRODUCTION 
  70.  
  71.           Since the first software product was developed, 
  72.      programmers and programming managers have had to estimate 
  73.      how much to budget for development, testing and maintenance. 
  74.      It is this particular problem in which the users of software 
  75.      metrics are interested. Their approach is based on the idea 
  76.      that certain characteristics of the software will have a 
  77.      major impact on how much it costs to develop and maintain 
  78.      the software. 
  79.  
  80.           One of the major characteristics considered by software 
  81.      metricians is something called "software complexity". 
  82.      Software complexity is the property of how hard a program is 
  83.      to understand and work with. A software complexity metric is 
  84.      a measure of how complex a piece of software is. Many 
  85.      computer scientists think that the amount of effort required 
  86.      to develop and/or maintain a piece of code depends on how 
  87.      complex the software is. 
  88.  
  89.           The usual approach to establishing a software 
  90.      complexity metric is to identify certain properties of a 
  91.      program which are thought to lead to it being difficult to 
  92.      work with. For example, one popular measure of complexity is 
  93.      simply the number of decision making statements in the code. 
  94.      Most complexity measures attempt to estimate the software 
  95.      complexity that a software product actually exhibits through 
  96.      the degree to which these properties exist in the code. 
  97.  
  98.  
  99.      SOFTWARE COMPLEXITY MEASURES 
  100.  
  101.           Even when one has identified the characteristic(s) that 
  102.      might lead to software complexity, a method of "quantifying" 
  103.      the degree to which the characteristic(s) exist in the code 
  104.      is not trivial. This is especially true if more than one 
  105.      characteristic is being considered. Then, one must determine 
  106.      the effect on overall complexity due to each. 
  107.  
  108.           Since a large number of different characeristics have 
  109.      been identified as impacting software complexity, a number 
  110.      of metrics exist. In general, software complexity metrics 
  111.      can be divided into four categories: 
  112.  
  113.      (1)  measures of program size; 
  114.  
  115.      (2)  measures of control flow; 
  116.  
  117.  
  118.      
  119.      Copyright 1987 by SET Laboratories, Inc.
  120.  
  121.      Software Metrics Tutorial and METRIC 1.0 User's Guide           3
  122.      SET Laboratories, Inc.
  123.  
  124.  
  125.      (3)  measures of data structures and use; 
  126.  
  127.      (4)  hybrid measures, combining two or more of the properties 
  128.           measured by the other types of metrics. 
  129.  
  130.      Metrics in each category all have their respective merits. 
  131.      However, most of the software complexity metric research 
  132.      that has been performed by computer scientists over the past 
  133.      ten years has dealt only slightly with data structures and 
  134.      their use. An annotated bibliography of some of this 
  135.      research is included in the appendix. Some of the metrics 
  136.      which have come about due to this research are now listed: 
  137.  
  138.           (1)  Program size metrics are perhaps the most common 
  139.                measures of program complexity. For example, a 
  140.                count of source lines in a program can be easily 
  141.                obtained through a simple text editor. In 
  142.                addition, the impact that size has on programming 
  143.                activities is quite obvious and understandable. 
  144.                The most popular measures of program size include: 
  145.                nonblank lines of code without comments, nonblank 
  146.                lines of code with comments, and total number of 
  147.                lines in the source file. Other popular measures 
  148.                of size include a count of tokens in the code, and 
  149.                the number of procedures included in the program. 
  150.  
  151.           (2)  Another popular method of measuring program 
  152.                complexity involves assessing how complex the flow 
  153.                of control within the program is. A very popular 
  154.                approach is a simple count of IF statements. One 
  155.                technique which has gained great popularity among 
  156.                computer scientists is something called the 
  157.                cyclomatic complexity of a program. This metric is 
  158.                based on a great deal of mathematical graph 
  159.                theory. The interested reader is referred to the 
  160.                appendix for references to related papers. 
  161.                Luckily, the usual method of computing the 
  162.                cyclomatic complexity of a program with a single 
  163.                entrance and a single exit is to simply count the 
  164.                number of "decision points" (ie, statments such as 
  165.                IF, WHILE, FOR, REPEAT, etc. that change the flow 
  166.                of control from a sequential path) and add 1. A 
  167.                number of variants have grown up around the 
  168.                cycolmatic measure, but it remains the most 
  169.                popular control flow metric. 
  170.  
  171.           (3)  Data structure and use metrics have had little 
  172.                attention paid to them by software metric 
  173.                researchers. There are currently no popular 
  174.                measures of the complexity contributed by data 
  175.  
  176.      
  177.      Copyright 1987 by SET Laboratories, Inc.
  178.  
  179.      Software Metrics Tutorial and METRIC 1.0 User's Guide           4
  180.      SET Laboratories, Inc.
  181.  
  182.  
  183.                items available. However, the dramatic impact that 
  184.                data structures have on complexity is bound to 
  185.                lead to some very good metrics being suggested in 
  186.                the near future. 
  187.  
  188.           (4)  Hybrid metrics are metrics which take two or more 
  189.                of the metrics which would fit in one of the above 
  190.                categories, and combine them. Perhaps the best 
  191.                known such metric (in fact, set of metrics) is 
  192.                what is known as Software Science. Software 
  193.                Science is based on the idea that a program is 
  194.                made up of operators and operands. The parameters 
  195.                of interest for Software Science are the number of 
  196.                unique operators, the number of unique operands*, 
  197.                the number of total operators used, and the number 
  198.                of total operands used. Thus, Software Science 
  199.                combines measures of data structure and use, with 
  200.                program size. From this set of parameters, a large 
  201.                number of unique metrics can be assembled, 
  202.                including E (effort), V (volume), N^ (predicted 
  203.                program length) and B^ (predicted number of bugs). 
  204.                Each of these measures will be discussed in more 
  205.                detail in a later section which describes the 
  206.                METRIC 1.0 package. Software Science is probably 
  207.                one of the most popular complexity metrics in use 
  208.                by software metric researchers, though many people 
  209.                question some of the assumptions that the measures 
  210.                are based upon. 
  211.  
  212.  
  213.  
  214.      USING METRICS 
  215.  
  216.           Once a metric has been selected, one must consider the 
  217.      impact the complexity of the software has on the development 
  218.      and/or maintenance effort. Quite often, these two issues are 
  219.      confused. One may have a metric that measures complexity 
  220.      quite well, but lack a method of determining what the impact 
  221.      of this complexity will be. The impact that a particular 
  222.      level of complexity has on the programming process can best 
  223.      be obtained empirically. This can be accomplished by 
  224.      analyzing previous projects, and relating their measured 
  225.      complexity to some measure of the programming process (eg, 
  226.      development effort or number of bugs). Ideally, the result 
  227.      of this process will be a model of how a marginal increase 
  228.      in complexity impacts some selected programming activity. 
  229.  
  230.           When performing these activities, one must be careful 
  231.      to avoid putting too much emphasis on the results. While 
  232.  
  233.  
  234.      ____________________
  235.      (*)An operand is a variable or constant
  236.  
  237.      
  238.      Copyright 1987 by SET Laboratories, Inc.
  239.  
  240.      Software Metrics Tutorial and METRIC 1.0 User's Guide           5
  241.      SET Laboratories, Inc.
  242.  
  243.  
  244.      they can be helpful indicators of development effort or 
  245.      time, they are at best, valid in a statistical sense only 
  246.      (ie, the errors in prediction, when spread over a large 
  247.      number of projects are acceptable, but the predictions for 
  248.      one individual project may vary greatly from the actual 
  249.      results). As an example, consider the following projects 
  250.      developed by the author of METRIC 1.0 over a period of 
  251.      several years. Various Software Science measures (V,E), 
  252.      cyclomatic complexity (Vg), nonblank lines of code (LOC), 
  253.      number of procedures (Proc), the person-hours of development 
  254.      time predicted by the Software Science 'T' measure, and the 
  255.      approximate number of person hours that really went into 
  256.      each project are listed. 
  257.       
  258.                                                          Approximate
  259.                                                Predicted   Actual
  260.      Project      V        E     Vg   LOC  Proc   Time      Time
  261.      -------------------------------------------------------------
  262.      convert    1,126   141,806   9    44    2   2 hours   1 hour
  263.      editor    13,497 3,958,863  68   514   17  61 hours  55 hours
  264.      letter     3,179   453,339  22   131    7   7 hours   6 hours
  265.      list         569    21,906   5    39    0  <1 hour    2 hours
  266.      more         625    19,832   7    45    0  <1 hour    1 hour
  267.      mymetrics  9,083 1,506,016  31   281    5  23 hours  12 hours
  268.      paslex     4,058   850,658  25   181    7  13 hours  10 hours
  269.      paste      1,064    81,928  10    56    1   1 hour    1 hour
  270.      plot       2,680   247,326  14   155    6   4 hours   3 hours
  271.      redform   12.080 2,670,531  79   523   14  41 hours  68 hours
  272.      salt      16,606 4,001,407  68   447   13  62 hours  35 hours
  273.      scoot5       545    24,695   7    33    0  <1 hour   <1 hour
  274.      twocol     1,335    61,029  10    57    3   1 hour    3 hours
  275.      upasm      5,275   648,455  46   191    7  10 hours   6 hours
  276.      upbbs     16,801 3,096,789  53   560   19  48 hours  18 hours
  277.      upcom      3,222   273,820  14   131    6   4 hours   3 hours
  278.      vroff     16,735 4,148,886  98   591    8  64 hours  70 hours
  279.      ----------------------------------------------------------------
  280.      
  281.      Note that the actual observed time is only approximate. No 
  282.      attempt was made to control for interruptions, division of 
  283.      attention between several concurrent activites, etc. 
  284.      Likewise, the work on many of these projects took place over 
  285.      a period of weeks or even months, with a few hours every 
  286.      other day allocated to the project - clearly some uncounted 
  287.      time may have went into the project between periods of 
  288.      formal work, and some time may have been wasted in 'getting 
  289.      up to speed' when a long period of time separated formal 
  290.      work periods. 
  291.  
  292.           Only the time spent actually coding the product or 
  293.      putting the design on paper is included in the 'actual 
  294.  
  295.      
  296.      Copyright 1987 by SET Laboratories, Inc.
  297.  
  298.      Software Metrics Tutorial and METRIC 1.0 User's Guide           6
  299.      SET Laboratories, Inc.
  300.  
  301.  
  302.      time'. Other effort involved in developing the product is 
  303.      not included. For example, the observed time does not 
  304.      include the time spent researching advanced features of the 
  305.      language needed to complete a particular project - nor does 
  306.      it include the time involved in writing user documentation 
  307.      or inserting 'post-development' internal documentation. 
  308.      Therefore the 'actual time' listed in the table may itself 
  309.      differ by 20-30% from what someone else may consider it to 
  310.      be. Also, note that these are small projects completed by a 
  311.      single person in less than one person-month. Typically the 
  312.      errors would be less noticeable in larger, multi-person 
  313.      projects. 
  314.  
  315.           Both these results, and results obtained by computer 
  316.      scientists doing research in this area suggest that due to 
  317.      the great variability in programmers, applications and 
  318.      environments, no one measure will always be 100% accurate in 
  319.      assessing complexity. Likewise, it is doubtful that a single 
  320.      model of the impact of complexity upon programming 
  321.      activities will ever exist. However, these metrics can often 
  322.      be useful in determining very coarse parameters, such as 
  323.      predicting the order of magnitude of project effort. 
  324.  
  325.           By now, the reader should have noticed that the 
  326.      calculation of the metrics discussed so far requires the 
  327.      existence of the source code to derive the metric. Clearly, 
  328.      this is a great limitation to the usefulness of a metric, 
  329.      effectively eliminating its use as a tool for predicting 
  330.      development time. However, if one agrees with the idea that 
  331.      software complexity adversely impacts the software 
  332.      development process, it seems reasonable to extend this to 
  333.      say that software complexity impacts the software maintenace 
  334.      activity in a like manner, as well as the testing process. 
  335.  
  336.           Therefore, complexity metrics can be used most 
  337.      effectively to budget and schedule for the testing and 
  338.      maintenance activities since by this point, one typically 
  339.      has code available for analysis. Thus, based on the 
  340.      complexity of a product, one may allocate more or less 
  341.      time/resources for its maintenance or testing. However, the 
  342.      reader is cautioned to keep the discussion of the previous 
  343.      section in mind. No metric can ever be 100% accurate, and 
  344.      likewise, no model of the impact of complexity on any human 
  345.      activity can be 100% accurate. 
  346.  
  347.  
  348.      THE METRIC 1.0 TOOL 
  349.  
  350.           The METRIC 1.0 software complexity analysis tool will 
  351.      calculate a variety of software metrics, and implement a 
  352.  
  353.      
  354.      Copyright 1987 by SET Laboratories, Inc.
  355.  
  356.      Software Metrics Tutorial and METRIC 1.0 User's Guide           7
  357.      SET Laboratories, Inc.
  358.  
  359.  
  360.      limited number of models which describe the impact of 
  361.      complexity on various aspects of the programming process. 
  362.      The input to the tool is a program written in standard 
  363.      Pascal, which will compile cleanly (METRIC 1.0 does not 
  364.      check for syntax errors). 
  365.  
  366.           The metrics calculated by METRIC 1.0 include some of 
  367.      the Software Science measures using the counting rules 
  368.      suggested by Salt in the March 1982 issue of ACM SIGPLAN 
  369.      Notices. A few differences do exist, however, between the 
  370.      counting rules defined by Salt and the way METRIC 1.0 
  371.      counts. First, no distinction is made between unary and 
  372.      binary arithmetic operations (Salt records these as separate 
  373.      uses of '+' and '-'). Second, parameterless function 
  374.      invocations (such as the Turbo Pascal MEMAVAILABLE standard 
  375.      function) are interpreted as references to variables, and 
  376.      thus, such references are viewed as operand references. 
  377.      Third, labels in a label definition are treated as operands 
  378.      (not operators) and the label indicator (the ':') is treated 
  379.      as a separate operator. 
  380.  
  381.           The Software Science measures implemented include the E 
  382.      or effort measure, and the V or volume measure. The reader 
  383.      should note that effort is given in unitless figures, and 
  384.      therefore should not be construed to mean person-effort (eg, 
  385.      person hours or person months). 
  386.  
  387.           The Software Science parameters n1, n2, N1, N2, n and N 
  388.      are also provided, as well as an estimated program "length", 
  389.      N^ which represents the length of a "pure" program with the 
  390.      observed number of unique operators and operands. The 
  391.      difference between the N and N^ parameters is classically 
  392.      attributed to certain "impurities" in the code that cause 
  393.      the observed length to differ from the predicted "pure" 
  394.      length. These impurities include things such as "cancelling 
  395.      of operators", "ambiguous operands", "synonymous operands", 
  396.      "common subexpressions", "unnecessary replacements", and 
  397.      "unfactored expressions". METRIC 1.0 provides a measure 
  398.      called the "purity ratio" which represents the ratio of N^ 
  399.      to N. A "perfect" purity ratio of 1 should indicate the 
  400.      program contains no impurities. No studies have been 
  401.      performed to assess the relationship of the purity ratio to 
  402.      programming activities. 
  403.  
  404.           METRIC 1.0 also implements two Software Science based 
  405.      models which attempt to reflect the impact that software 
  406.      complexity has on various programming activities. The first 
  407.      is the B^ measure which is an approximation of the number of 
  408.      errors which have been inserted into the code during 
  409.      development. This model is based on the idea that a program 
  410.  
  411.      
  412.      Copyright 1987 by SET Laboratories, Inc.
  413.  
  414.      Software Metrics Tutorial and METRIC 1.0 User's Guide           8
  415.      SET Laboratories, Inc.
  416.  
  417.  
  418.      with n unique tokens and N total tokens will require 
  419.      (N*log2*n) "mental discriminations" to "process" the entire 
  420.      program since the n unique tokens could be searched in 
  421.      log2*n time using a binary search, and N lookups of the list 
  422.      of n possible tokens would be required. It is interesting to 
  423.      note that this relation is equivalent to the Volume measure 
  424.      (V). Independent studies (of activities other than 
  425.      programming) suggest that people tend to make one mistake 
  426.      every 3,000 - 3,200 mental discriminations. Thus, the number 
  427.      of errors one might expect to be inserted in the code is 
  428.      approximately ((N*log2*n)/3,200). 
  429.  
  430.           The second Software Science based model is the 'T' 
  431.      measure which attempts to model the impact of program 
  432.      complexity on program development time. If a constant S, 
  433.      could be obtained which would represent the speed of a 
  434.      programmer in terms of the number of mental discriminations 
  435.      made per second, then a predicted time for development could 
  436.      be obtained. Independent psychological studies suggest that 
  437.      this number is between 5 and 20, with the value 18 typically 
  438.      being used for Software Science studies. Using the E metric 
  439.      as a measure of the number of mental discriminations being 
  440.      involved in developing the software, we have T=E/18 (in 
  441.      seconds). E (effort) is essentially the (N*log2*n) measure, 
  442.      but normalized for the level of abstraction at which the 
  443.      program is written, by dividing by (2/n1)(n2/N2). 
  444.  
  445.           Another complexity metric calculated by METRIC 1.0 is 
  446.      the cyclomatic complexity. Researchers in this field suggest 
  447.      that 10 be an upper limit to the cyclomatic complexity of a 
  448.      procedure or subprogram. The cyclomatic complexity is 
  449.      calculated for the entire source file by METRIC 1.0 (ie, it 
  450.      is summed for all the procedures in the source file), in 
  451.      addition, an average cyclomatic complexity per 
  452.      procedure/function is provided to help the user determine if 
  453.      the source file should be further broken up into additional 
  454.      procedures to reduce the average cyclomatic complexity. 
  455.  
  456.           Finally, two of the classical size measures are 
  457.      provided by METRIC 1.0: lines of code and a count of the 
  458.      procedures/functions in the source file. 
  459.  
  460.           The following display is an illustration of the report 
  461.      produced by METRIC 1.0 for the tool itself: 
  462.  
  463.  
  464.      
  465.      Copyright 1987 by SET Laboratories, Inc.
  466.  
  467.      Software Metrics Tutorial and METRIC 1.0 User's Guide           9
  468.      SET Laboratories, Inc.
  469.  
  470.  
  471.  
  472.       
  473.      -------------------------------------------------------------
  474.      | METRIC 1.0 Report for: METRIC.PAS                         |
  475.      | Copyright 1987 by SET Laboratories, Inc.                  |
  476.      | ----------------------------------------                  |
  477.      |                                                           |
  478.      | n1:    75      n2:   216     n:   291                     |
  479.      | N1:  2258      N2:  1458     N:  3716    N^:  2142        |
  480.      | Purity Ratio:   0.58                                      |
  481.      |                                                           |
  482.      | Volume: 30415                                             |
  483.      | Effort: 7698796                                           |
  484.      | Predicted Bugs:    10                                     |
  485.      | Predicted Development Time (minutes):  7129               |
  486.      |                            (hours):   119                 |
  487.      |                                                           |
  488.      |                                                           |
  489.      | Cyclomatic Number:   105                                  |
  490.      | Average Cyclomatic Number: 5                              |
  491.      |                                                           |
  492.      | Lines of Code:   887                                      |
  493.      | Number of Procedures/Functions:    23                     |
  494.      | Number of Executable Semi-colons:   412                   |
  495.      |                                                           |
  496.      | WARNING! See Disclaimer In User Guide Before Using Output |
  497.      -------------------------------------------------------------
  498.      
  499.      It should be clear to the user after studying this document, 
  500.      that there is no single "magic number" that will solve all 
  501.      the ills of software project management. Even experts in 
  502.      this field cannot agree on which measure works best. What 
  503.      METRIC 1.0 attempts to do is to provide an easy way of 
  504.      obtaining several of the popular metrics for a piece of 
  505.      Pascal source code. The user may then, after careful study 
  506.      and analysis of previous projects and their measured 
  507.      complexity, decide which, if any, of the metrics to use. 
  508.      Just as important, the user is also responsible for 
  509.      determining how the metrics are to be used. 
  510.  
  511.  
  512.      THE ROLE OF DATA COLLECTION IN METRIC APPLICATION 
  513.  
  514.           One point which has been consistently stressed in this 
  515.      document is that what may work for one person, in one 
  516.      environment and one application, may not work for someone 
  517.      else in a different environment and with a different 
  518.      application. Thus, if it is determined that metrics will be 
  519.      used to help manage a development project, one must "tune" 
  520.      the use of the metric to his particular situation. 
  521.  
  522.  
  523.      
  524.      Copyright 1987 by SET Laboratories, Inc.
  525.  
  526.      Software Metrics Tutorial and METRIC 1.0 User's Guide          10
  527.      SET Laboratories, Inc.
  528.  
  529.  
  530.           To do this "tuning", one must compute the metrics for 
  531.      (many) past projects. The measures obtained can then be 
  532.      related to the performance actually encountered (eg, errors, 
  533.      development time, etc.). No doubt, various relationships 
  534.      will be observed to exist between the measured complexity of 
  535.      the projects and the performance aspects of interest. 
  536.  
  537.           For example, perhaps one may notice that the actual 
  538.      number of errors usually lies within 10% of B^. Once 
  539.      sufficient confidence is obtained by the user, this 
  540.      knowledge may be used to estimate the number of errors which 
  541.      are in a project undergoing testing. If the user is very 
  542.      risk adverse, testing might continue until (B^*1.10) errors, 
  543.      10% more than predicted - are found (or a significant amount 
  544.      of testing time is spent and no additional errors found). On 
  545.      the other hand, if the user is more of a risk taker, testing 
  546.      might continue only until (B^*.90) errors, 10% less than 
  547.      predicted, are encountered. This estimate could be used to 
  548.      determine how much time to allocate for testing, and 
  549.      determining when testing is complete. 
  550.  
  551.           Without an historical database of previous projects, it 
  552.      is not clear that complexity metrics should be used for any 
  553.      form of predicition or estimation. Even with a large 
  554.      database of information on previous projects, one is still 
  555.      making an assumption that the project and programmers in 
  556.      question is similar enough to the projects in the database 
  557.      to make use of the experiences. 
  558.  
  559.           In order to build such a database, the minimum 
  560.      information which should be maintained include: 
  561.  
  562.           a.   software complexity measures - it would even be 
  563.                better if the actual source code could be 
  564.                maintained so new metrics could be applied to the 
  565.                historical data as they become available. 
  566.  
  567.           b.   development time - the keyword here is CONSISTENT 
  568.                measurement of the development time - if design 
  569.                time is included in one project, it should be 
  570.                included in all - otherwise, one ends up comparing 
  571.                apples and oranges. 
  572.  
  573.           c.   error counts - as with development time, error 
  574.                counts for a project should be consistent - if 
  575.                only errors encountered during integration testing 
  576.                are counted in one project, errors encountered 
  577.                during integration testing should be available for 
  578.                each of the other projects in the data base. 
  579.  
  580.  
  581.      
  582.      Copyright 1987 by SET Laboratories, Inc.
  583.  
  584.      Software Metrics Tutorial and METRIC 1.0 User's Guide          11
  585.      SET Laboratories, Inc.
  586.  
  587.  
  588.           d.   maintenance effort - in addition to recording how 
  589.                much time is spent in maintenance, the actual 
  590.                maintenance tasks themselves should be recorded so 
  591.                that allowances can be made during analysis to 
  592.                reflect the inherent difficulty of the activity. 
  593.  
  594.      Naturally, one may wish to record additional data. The above 
  595.      information should serve as a minimal data collection 
  596.      process. It is important that this data collection be an 
  597.      on-going effort. The data base should be kept up to date, 
  598.      and metric tuning should be done from time-to-time using the 
  599.      current data base. Otherwise, the metric use will not 
  600.      reflect recent changes in the environment in which the 
  601.      project is being developed. For help in establishing such a 
  602.      data collection process, contact SET Laboratories. 
  603.  
  604.  
  605.      USING, DISTRIBUTING AND REGISTERING METRIC 1.0 
  606.  
  607.           METRIC 1.0 is distributed under the "shareware" 
  608.      concept. This means that one can make copies of METRIC 1.0, 
  609.      distribute them to others (in fact, we wish you would) and 
  610.      use METRIC 1.0 as long as the following conditions are met: 
  611.  
  612.           You are encouraged to copy and share this program
  613.          with other users, on the conditions that the program
  614.          is not distributed in modified form, that no fee is
  615.           charged for the program beyond reasonable copying
  616.           and/or media charges, and that this notice is not
  617.                          bypassed or removed.
  618.  
  619.  
  620.      Also, please note that since the impact of software 
  621.      complexity on the process of software development or 
  622.      maintenance is dependent upon a number of factors, not all 
  623.      of which are reflected in software complexity metrics, SET 
  624.      Laboratories cannot warrant the fitness of the METRIC 1.0 
  625.      tool, or this manual for any particular purpose. Software 
  626.      metrics in general, and METRIC 1.0 in particular should be 
  627.      only one of a number of tools used by an individual to 
  628.      manage the software development and/or maintenace activity. 
  629.      Because of this, please observe the following disclaimer: 
  630.  
  631.        This program is distributed on an "AS-IS" basis without
  632.      warranty. The entire risk as to the quality and performance
  633.        of the program is with the user. No warranties as to the
  634.                quality/fitness of the program are made.
  635.  
  636.  
  637.      If after using METRIC 1.0 you think it is a useful tool - 
  638.  
  639.      
  640.      Copyright 1987 by SET Laboratories, Inc.
  641.  
  642.      Software Metrics Tutorial and METRIC 1.0 User's Guide          12
  643.      SET Laboratories, Inc.
  644.  
  645.  
  646.      especially if you are using it professionally - you may 
  647.      register it for $99 with SET Laboratories, Inc. at the 
  648.      following address: 
  649.  
  650.                         SET Laboratories, Inc.
  651.                              PO Box 03963
  652.                           Portland, OR 97203
  653.  
  654.  
  655.      Registration will put your name on a list to receive the 
  656.      next major release of METRIC, which will implement 
  657.      additional software complexity metrics and models. Also, 
  658.      starting with the next major release, we will support 
  659.      additional languages besides Pascal - when registering, 
  660.      please state your language preference. Additionally, we will 
  661.      be happy to provide limited support for registered users of 
  662.      METRIC 1.0, both with the package, and in software 
  663.      complexity metrics in general. 
  664.  
  665.           Even if you are not a registered user, if you use 
  666.      METRIC 1.0, and have any comments ideas, or just want to say 
  667.      "hi", please write to us at the above address. 
  668.  
  669.  
  670.      TECHNICAL MATTERS 
  671.  
  672.           The METRIC 1.0 distribution package should contain five 
  673.      files. The first file, README.LIS, you probably have already 
  674.      read. README.LIS is simply a half a page or so which 
  675.      describes how to proceed. The file METRIC.COM is the actual 
  676.      tool itself. To run it, simply type: 
  677.            
  678.           METRIC
  679.           
  680.      You will be asked for the file name of the program to 
  681.      analyze (assumed to end with the suffix .PAS, if it doesn't, 
  682.      specify it). After entering the file name and a <CR>, a file 
  683.      called xxx.RPT (where 'xxx' is the name of the source file) 
  684.      will be created which will contain the various complexity 
  685.      measures calculated for the source program. 
  686.  
  687.           Two additional files, PASRESWO.TAB and PASSTATE.TAB are 
  688.      also included. The first file lists all the Pascal tokens 
  689.      which are considered operators and the second file lists all 
  690.      the tokens which terminate a Pascal statement. The first 
  691.      file can be modified to reflect additional operators present 
  692.      due to a local language extension, etc. (if adding 
  693.      additional tokens, please ensure that the file remains 
  694.      ordered and the new tokens are entered in lower case!). The 
  695.      other file, METRIC.LIS, is this document. 
  696.      
  697.      Copyright 1987 by SET Laboratories, Inc.
  698.  
  699.      Software Metrics Tutorial and METRIC 1.0 User's Guide          13
  700.      SET Laboratories, Inc.
  701.  
  702.  
  703.  
  704.                      AN ANNOTATED BIBLIOGRAPHY OF
  705.                     THE SOFTWARE METRIC LITERATURE
  706.  
  707.  
  708.      [1]  Baker, A., "A Comparision of Measures of Control Flow 
  709.           Complexity", I_E_E_E_ T_r_a_n_s_a_c_t_i_o_n_s_ o_n_ S_o_f_t_w_a_r_e_ E_n_g_i_n_e_e_r_i_n_g_,_ 
  710.           November 1980, pp 506-511. 
  711.  
  712.           Compares various measures of the complexity of program 
  713.           control flow. 
  714.  
  715.      [2]  Curtis, B., S. Sheppard, P. Milliman, M. Borst and T. 
  716.           Love, "Measuring the Psychological Complexity of 
  717.           Software Maintenance Tasks with the Halstead and McCabe 
  718.           Metrics", I_E_E_E_ T_r_a_n_s_a_c_t_i_o_n_s_ o_n_ S_o_f_t_w_a_r_e_ E_n_g_i_n_e_e_r_i_n_g_,_ 
  719.           March 1979, pp 96-104. 
  720.  
  721.           Describes controlled experiment where performance on 
  722.           various maintenance tasks was related to software 
  723.           complexity measures. 
  724.  
  725.      [3]  Evangelist, W., "Software Complexity Metric Sensitivity 
  726.           to Program Structuring Rules", T_h_e_ J_o_u_r_n_a_l_ o_f_ S_y_s_t_e_m_s_ 
  727.           a_n_d_ S_o_f_t_w_a_r_e_,_ August 1983, pp 231-243. 
  728.  
  729.           This paper investigates the impact of various 
  730.           "structuring rules" on the complexity measurements 
  731.           obtained from various metrics. 
  732.  
  733.      [4]  Fitzsimmons, A. and T. Love, "A Review and Evaluation of 
  734.           Software Science". A_C_M_ C_o_m_p_u_t_i_n_g_ S_u_r_v_e_y_s_,_ March 1978, 
  735.           pp 3-18. 
  736.  
  737.           A classical paper discussing software science, its 
  738.           foundations and the empirical evidence which supports 
  739.           it. 
  740.  
  741.      [5]  Halstead, M., "Natural Laws Controlling Algorithm 
  742.           Structure?", A_C_M_ S_I_G_P_L_A_N_ N_o_t_i_c_e_s_,_ February 1972, pp 
  743.           19-26. 
  744.  
  745.           The seminal paper on Software Science - interesting 
  746.           reading. 
  747.  
  748.      [6]  Halstead, M., E_l_e_m_e_n_t_s_ o_f_ S_o_f_t_w_a_r_e_ S_c_i_e_n_c_e_,_ Elsevier 
  749.           North Holland, New York 1977. 
  750.  
  751.           The most complete description of Software Science 
  752.           available - a must for anyone who is seriously 
  753.  
  754.      
  755.      Copyright 1987 by SET Laboratories, Inc.
  756.  
  757.      Software Metrics Tutorial and METRIC 1.0 User's Guide          14
  758.      SET Laboratories, Inc.
  759.  
  760.  
  761.           interested in the area. 
  762.  
  763.      [7]  Harrison, W., K. Magel, R. Kluczny and A. DeKock, 
  764.           "Applying Software Metrics to Program Maintenance", 
  765.           I_E_E_E_ C_o_m_p_u_t_e_r_,_ September 1982, pp 65-79. 
  766.  
  767.           Description and discussion of many popular complexity 
  768.           metrics in each of the four categories: control flow, 
  769.           size, data and hybrid. 
  770.  
  771.      [8]  Harrison, W., "Software Complexity Metrics", J_o_u_r_n_a_l_ o_f_ 
  772.           S_y_s_t_e_m_s_ M_a_n_a_g_e_m_e_n_t_,_ July 1984, pp 28-30. 
  773.  
  774.           General discussion of software complexity metrics. 
  775.  
  776.      [9]  Harrison, W., "Applying McCabe's Complexity Measure to 
  777.           Multiple Exit Programs", S_o_f_t_w_a_r_e_-_P_r_a_c_t_i_c_e_ &_ 
  778.           E_x_p_e_r_i_e_n_c_e_,_ October 1984, pp 1004-1007. 
  779.  
  780.           Describes a new "short-cut" method of calculating this 
  781.           complexity measure, and provides a set of theorems and 
  782.           proofs supporting the technique. 
  783.  
  784.      [10] Lasses, J., D. van der Knijff, J. Shepherd and C. 
  785.           Lassez, "A Critical Examination of Software Science", 
  786.           J_o_u_r_n_a_l_ o_f_ S_y_s_t_e_m_s_ a_n_d_ S_o_f_t_w_a_r_e_,_ May 1982, pp 105-112. 
  787.  
  788.           Describes problems in application of software science 
  789.           and counting rules. 
  790.  
  791.      [11] McCabe, T., "A Complexity Measure", I_E_E_E_ T_r_a_n_s_a_c_t_i_o_n_s_ 
  792.           o_n_ S_o_f_t_w_a_r_e_ E_n_g_i_n_e_e_r_i_n_g_,_ December 1976, pp 308-320. 
  793.  
  794.           The first paper to combine the issue of control flow 
  795.           complexity with graph theory - a real classic in 
  796.           software metric circles. 
  797.  
  798.      [12] Oulsnam, G., "Cyclomatic Numbers Do Not Measure 
  799.           Complexity of Unstructured Programs", I_n_f_o_r_m_a_t_i_o_n_ 
  800.           P_r_o_c_e_s_s_i_n_g_ L_e_t_t_e_r_s_,_ December 1979, pp 207-211. 
  801.  
  802.           Describes problems with McCabe's measure of complexity 
  803.           when applied to unstructured programs. 
  804.  
  805.      [13] Salt, N., "Defining Software Science Counting 
  806.           Strategies", A_C_M_ S_I_G_P_L_A_N_ N_o_t_i_c_e_s_,_ March 1982, pp 58-67. 
  807.  
  808.           Describes the set of Software Science counting rules 
  809.           which are used in the METRIC 1.0 tool. 
  810.  
  811.  
  812.      
  813.      Copyright 1987 by SET Laboratories, Inc.
  814.  
  815.      Software Metrics Tutorial and METRIC 1.0 User's Guide          15
  816.      SET Laboratories, Inc.
  817.  
  818.  
  819.      [14] Shen, V., S. Conte and H. Dunsmore, "Software Science 
  820.           Revisited: A Critical Analysis of the Theory and Its 
  821.           Empirical Support", I_E_E_E_ T_r_a_n_s_a_c_t_i_o_n_s_ o_n_ S_o_f_t_w_a_r_e_ 
  822.           E_n_g_i_n_e_e_r_i_n_g_,_ March 1983, pp 155-165. 
  823.  
  824.           Critically discusses the theory behind Software Science 
  825.           and gives examples of situations where Software Science 
  826.           does not work. 
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.      
  867.      Copyright 1987 by SET Laboratories, Inc.
  868.  
  869.  
  870.  
  871.  
  872.  
  873.                              Table of Contents
  874.  
  875.  
  876.  
  877.      INTRODUCTION                                               2
  878.      SOFTWARE COMPLEXITY MEASURES                               2
  879.      USING METRICS                                              4
  880.      THE METRIC 1.0 TOOL                                        6
  881.      THE ROLE OF DATA COLLECTION IN METRIC APPLICATION          9
  882.      USING, DISTRIBUTING AND REGISTERING METRIC 1.0            11
  883.      TECHNICAL MATTERS                                         12
  884.      AN ANNOTATED BIBLIOGRAPHY OF THE SOFTWARE METRIC LITERATU 13
  885.