home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume20 / metrics / part01 next >
Encoding:
Internet Message Format  |  1989-09-18  |  10.6 KB

  1. Subject:  v20i008:  Tools for generating software metrics, Part01/14
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Brian Renaud <huron.ann-arbor.mi.us!bdr>
  7. Posting-number: Volume 20, Issue 8
  8. Archive-name: metrics/part01
  9.  
  10. The C metrics package has been written by Brian Renaud and Richard E.
  11. Cobb, is in the public domain, and may be used by any person or
  12. organization, in any way and for any purpose.
  13.  
  14. I wrote kdsi as a companion to our "WICOMO" estimating tool.  (The late
  15. Wang Institute's implementation of Boehm's COCOMO model.)  Rick Cobb wrote
  16. the original version of mccabe, which I subsequently modified.  His work
  17. on mccabe inspired me to write the halstead tool and to implement a
  18. metrics project at our company.  I analyzed two projects, a pascal
  19. compiler and a distributed software distribution and control product, both
  20. in the range of 30,000 to 40,000 delivered source instructions.
  21.  
  22. Brian Renaud   bdr@huron.ann-arbor.mi.us
  23. Huron Systems  {ames, uunet!umix}!sharkey!clip!huron!bdr
  24.  
  25.                paper: Brian Renaud
  26.                       8419 Berkshire Dr.
  27.                       Ypsilanti, MI 48198
  28.                       USA
  29. ---- Cut Here and unpack ----
  30. #!/bin/sh
  31. # shar:    Shell Archiver  (v1.22)
  32. #
  33. # This is part 1 of a multipart archive                                    
  34. # do not concatenate these parts, unpack them in order with /bin/sh        
  35. #
  36. #    Run the following text with /bin/sh to create:
  37. #      README
  38. #      Rights
  39. #      Authors
  40. #      filelist
  41. #      doc/References
  42. #      doc/Results1
  43. #      doc/Results2
  44. #      doc/halstead.doc
  45. #      doc/kdsi.1L
  46. #      doc/mccabe.doc
  47. #      src/control/README
  48. #      src/control/altkdsi
  49. #      src/control/altparse.prs
  50. #      src/control/example_spec
  51. #      src/control/gather_stats
  52. #      src/control/pascal_stats
  53. #      src/control/proj_stats
  54. #      src/halstead/Makefile
  55. #      src/halstead/c_halsfilt.l
  56. #      src/halstead/c_halsfilt_c
  57. #      src/halstead/halstead.sh
  58. #      src/halstead/test.result
  59. #      src/halstead/README
  60. #      src/kdsi/Makefile
  61. #      src/kdsi/kdsi.c
  62. #      src/kdsi/test.result
  63. #      src/mccabe/Makefile
  64. #      src/mccabe/mccabe.sh
  65. #      src/mccabe/test.result
  66. #      src/parse.sccs/parse.prs
  67. #      src/testfiles/test1.c
  68. #      src/testfiles/test2.y
  69. #      src/testfiles/test3.c
  70. #      src/utils/Makefile
  71. #      src/utils/argfiles.c
  72. #      src/utils/argfiles.h
  73. #      src/utils/bdr.h
  74. #      src/utils/stripcom.c
  75. #      src/utils/stripstr.c
  76. #      src/Makefile
  77. #
  78. # ensure that we have the directories we need
  79. #
  80. for dir in doc src src/control src/halstead src/kdsi src/mccabe \
  81.     src/parse.sccs src/testfiles src/utils src/bin
  82. do
  83.     if [ ! -d $dir ]
  84.     then
  85.         echo making $dir
  86.         mkdir $dir
  87.     fi
  88. done
  89. #
  90. if test -r s2_seq_.tmp
  91. then echo "Must unpack archives in sequence!"
  92.      next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
  93.      exit 1; fi
  94. echo "x - extracting README (Text)"
  95. sed 's/^X//' << 'SHAR_EOF' > README
  96. XC metrics package.
  97. X
  98. XWhat's where?
  99. X
  100. X    ./Rights - what you can do with this software
  101. X
  102. X    ./Authors - self-serving drivel
  103. X
  104. X    ./README - you are here
  105. X
  106. X    doc/ - various pieces of documentation, including results of some
  107. X           experiments
  108. X
  109. X    src/ - source for the various tools.  "cd src; make all"
  110. X
  111. XProblems?
  112. X
  113. X    Ugly code.
  114. X
  115. X    Requires N passes over a file (N == number of tools) to completely
  116. X    gather statistics for that file.
  117. X
  118. X    Mccabe uses heuristics to determine start of function.
  119. X
  120. X    Conte, Dunsmore and Shen [see doc/References] suggest that the 
  121. X    halstead "n2" "may be useful in identifying at an early stage those
  122. X    modules most likely to contain errors" (pg 347).  Currently, the
  123. X    halstead model does not print n2.  (This is easy to change, but then
  124. X    you need to change the scripts in src/control.)
  125. X
  126. X    My definition of metrics may differ from other sources.
  127. X
  128. XTodo?
  129. X
  130. X    Someone (hint) should modify the front end of a freely redististributable
  131. X    compiler to deterministically collect all of these statistics in one
  132. X    pass over the source file.
  133. X
  134. X    If you are motivated to do work or have bug fixes, send them to me.
  135. X
  136. XBuilding a better model.
  137. X
  138. X    If you find that these tools assist you in developing or maintaining
  139. X    software, please let me know how.  Also, if you have performed some
  140. X    statistical analysis of interest, please let me know.  If there is
  141. X    general interest, I will be glad to moderate discussions on using
  142. X    software metrics and send out updates and new tools.
  143. SHAR_EOF
  144. chmod 0644 README || echo "restore of README fails"
  145. echo "x - extracting Rights (Text)"
  146. sed 's/^X//' << 'SHAR_EOF' > Rights
  147. XUnless otherwise noted, the following statement applies to the software
  148. Xdistributed in the metrics package.
  149. X
  150. XThe C metrics package has been written by Brian Renaud and Richard E. Cobb,
  151. Xis in the public domain, and may be used by any person or organization, in
  152. Xany way and for any purpose.
  153. X
  154. XThere is no warranty of merchantability nor any warranty of fitness for a
  155. Xparticular purpose nor any other warranty, either express or implied, as to
  156. Xthe accuracy of the enclosed materials or as to their suitability for any
  157. Xparticular purpose.  Accordingly, we assume no responsibility for their use
  158. Xby the recipient.  Further, we assume no obligation to furnish any
  159. Xassistance of any kind whatsoever, or to furnish any additional information
  160. Xor documentation.
  161. X
  162. Xaddress as of August, 1989:
  163. X
  164. X     Brian Renaud:   bdr@huron.ann-arbor.mi.us
  165. X                     {ames, uunet!umix}!sharkey!clip!huron!bdr
  166. X
  167. X     Rick Cobb:      indetech!rec
  168. SHAR_EOF
  169. chmod 0644 Rights || echo "restore of Rights fails"
  170. echo "x - extracting Authors (Text)"
  171. sed 's/^X//' << 'SHAR_EOF' > Authors
  172. XI wrote kdsi as a companion to our "WICOMO" estimating tool.  (The
  173. Xlate Wang Institute's implementation of Boehm's COCOMO model.)  Rick
  174. XCobb wrote the original version of mccabe, which I subsequently modified.
  175. XHis work on mccabe inspired me to write the halstead tool and to implement
  176. Xa metrics project at our company.  I analyzed two projects, a pascal
  177. Xcompiler and a distributed software distribution and control product, both
  178. Xin the range of 30,000 to 40,000 delivered source instructions.
  179. XUnfortunately, failing revenues and disapointing results in the second
  180. Xproject ended the investigation.
  181. X
  182. XIn addition, Marty Leisner (leisner.henr@xerox.com) cleaned up the
  183. Xancient makefiles in the system.  However, any problems you might
  184. Xhave with the makefiles are due to my meddling, not to his efforts.
  185. X
  186. XAddresses:
  187. X
  188. X    Brian Renaud
  189. X    email:        domainish:  bdr@huron.ann-arbor.mi.us
  190. X                  uucp style: {ames, uunet!umix}!sharkey!clip!huron!bdr
  191. X
  192. X    paper mail:   8419 Berkshire Dr.
  193. X                  Ypsilanti, Michigan  48194
  194. X                  USA
  195. X
  196. X    Rick Cobb 
  197. X    email:        indetech!rec
  198. X
  199. X
  200. XBrian Renaud
  201. XAugust 11, 1989
  202. SHAR_EOF
  203. chmod 0644 Authors || echo "restore of Authors fails"
  204. echo "x - extracting filelist (Text)"
  205. sed 's/^X//' << 'SHAR_EOF' > filelist
  206. XREADME
  207. XRights
  208. XAuthors
  209. Xfilelist
  210. Xdoc/References
  211. Xdoc/Results1
  212. Xdoc/Results2
  213. Xdoc/halstead.doc
  214. Xdoc/kdsi.1L
  215. Xdoc/mccabe.doc
  216. Xsrc/control/README
  217. Xsrc/control/altkdsi
  218. Xsrc/control/altparse.prs
  219. Xsrc/control/example_spec
  220. Xsrc/control/gather_stats
  221. Xsrc/control/pascal_stats
  222. Xsrc/control/proj_stats
  223. Xsrc/halstead/Makefile
  224. Xsrc/halstead/c_halsfilt.l
  225. Xsrc/halstead/c_halsfilt_c
  226. Xsrc/halstead/halstead.sh
  227. Xsrc/halstead/test.result
  228. Xsrc/halstead/README
  229. Xsrc/kdsi/Makefile
  230. Xsrc/kdsi/kdsi.c
  231. Xsrc/kdsi/test.result
  232. Xsrc/mccabe/Makefile
  233. Xsrc/mccabe/mccabe.sh
  234. Xsrc/mccabe/test.result
  235. Xsrc/parse.sccs/parse.prs
  236. Xsrc/testfiles/test1.c
  237. Xsrc/testfiles/test2.y
  238. Xsrc/testfiles/test3.c
  239. Xsrc/utils/Makefile
  240. Xsrc/utils/argfiles.c
  241. Xsrc/utils/argfiles.h
  242. Xsrc/utils/bdr.h
  243. Xsrc/utils/stripcom.c
  244. Xsrc/utils/stripstr.c
  245. Xsrc/Makefile
  246. SHAR_EOF
  247. chmod 0644 filelist || echo "restore of filelist fails"
  248. echo "x - extracting doc/References (Text)"
  249. sed 's/^X//' << 'SHAR_EOF' > doc/References
  250. XPreface:  If you have expertise in metrics and/or formal estimation models
  251. Xyou will no doubt find my comments annoyingly inane.  Save the stress on
  252. Xyour cerebral arteries; stop reading now.  If however, you are a tadpole of
  253. Xsoftware engineering, you may find some of these references useful.
  254. X
  255. XVarious books and articles I have run across which discuss various software
  256. Xengineering metrics:  (software tools relevant to the area in parenthesis)
  257. X
  258. X
  259. XFor all aspects of software engineering and software engineering metrics:
  260. X
  261. XA1.    S.D. Conte, H.E. Dunsmore, V.Y Shen, _Software Engineering
  262. X    Metrics and Models_, The Benjamin/Cummings Publishing Company, Inc.,
  263. X    Menlo Park, California, 1986.
  264. X    [Nicely done.  You should have this book if you are interested
  265. X    in SE metrics/models]
  266. X
  267. XA2.    Edward Yourdon, editor, _Classics in Software Engineering_,
  268. X    YOURDON Press, New York, New York, 1979. 
  269. X
  270. XA3.    Edward Yourdon, editor, _Writings of the Revolution: Selected
  271. X    Readings on Software Engineering_, YOURDON Press, New York,
  272. X    New York, 1982. 
  273. X    [All (well, many) of those landmark articles from the '60s and '70s
  274. X    that are frequently sited, but unavailable to those of us without
  275. X    thirty year journal collections are in these two books.  I'd
  276. X    suggest that you buy them if they are still in print.]
  277. X
  278. XA4.    Tom DeMarco, _Controlling Software Projects: Management,
  279. X    Measurement and Estimation_, YOURDON Press, New York, New York,
  280. X    1982.
  281. X    [A very good book! Lots of ideas and cheerleading for developing
  282. X    your own organizational metrics.  The algorithm for the halstead
  283. X    tool I wrote was extracted from an appendix of this book.]
  284. X
  285. XA5.    Londeix, Bernard, "Cost Estimation for Software Development",
  286. X    Addison-Wesley Publishing Company, 1987 (ISBN 0-201-17451-0)
  287. X    [I've bought it, but haven't had time to read it.  Primary
  288. X    focus is on the Putnam model.]
  289. X
  290. XA6.    Zuse, Horst and Bollmann, Peter, "Software Metrics: Using Measurement
  291. X    Theory to Describe the Properties and Scales of Static Software
  292. X    Complexity Metrics", ACM SIGPLAN Notices Vol. 24, No. 8 (August 1989)
  293. X    [Discusses limitations on how various complexity measurements
  294. X    can be used.  Probably applicable to all metrics.  Very interesting,
  295. X    although difficult reading for someone of my limited mental abilities.]
  296. X
  297. X
  298. XModels based on source lines of code (kdsi - COCOMO) and function points
  299. X
  300. XB1.    Barry W. Boehm, _Software Engineering Economics_, Prentice-Hall,
  301. X    Inc., Englewood Cliffs, NJ, 1981.
  302. X    [A "must have" book.]
  303. X
  304. XB2.    Allan J. Albrecht and John E. Gaffney, Jr., "Software Function,
  305. X    Source Lines of Code, and Development Effort Prediction: A Software
  306. X    Science Validation", IEEE Transactions on Software Engineering
  307. X    Vol. SE-9, No. 6 (November 1983).
  308. X
  309. XB3.    Charles A. Behrens, "Measuring the Productivity of Computer
  310. SHAR_EOF
  311. echo "End of part 1"
  312. echo "File doc/References is continued in part 2"
  313. echo "2" > s2_seq_.tmp
  314. exit 0
  315.  
  316.  
  317.