August 17, 2004

Unit Testing

So I've been overhearing things like "unit testing", as in "we'll let you write a script to do generic unit-testing".

There's a problem with this. Let's say a unit is some software component with a coherent set of functions. This set of functions is the component's interface. Now the notion of generic unit testing implies testing the interface meaning testing a.k.a. the set of functions. However, it doesn't make sense to do this generically.

Let's the component is the front-end of a compiler and one of its functions is Compile( filename ). I cannot see how this can be sensibly tested in a generic way. You can't just use random data for the filename parameter. Also there is no way to guarantee that this function will get called first. In order to that you are specifying semantics of the interface which by definition makes the test non-generic.

Posted by peter at August 17, 2004 02:25 PM
Comments
Post a comment









Remember personal info?