[comp.software-eng] Surface area for software

shan@unc.cs.unc.edu (Yen-Ping Shan) (05/04/89)

Sorry about the confusion raised by my previous posting.  English is not my
native language.  I didn't realize that "surface area" has a more common
meaning.  Let me try to get it straight this time.

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."

What I am interested in is:
1. Who invented the term "surface area?"  Under what context?
2. Is there a more precise definition?
3. Is there a systematic way to compute surface area?  (So that we can
	say, for example, the surface area between module A and B is 10 and
	the surface area between module B and C is 100, therefore B and C
	are more closely coupled than A and B.)

Thanks.
				---Shan---

render@m.cs.uiuc.edu (05/05/89)

Written  5:06 pm  May  3, 1989 by shan@unc.cs.unc.edu:
>Sorry about the confusion raised by my previous posting.  English is not my
>native language.  I didn't realize that "surface area" has a more common
>meaning.  Let me try to get it straight this time.
>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."

I'm sorry I misunderstood you.  I don't think Cox chose the term well (if 
indeed he did choose the term) given what he intends for it to mean.  I 
would've said "object context" or "object interface".  His definition is
so vague (possibly intentionally) that any concrete means of calculating
"surface area" is difficult to specify.  You might take a look at papers
discussing the quantification of module interfaces for more help.  I can
give you a couple of pointers if you want.

Hal Render
render@cs.uiuc.edu

markv@hpmwtd.HP.COM (Mark VanMeeter) (05/05/89)

>> Can anyone give or point me to a precise definition of "Surface
>> Area?"  Is there a system that allows me to compute the value of the
>> surface area?

>Seriously?  A surface is the outside of an object or body; its area is the 
>amount of surface measured in two-dimensions.  Take a look at any decent 
>integral calculus book for basic formulas for calculating surface area.  If 
>you want a more detailed examination, look at a mathematical topology book.
>If you want an automated aid for calculating surface area, try some symbolic 
>computation program like mathematica.  (Aren't CS students required to take 
>calculus anymore?)  

Did you notice that this was comp.software-eng and not comp.math.weenies?
Did it cross your mind that "surface area" might be CS jargon?

The original poster is undoubtedly referring to the concept of interface
complexity in a software system.  The concept is defined in Brad Cox's
book, "Object Oriented Programming: An Evolutionary Approach", Addison-Wesley,
1987, ISBN 0-201-10393-1.

dave@lethe.UUCP (Dave Collier-Brown) (05/08/89)

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      |