Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!uw-beaver!apollo!ulowell!cg-atla!bradlee
From: bradlee@cg-atla.UUCP (Rob Bradlee X5153)
Newsgroups: comp.software-eng
Subject: C code metrics
Keywords: metrics quality
Message-ID: <4820@cg-atla.UUCP>
Date: 28 Jun 88 14:07:00 GMT
Distribution: comp
Organization: Compugraphic Corp., Wilmington, Mass
Lines: 41

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!