Re: Test first as specification



On Wed, 3 Aug 2005 02:46:03 +0200, Laurent Bossavit wrote:

> "Specifying by tests" sounds a bit more ambitious, and ambiguous. There
> are different areas to specify, more or less independent of each other;
> the language syntax, the semantics with respect to some abstract
> machine, the binary code generated, features such as garbage
> collection...

It does not sound any realistic. Apart from requirements like: the tasking
construct A does have race condition. [ Have a test for that? ]

But OK, just consider usual floating-point specification: for any two
operands X and Y, if the precise mathematical result of the operation X@Y
lies in the interval [L,U], where L and U are two adjacent machine numbers,
then the implementation of @ should return either L or U. Now, what would
be the test? To enumerate all floating-point numbers seems a minor problem
compared to, where to get that damned results of @?

Note that a validation suite is a very different thing than specification
by tests. If I know the behavior of @ in advance, if I know the
implementation of @, then I can relatively easily test *that*
implementation of *the* function with a good coverage.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.