Re: TDD: Test-Driven Design or Test-Driven Development?
From: Nick Landsberg (hukolau_at_NOSPAM.att.net)
Date: 02/29/04
- Next message: Alfredo Novoa: "Re: Relational model versus object model"
- Previous message: Henk Verhoeven: "Re: Qualitative vs. Quantitative Object Context Change & Dialectics"
- Maybe in reply to: lilburne: "Re: TDD: Test-Driven Design or Test-Driven Development?"
- Next in thread: Phlip: "Re: TDD: Test-Driven Design or Test-Driven Development?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 29 Feb 2004 22:59:37 GMT
Robert C. Martin wrote:
> On Sun, 29 Feb 2004 17:45:41 GMT, Nick Landsberg
> <hukolau@NOSPAM.att.net> wrote:
>
>
>>
>>Phlip wrote:
>>
>>[SNIP] Other points will be replied to in another
>>post.
>>
>>
>>>If a project has super-high availability needs, you must ask the developers
>>>why they are _not_ writing tests before writing the tested code!
>>>
>>
>>Ahh! I think you may have found the right phrase to
>>enlighten me. What I get from the above sentence
>>is that this technique (TDD) involves writing/documenting
>>all the important test cases *before* starting coding.
>>(Am I correct?)
>
>
> Not quite. Using TDD you start writing tests first, but you don't
> write all of them first. Instead, you write just enough of a unit
> test to fail, then you make it pass by writing production code. Then
> you add to the unit test to make it fail, and then add to the
> production code to make it pass. This is a *very* tight loop that
> spans, perhaps, 1-10 minutes.
>
> At the same time, QA folks and business analysts write acceptance
> tests. These are automated tests written in a very high level
> scripting language (see http://fitnesse.org). These tests are written
> at the beginning of each 1-2 week iteration, and are the final written
> authority for the requirements. Developers receive them very early in
> the iteration and write their unit tests and production code to make
> these acceptance tests pass.
>
>>You are, in fact, proposing a global mind-set
>>change.
>
>
> Yes, it can be very hard to get your arms around.
>
>>To paraphrase:
>>
>>Rule 1: "It ain't a requirement until it's testable!"
>>Corollary 1: "Know all the test cases for this requirement
>>before writing the code."
>
>
> The rule is certainly part of TDD. The corollary is softened to
> "Write the code in conjunction with the tests, allowing the tests to
> lead the way."
>
So, in this model, if one of the QOI requirements is
that "this function shall take no more than 10 milliseconds"
then the inability of the initial attemp to take less than
10 milliseconds would be considered a failure at that
point? I like that!
(BTW: That's real in my world. 10 ms. is allocated
for the *slowest* functions.)
Of course, appropriate tests would have to be
devised for this, and that's all well and good.
This, tho, implies that someone has thought about
these QOI (Quality of implentation) requirements,
done the appropiate math, and has bothered to socialize
them with his/her peers. (This applies to both
performance and stability requirements). All too
often these are "assumed" and/or implied and not
properly conveyed to the development team.
(or is this the subject of yet another discussion?)
Nick L.
-- Ñ "It is impossible to make anything foolproof because fools are so ingenious" - A. Bloch
- Next message: Alfredo Novoa: "Re: Relational model versus object model"
- Previous message: Henk Verhoeven: "Re: Qualitative vs. Quantitative Object Context Change & Dialectics"
- Maybe in reply to: lilburne: "Re: TDD: Test-Driven Design or Test-Driven Development?"
- Next in thread: Phlip: "Re: TDD: Test-Driven Design or Test-Driven Development?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|