comp.lang.ada
 help / color / mirror / Atom feed
* Re: Ada and McCabe's Cyclomatic complexity
@ 1993-07-09 12:35 Brandon
  0 siblings, 0 replies; only message in thread
From: Brandon @ 1993-07-09 12:35 UTC (permalink / raw)


parish@oti-hsv.com (Trace Parish) writes:

>Hi Gang,

>In a recent meeting where metrics were discussed someone stated (without
>any backup) that McCabe's Cyclomatic Complexity was not a valid measure
>for Ada.  He left before I could find out why.  Has anyone else heard of
>this problem.  It seems that since cyclomatic complexity is based on cycles
>in a control graph (approx. by decisions + 1) that it would be just as valid
>for Ada as for other languages.  Is there some problem with tasking that I



~
References: <C9v7Ly.DwD@oti-hsv.com>

I see no reason why McCabe is not a valid for Ada as any other language (;-) ).
We use it often in our Testing Ada Software Course to help analyze White
Box Coverage.  Again, it is not perfect but is an easy model to teach and
use.  There are some places where McCabe needs specific attention under Ada.  
Particularly, in the case of exceptions with could unrealistically raise the
apparent complexity of software. 


Also note, there was an article printed in Communications of the ACM (Dec 92,
p. 17-19 that presents that the correct mathematical formula should be:
 V(G) = e -n + p + 1 not V(G) = e - n  + 2 p.  This is where 
	e = number of edges
	n = number of nodes
	p = number of connected components 
	
Using this revised formula works much better with Ada since subprograms do
not affect the complexity as much forcing some users to manual put code
in-line to reduce the complexity

In all honesty, McCabe's Cyclomatic Complexity does have some problems, since
it does not (in original form) address data sensitizing and its level of 
coverage has been argued.  I would be very interested in other forms that 
people are using to measure complexity.  We have used both McCabe, 
LOC (5 kinds) and Halstead in our Complexity Measures Tool (CMT) and have 
found McCabe to be the second most widely used (Lines of Code as 
always is still the primary measure).  We are looking into other metrics now
and would appreciate any comments other people have had.  It would be nice to
bring some technical discussions to comp.lang.ada that would be worthy of 
crossposting :-)

Brandon Goldfedder
Director of Training and Consulting
EVB Software Engineering, Inc.


-- 
Freedom is doing what you like.
Happiness is liking what you do.

brandon@evb.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1993-07-09 12:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-07-09 12:35 Ada and McCabe's Cyclomatic complexity Brandon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox