Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!tektronix!reed!psu-cs!warren From: warren@psu-cs.UUCP (Warren Harrison) Newsgroups: comp.software-eng Subject: Re: C code metrics Message-ID: <803@psu-cs.UUCP> Date: 1 Jul 88 20:44:41 GMT References: <4820@cg-atla.UUCP> Distribution: comp Organization: Dept. of Computer Science, Portland State University; Portland OR Lines: 49 > Request for Help: > > I've recently been reading DeMarco's "Controlling Software Projects" > (Yourdon Press 1982), and am now interested in adding some metrics > to our project. However, his metrics are designed for EDP projects > written in COBOL. We have an interactive system written in C and > running UNIX. Can any net readers offer advice about or tools for > measuring the following: > > Code Volume > Past attemps to measure the size of code have used > number of lines. However, this appears to be pretty > inaccurate. DeMarco suggests that counting the > number of operands and operators and multiply by > the log(base 2) of the number of unique identifiers > is a much more accurate measure. Anyone have a > program to parse C code and do this? What about > including .h files and macros? > > Code Quality > DeMarco suggests analysing code by counting the > number of entry and exit points from routines, > looking for GOTOs, etc. Anyone have a program > that could parse C code and at least give > some indication of relative complexity of > different modules and perhaps hightlight > areas of code that might profit from a code > code review? > > > I'm looking both for information explaining how to judge the size and > quality of C code, and also for any tools that will automatically > perform some analysis. Send me email, and if I get any good info I'll > summarize to the net. Thanks in advance. > > > -- > Rob Bradlee w:(617)-658-5600 X5153 h:(617)-944-5595 > Compugraphic Corp. ...!{ima,ulowell,ism780c}!cg-atla!bradlee > 200 Ballardvale St. > Wilmington, Mass. 01887 The Nordic Way: Ski till it hurts! Look into PC-METRIC from SET Laboratories [503-289-4758]. Does Halsteads Software Science (the operator/operand strategy you refer to) and Cyclomatic Complexity. Versions for C, Pascal, Modula-2, COBOL, FORTRAN, etc. It was reviewed in this month's Computer magazine from IEEE. --- I admit I work for them sometimes ... but I'm just answering the guy's question ---