From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,60e2922351e0e780 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-13 20:57:45 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 13 Nov 2003 22:57:43 -0600 Date: Thu, 13 Nov 2003 23:57:41 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Clause "with and use" References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-EZ9qhM1t5ntpGRjOKB7q16UGQu38k+KSKcUBnfnfSQx9oQ9X9IQBig5H0IXXwJyo5g5WKvi9/rjPOv7!J+/T8cQjuFhVIknkemcFmTbQj9dk0Fb7WQ/3ptJaPnIVLVdYDH1DD3R7+P/n4A== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:2469 Date: 2003-11-13T23:57:41-05:00 List-Id: tmoran@acm.org wrote: > So in a 150 package system with goodness 5, if a package can be split > with no more than 8 specs that will need to 'with' *both* A1 and A2, and > no more than 9 such bodies, doing the split will make the system "better". You forgot the with clauses on package A. Of course, you could get tricky and create a child package for A. But then again, if there is a part of A where spliting part of A into child package increases cohesion, why shouldn't the measure recognize that? In fact if you do a good job of restructuring an application using child packages you may be able to reduce the goodness measure substantially. Is that wrong? Probably not. But like all software engineering statistics you can probably abuse this one. > Does a similar metric - limiting the context necessary for some > piece of code - apply to the size of a procedure or its number of > variables, or the number of first-level components of a record, etc? You will have to look at some of the MITRE papers to see measures like that. I did some work on it. Chris Byrnes implemented DIANA Query Language (DQL) that allowed some measurements to be done on actual Ada code. This may be a paper on some additional MITRE work on coherence and coupling: Dharma, H. 1995, Quantitative Models of Cohesion and Coupling in Software, J. Systems Software, Vol. 29, Elsevier Science Inc., NY, NY, 65-74. (The name, time and title look right, but I don't have a copy and can't find one on-line.) The real conclusion I took away from all that was that measuring coupling and cohesion at the subprogram level in Ada is wrong. Or rather you might want to measure coupling from subprograms, but the target should always be packages. In other words, a procedure in Ada that only references one external package has good cohesion, a procedure that references ten packages has poor cohesion. If type declarations and operations on those types are well organized in Ada, this is the level of cohesion and coupling you see. It seems silly to count calls to "*" and "+" in a package separately, and similarly any method that favors making a variable visible instead of Get and Set operations should be looked on suspiciously... The measure I wrote about earlier is a "poor man's" way of getting this information. Since you only have to look at the with clauses, it is easy to write a program that gives you the "raw" data as well as compute a statistic for any library. Hmmm. I'd better get back to work... -- Robert I. Eachus 100% Ada, no bugs--the only way to create software.