From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 19 May 93 22:09:53 GMT From: sparky!sparky!dwb@uunet.uu.net (David Boyd) Subject: Re: McCabe package for Ada? Message-ID: <1993May19.220953.20443@sparky.imd.sterling.com> List-Id: In article , groleau@e7sa.crd.ge.com (Wes Groleau X7574) writes: |> P.S. One thing McCabe doesn't show is what I call "hidden" complexity. |> Hidden, because it doesn't show on a flow chart or path graph. This kind of |> complexity is produced by a technique more than one of my former colleagues |> was fond of: That of declaring lots of "flag" variables, and using them to |> control branching at a point far away from where they were set. I'd like |> to see someone come up with a McCabe-like metric where if dotted lines are |> drawn on a control graph connecting the setting of one of these flags with |> all tests that depend on that setting, the metric would be affected by |> these lines and their nodes. Whew! What's the complexity metric of that |> last |> sentence?!?!? |> Actually the McCabe folks have come up with some metrics for just that situation. The first is global data complexity (gv(G)) which calculates the number of paths through a module which touch global data. Another metric is user data complexity (uv(G)) which looks at the complexity of a module with respect to a single user data element. Both of these are extremely usefull to me both from a quality analysis point of view as well as from a maintenance point of view. This is especially usefull if a tool will display the flow graph of all functions which reference a data element and highlight the paths which reference the element. This would make it extremely easy to determine what tests needed to be run when a given variable changes. Another complexity measure they came up with is pathological complexity (pv(G)) which measures those truely awfull conditions in code such as branches into loops or decisions. You know the stuff you shoot people for or would only expect from a 10 year olds first program. -- David W. Boyd UUCP: uunet!sparky!dwb Sterling Software IMD INTERNET: dwb@IMD.Sterling.COM 1404 Ft. Crook Rd. South Phone: (402) 291-8300 Bellevue, NE. 68005-2969 FAX: (402) 291-4362