There has always been a role for spike / throwaway code in my opinion.
However, as Jeff says, whilst I wouldn't typically use tests to drive
the spike I have found test-driven techniques extremely valuable in
certain circumstances. An obvious case jumps to mind: where you need
to get to grips with a new API (especially if that API ships without a
test suite).
Regards,
Alan Dean
On Thu, Oct 9, 2008 at 4:42 PM, Jeff Langr <jeff@...> wrote:
> Olof Bjarnason wrote:
>>
http://www.thekua.com/atwork/2008/02/05/if-you-do-test-driven-development-all-th\
e-time-youre-doing-something-wrong/
>>
>> The writer mentions "mindsets" of developers when coding. Initially he
>> discusses Experimentation mode and Focus mode, and concludes that TDD is
>> best suited for the Focus mode, while Experimentation mode is throw-away
>> code for learning technologies (libraries).
> I know of no one who insists on TDD at every turn. That doesn't mean
> such absolutists don't exist. Such an assumption would be as bad as
> assuming there are people who don't work better during exploratory mode
> using TDD.
>
> As insistent as I am on writing tests first, I foray into non-TDD mode
> at times when learning or exploring.
>
> Yet I've also gotten a lot of bang out of writing tests while I'm
> learning, too. "They spend a long time writing their test only to find
> out the thing they're doing won't work in that way and then sulk over
> the time spent writing the test." Bah. I've cost myself hours because I
> was too lazy to write a test. I've bitched a bit about the effort in
> writing tests, but I've never regretted it.
>
> Sometimes writing tests during experimentation is helpful, sometimes
> it's not. If you followed the advice and didn't try, you'd never find
> out when it was more helpful. Same gripe as my gripe on the
> agile-testing list.
>
> Jeff
> http://langrsoft.com/agileJava
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>