comp.lang.ada
 help / color / mirror / Atom feed
From: dog.ee.lbl.gov!network.ucsd.edu!swrinde!cs.utexas.edu!hermes.chpc.utexas. edu!cfi.org!dogface!oakhill!cydonia.sps.mot.com!alanw@ucbvax.Berkeley.EDU  (Ala n R. Weiss)
Subject: Re: McCabe package for Ada?
Date: 4 Jun 93 21:44:30 GMT	[thread overview]
Message-ID: <C849q6.7rB@oakhill.sps.mot.com> (raw)

In article <1993Jun4.154720.23587@saifr00.cfsat.honeywell.com> shanks@saifr00.c
fsat.honeywell.com (Mark Shanks) writes:

...

>Well, at the risk of appearing hopelessly inept, I have a problem
>with high McCabe values as a necessary indicator of procedure
>complexity/lack of maitainability. I have procedures that are
>logically grouped by function, for example, displaying aircraft
>brake antiskid failure messages. There are six possible messages,
>plus the condition of blanking the display for invalid data
>conditions. I am checking the status of 64 input parameters 
>(mostly Booleans) to determine which message/combination of messages
>should be displayed. (If XXXXXX and then YYYYY then...)
>Based on the nature of this McCabe metric, the count of IFs and
>ELSEIFs gets quite high very quickly, yet the code is quite
>simple to follow. I have the option of breaking this function up 
>into smaller procedures (this procedure has 186 logical lines of
>code), but that wouldn't make it any less complicated or more
>maintainable. Any suggestions? Should I care if the McCabe is
>high but the code is obviously not complex and after exhaustive
>testing has no defects?
>
>Mark Shanks
>shanks@saifr00.cfsat.honeywell.com

I can't speak for why the mccabe algorithm rates this as high complexity,
but from a logic perspective consider this:  the use of many, many
IF xxxx THEN yyyy statements indicates a LOT of logic has to be
correlated and checked.  You are essentially testing on a state within
a (hopefully) finite state machine, which is just fraught with opportunities
for defects.  While the CODE may be easy to understand, the LOGIC may
not be (especially when you need to use multiple IF and NOT's in
combination to get to the proper state check).  I've seen OS code
at deep levels (kernel) that does this, and it was a bitch to debug
and fix defects.  So, from an intuitive perspective, a high McCabe
number DOES correlate, in this case, to a higher probability of defects.

Really, I just McCabe numbers to give me an idea of where I should
concentrate testing and possibly re-work in development.


-- 
  _ Alan R. Weiss  Motorola-Semiconductor Products Sector, RISC Software
_| ~-. 6501 William Cannon Dr. West, MD-OE112, Austin, Texas USA 78735
\, *_} alanw@pets.sps.mot.com or alanw@cydonia.sps.mot.com | Voi: 512-891-6003
  \(   DISCLAIMER:  I do not speak for Motorola, Inc.      | Fax: 512-891-3798

             reply	other threads:[~1993-06-04 21:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-06-04 21:44 Ala n R. Weiss [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: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-04  6:24 Dani Zweig
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