Re: Test first as specification



"Laurent Bossavit" <laurent@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:MPG.1d5a20c7f1fc975698995b@xxxxxxxxxxxxxxx
>
> It's much easier to find cases where a comprehensive test suite was
> built after the fact, and is useful to the original implementors, to
> vendors of "compliant" alternatives, and even to end users. Ada, Lisp,
> Fortran, Java - most prominent languages have test suites.

Right, to validate a specification, not to be the specification, in some
sense.
>
> Many TDD practitioners report, and my experience tends to confirm, that
> developing comprehensive test suites after the fact and results in tests
> that are harder to write and maintain, and which don't read as well. I
> wouldn't be surprised if someone finally took the hint and wrote a
> language test-first - not necessarily TDD, but at least building the
> test suite systematically in parallel with the implementation.
>
> "Specifying by tests" sounds a bit more ambitious, and ambiguous.

But you suggest otherwise in your response to Paul Campbell.

> 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...
>
A specification of a modern programming language is based on theory. By
it's very nature, a specification is going to be a more economical
expression of the language than the suite of tests required to validate an
implementation. I would venture to guess that for the languages you refer
to above, there are many more people intimately familiar with the
specifications than the test suites. The test suites are important, it's
good that they're there, it's good that somebody took the trouble to write
them, but they're not normative, and most of us will never look at them.
They're more important to compiler implementors than to language designers.

-- Daniel Parker



.



Relevant Pages

  • Re: Test first as specification
    ... > standard test suites and benchmarks for C and C++. ... The same goes for the XSLT specification. ... and occaisonally still sample the C++ sample newsgroup. ... language implementation, the discussion is always with reference to the ...
    (comp.object)
  • Re: Test first as specification
    ... >Do you know of any prior experience with specifying a programming ... >language by tests? ... standard test suites and benchmarks for C and C++. ... "The aim of science is not to open the door to infinite wisdom, ...
    (comp.object)