Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!elephant.cis.ohio-state.edu!weide From: weide@elephant.cis.ohio-state.edu (Bruce Weide) Newsgroups: comp.software-eng Subject: Re: Reusability considered harmful??(!!) Message-ID: <88431@tut.cis.ohio-state.edu> Date: 14 Feb 91 21:41:02 GMT References: <6108@stpstn.UUCP> <87829@tut.cis.ohio-state.edu> <6248@stpstn.UUCP> <1991Feb11.103100.112@skyler.mavd.honeywell.com> Sender: news@tut.cis.ohio-state.edu Reply-To: Bruce Weide Organization: Ohio State University Computer and Information Science Lines: 41 In article <1991Feb11.103100.112@skyler.mavd.honeywell.com> djbailey@skyler.mavd.honeywell.com writes: > >A sine routine ought to be a very good candidate for a reusable >component, but we got bit by a subtle problem. This is one case where >the algorithm selected was very important and I am interested in how a >"specification and object code" system would handle it. > Handling this problem (a sine routine that isn't too accurate for some particular range of values) in a "specification and object code" reuse scenario is based on the idea that a single abstract concept can have multiple plug-compatible implementations. Bill Ogden's recent note about the specification of such an abstraction as a sine routine is important. The specification is relational, i.e., it doesn't say that the routine must return the mathematical sine of its argument; it says that the value returned is within some bound of the true sine. (The allowable error may even be a parameter to the reusable component that exports the sine routine. Call it a tolerance if you want :-).) Now there are many possible implementations of a sine function that satisfy this behavioral specification. Any of them should work. However, some may be more or less efficient, in one sense or another. Perhaps some are faster for arguments near zero, others for arguments away from zero, or whatever. It is not necessarily true that one implementation dominates the others in all relevant performance dimensions. If I sell you the behavioral specification along with object code (and preformance information for each implementation) -- but NOT source code -- you still have all the information you need in your example. Of course, I should also guarantee that the object code works, but that will be needed in any case. Will you trust me if I say that, even if I don't provide source code? (Possibly not... do you trust, say, the Macintosh toolbox? Seems pretty robust to me, and I've never seen the source code for it.) But certainly in principle there is no reason to believe that your own methods of certifying correctness of implementations should be any better than those of, say, an independent laboratory that offers its official seal of approval. -Bruce