comp.lang.ada
 help / color / mirror / Atom feed
From: netcomsv!netcom.com!dani@decwrl.dec.com  (Dani Zweig)
Subject: Re: McCabe package for Ada?
Date: 4 Jun 93 06:24:07 GMT	[thread overview]
Message-ID: <daniC83348.MJ7@netcom.com> (raw)

By way of digression -- I had occasion, some time ago, to analyze the 
complexity of a large number (something over five thousand) of modules,
using McCabe's metrics and others.  (This was not an Ada environment --
something I'll comment on below.)

It turned out that there was a 96% correlation between the Cyclomatic
Complexity of a module and the number of statements in a module.  The
link is that Cyclomatic Complexity is almost perfectly correlated with
the number of decisions in a module, the number of decisions is almost
perfectly correlated with the number of IFs, and the *density* of IFs
is quite consistent, with the result that the number of IFs is almost
perfectly correlated with the number of statements.

Needless to say, Cyclomatic Complexity turns out to be an excellent
predictor of defects -- by virtue of the fact that long modules average
more defects than short modules.  All of which is to say that people
who measure Cyclomatic Complexity probably aren't measuring what they
think they're measuring.  (McCabe's Essential Complexity has its own
problems, but it's a *somewhat* better measure of the 'messiness' of a
module's control structure.)

The main caveat is that I was analyzing COBOL/MIS software.  There
is strong a-priori reason to believe that in an Ada/Embedded
environment, the correlation between Cyclomatic Complexity and
module length would be high -- but not that high.

-----
Dani Zweig
dani@netcom.com

   The inability of snakes to count is actually a refusal, on their part,
    to appreciate the Cardinal Number system. -- "Actual Facts"

             reply	other threads:[~1993-06-04  6:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-06-04  6:24 Dani Zweig [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-06-07 18:43 McCabe package for Ada? sgi!fido.asd.sgi.com!dblues!jackr
1993-06-05 19:29 David Boyd
1993-06-04 23:53 Kevin Sullivan
1993-06-04 22:07 dog.ee.lbl.gov!network.ucsd.edu!swrinde!cs.utexas.edu!csc.ti.com!tilde.cs
1993-06-04 21:44 Ala n R. Weiss
1993-06-04 21:25 Dani Zweig
1993-06-04 15:47 agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!w
1993-06-03 19:47 dog.ee.lbl.gov!network.ucsd.edu!sdd.hp.com!portal!lisburn!jaime
1993-05-27 17:55 Laurence VanDolsen
1993-05-26 22:42 David Boyd
1993-05-26 20:44 Wes Groleau X7574
1993-05-25 10:52 pipex!uknet!glasgow!unix.brighton.ac.uk!wjmc
1993-05-24 19:36 Alex Blakemore
1993-05-24  0:33 mole-end!mat
1993-05-19 23:04 David Boyd
1993-05-19 22:09 David Boyd
1993-05-19 21:18 agate!howland.reston.ans.net!darwin.sura.net!haven.umd.edu!news.umbc.edu!
1993-05-19 20:03 Wes Groleau X7574
1993-05-19 15:20 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
1993-05-19  0:44 sgi!fido.asd.sgi.com!dblues!jackr
1993-05-18 23:42 David Boyd
1993-05-18 21:26 dog.ee.lbl.gov!overload.lbl.gov!agate!howland.reston.ans.net!ux1.cso.uiuc
1993-05-18 19:24 dog.ee.lbl.gov!network.ucsd.edu!usc!howland.reston.ans.net!europa.eng.gte
replies disabled

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