Path: utzoo!mnetor!tmsoft!dptcdc!lethe!dave From: dave@lethe.UUCP (Dave Collier-Brown) Newsgroups: comp.software-eng Subject: Re: Surface area for software Summary: one possible formula... Message-ID: <2481@lethe.UUCP> Date: 8 May 89 00:18:05 GMT References: <8026@thorin.cs.unc.edu> <39400020@m.cs.uiuc.edu> Reply-To: dave@lethe.UUCP (Dave Collier-Brown) Organization: Officially bimodal now, News courtesy of Systems Software Lines: 67 Written 5:06 pm May 3, 1989 by shan@unc.cs.unc.edu: | Cox in his book, "Object Oriented Programming" p. 16, defines the "surface | area" as "the number of things that must be understood and properly dealt | with for one programmer's code to function correctly in combination with | another's." In article <39400020@m.cs.uiuc.edu> render@m.cs.uiuc.edu writes: | I don't think Cox chose the term well (if indeed he did choose the | term) given what he intends for it to mean. Ok, lets try a few possible meanings and see if we can come up with something thats usefull: let ops be the number of operations defined in a module args be the number of parameters and external variables needed by a given op. unique args be the number of non-duplicate args defined for two or more ops. common args be the args used by every op. let minset be the smallest set of operations which are required to do any meaningfull operation via the interface [note 1] surface area ::= width * depth depth ::= (minset * 1) + (ops * FUDGE1) [note 2] width ::= (common args * 1) + (unique args - common args) * FUDGE2 As you can see, this is a measure of the length of the parameter lists (expressed in tokens) times the number of parameter lists. The required information is weighted higher than information which is only used in some cases... And if you could write parameter-lists succinctly in a table, it might even be an analogy of the physical surface area of the table. [note 3] Now, is it usefull? Is it intuitive? What do we have to add to it to make it usefull for something. Indeed, even if we get it "right", what are we masuring and why is it important? [note 1] I don't have a formalism for this, but for the case of file i/o the minset would probably be {open, read|write, close}. [note 2] I'm not even going to **try** to estimate weightings. [note 3] An example: name returns args ==== ======= ====================== open fd name mode cookie close rc fd read rc fd data size write rc fd data size seek rc fg amount from ops = 5 minset = 3 unique args = 9 common args (for minset?) 3 ? depth = (3) + (5 * FUDGE1) width (3) + (9 - 3) * FUDGE2 surface area = (3 + 5*F1) * (3 + 6*F2) if both fudges are .1, we get 3.5 * 3.6 or 12.6 --dave -- David Collier-Brown, | {toronto area...}lethe!dave 72 Abitibi Ave., | Joyce C-B: Willowdale, Ontario, | He's so smart he's dumb. CANADA. 223-8968 |