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 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-11 11:46:50 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Eachus' Measure of Goodness (was: Clause "with and use") References: <3FA2CDCB.500F4AF0@fakeaddress.nil> <1068123815.335508@master.nyc.kbcfp.com> <3FAAB12E.C7593B45@fakeaddress.nil> <3FACCBFB.9D288CF2@fakeaddress.nil> <3FAF8C99.5040201@noplace.com> <7KWdnct0w8mEnyyiRVn-hA@comcast.com> In-Reply-To: <7KWdnct0w8mEnyyiRVn-hA@comcast.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Tue, 11 Nov 2003 19:46:49 GMT NNTP-Posting-Host: 63.184.32.12 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1068580009 63.184.32.12 (Tue, 11 Nov 2003 11:46:49 PST) NNTP-Posting-Date: Tue, 11 Nov 2003 11:46:49 PST Xref: archiver1.google.com comp.lang.ada:2369 Date: 2003-11-11T19:46:49+00:00 List-Id: Robert I. Eachus wrote: > If you want a single number to measure the "goodness" of the design, I > have been comfortable with (2S + B)/(N * ln(N)) where N is the total > number of compilation units and subunits, S is the number of with > clauses on package specs (including generic package specs) and B is the > number of with clauses on other units. Some people may disagree with > including separate subunits in N, but I seldom find designs abusing > that. There is a problem though is some compilation units are too > small, so I get concerned when the average size of compilation units is > outside the 100 to 1000 NCSLOC (non-comment source lines of code) range. Interesting. What are good values of this metric, and what indicates a problem? How do you deal with Ada.*, System.*, and Interfaces.* units? What about other "standard" libraries? For example, I have a simple program I run every day (it creates my signature file). It has a procedure body only, with 4 with clauses: with Ada.Numerics.Discrete_Random; with Ada.Text_IO; with Gnat.OS_Lib; with PragmARC.Get_Line; What are S, B, and N for this example? Do I count the with Ada.Text_IO; on the spec of PragmARC.Get_Line? What about any with clauses for Gnat.OS_Lib? What about those units? Do I count the with Ada.IO_Exceptions; on the spec of Ada.Text_IO? What about the 3 other with clauses on the spec of the GNAT implementation of Ada.Text_IO? To my mind this has S = 0, B = 4, and N = 1, giving G (for goodness) = 4, but to another person N may be greater than 10, counting all the parent packages and following every path until you reach units with no with clauses. Sorry for all the questions, but I like metrics, and always want to try out new ones. -- Jeff Carter "I would never want to belong to any club that would have someone like me for a member." Annie Hall 41