From: phardie@nastar.uucp (Pete Hardie)
Newsgroups: comp.software-eng
Subject: Re: Testing (Was: Do Software Engineers Actualy Do So Badly?)
Date: 15 Oct 92 14:42:57 GMT
Organization: Digital Transmission Systems, Duluth, GA.

In article <1992Oct14.032258.12820@sserve.cc.adfa.oz.au> ghm@sserve.cc.adfa.oz.au (Geoff Miller) writes:
>I qualified my earlier comments by pointing out that our experiences do
>differ, but my comments were based on my own experience and not just on
>theory.  We have developed a number of routines to facilitate the selection,
>viewing and editing of database records and have used these in a several
>different applications.

Sounds like an excellent project.  Does the format of the database record
need to be a specific one, or can any record of any format be selected/viewed/
edited?  If the routines restrict the format of the database records, then
you have oly a partial solution, since you now have to limit your data to
that format.

>I should point out, though, that this has happened not by accident but 
>by deliberate policy.  The routines have been developed to be re-usable,
>and system design has been done to make maximum possible use of them.

Out of curiosity, how many different projects have used this library, and how
related are those projects.  IMHO, real reusability comes when a routine
written for a video processing application is use in a banking project.

>I would also take issue with your "baroque" comment.  In my experience
>the re-usable routines are simple rather than complex.

Perhaps I was unclear.  An example, in C:

GenericSortingFunction(thingsToSort,comparisonFunction,numberOfThingsToSort
						,howToGetNextThing)
void *thingsToSort;				/* the array/linked-list/whatever to sort */
void *(comparisonFunction)();	/* comparison function, includes 'direction
									of sort (ascending/descending) */
unsigned long numberOfThingsToSort;	/* count of elements */
void *(howToGetNextThing)();		/* function to get next element, since
										it can be an array, or linked list, or
										doubly-linked list, etc */
{
	/* search for elements needing swapping, in sort manner */
	.
	.
	.
	Now here it gets the baroque part - you need a swap variable to store one
	element while swapping, in a generic case.  How do you assign the value
	to that variable, when you do not have the specific type, except through
	a memory copy, which requires more parameters (size)

	/* swap elements */
	.
	.
	.
}

>I don't agree at all.  A function/subroutine does not return an unlimited
>range of parameters, although a parameter may be multivalued.  To take the
>example of a sort procedure, what does it return  -  a list of sorted
>values, delimited in some system-dependent manner, and possibly (IMHO,
>desirably) the number of values.  I can very simply test this latter
>parameter to determine whether the routine functioned correctly and
>appropriately, and process the results accordingly.

I was unclear.  An IC gate, or input line, etc, has 2 values, and only those
2 (they vary from exact values, but they are not read as ranges).  A function
can return many values, and that complicates the design, since each value
must be handled.  If we were limited to binary return codes, we would have
better automatic software generators, but much larger programs w/r/t source
code.

For another example, take a digital thermomometer.  From an EE standpoint, it
returns a bit pattern on a set of parallel data lines.  Each line has either
a +5 volt value or 0 volts.  From a software view, that thermometer returns
numbers from -20 to 100, all of which must be handled.  THAT is the complexity
that I refer to.



-- 
Pete Hardie:  phardie@nastar  (voice) (404) 497-0101
Digital Transmission Systems, Inc., Duluth GA
Member, DTS Dart Team           |  cat * | egrep -v "signature virus|infection" 
Position:  Goalie               |
Newsgroups: comp.software-eng