Test-driven design (was: Comparing Dictionaries)



"Martin P. Hellwig" <mhellwig@xxxxxxxxx> writes:

But the funny thing that I have seen in the development scene is
that writing tests first and code later is a lot easier when you
have a technical specification to base it on. A technical
specification is of course based on a functional design. A
functional design is written on the base of the assignment and the
scope definition.

This is, to my mind, one of the greatest advantages of test-driven
development: if you're not clear on how the code will be used, you
can't write the test, and (by the discipline of TDD) you can't write
the code either.

Therefore, you're forced to confront the fuzziness of your design
*before* it causes you to write meaningless code – but only to the
extent necessary to write the code at hand. If understanding the code
you're about to write requires some more extensive design thinking,
that's all to the good; but if you have enough understanding to write
a test for the small area you're on, you don't need to do a huge
amount of design. The stark confrontation of needing to write the unit
test up front shows you the difference, at exactly the time it's most
useful.

There are many who call TDD "test-driven design" for this same reason.

--
\ "A child of five could understand this. Fetch me a child of |
`\ five." -- Groucho Marx |
_o__) |
Ben Finney
.



Relevant Pages

  • Re: What does your implementation process look like?
    ... Some people are used to total control of the medium in print, and the TV screen is just electronic paper. ... I usually point out that they wouldn't select content that could alienate, or even offended potential customers, why use design techniques that could. ... If I'm unsuccessful, or if I feel we can't come to an amicable understanding, I'm back to "I'd rather just not work with these people." ... That might argue in favor of a more fixed layout, at least in it's outer envelope. ...
    (alt.html)
  • Re: OSX vs XP
    ... > know when to Ctrl-click on a 1-button Mac either. ... Contrast with Wintel, ... but there are two broad categories of understanding; ... You'd go crazy trying to design a UI that ...
    (comp.sys.mac.advocacy)
  • Re: What Nyquist Didnt Say
    ... of understanding of the implications of the Nyquist theory, ... Wescott Design Services ... but of an understanding of definitions of the analysis signals to ... perfect vs adaptive filter ...
    (comp.dsp)
  • Immediate Job Opening for PHP Developers @ WA
    ... This position will include all aspects of the software development ... willingness to maintain existing PHP systems is preferred. ... solid understanding of template driven site architecture such as MVC ... common design patterns ...
    (comp.lang.php)
  • Re: OOA?
    ... Understanding the domain, and building models of the domain to aid ... >Also I am also trying to understand how domain-driven design fits in with XP ... > Our practice of DDD flows out of our continuous practice of STDD and ... > DDD also influences our choice to keep domain logic code totally free ...
    (comp.object)