Re: Paralyzed by TDD
- From: "Phlip" <phlip_cpp@xxxxxxxxx>
- Date: Tue, 26 Jul 2005 15:14:42 GMT
jasongorman wrote:
> Phlip wrote:
> >Could you pick a simpler learner project, like a recursive descent
parser?
>
> Actually, a directed graph is conceptually fairly simple, and should
> lend itself well to practicing TDD - you don't have to worry too much
> about understanding the problem because you can just open a book on
> discrete maths and there it all is, ready made.
That's the problem. It's not simple enough that you can use TDD to learn
what the algorithm can be.
Implementing an algorithm from a book is harder under TDD than inventing a
simple algorithm from scratch.
> The previous replies make sense. Break the problem down by starting
> with the simplest instance you can think of (an empty digraph, for
> example), and then gradually add scenarios until every property of the
> digraph is accounted for. This is the essence of TDD - start simple and
> build up the design gradually with each new test case.
Right. And the early code should look nothing like the book's version of the
algorithm. Refactors should nudge the code closer.
But: Without that book version, early refactors might lead to a design that
inhibits discovering the final algorithm.
TDD is not a perfect system to discover algorithms.
--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand
.
- References:
- Paralyzed by TDD
- From: kj
- Re: Paralyzed by TDD
- From: Ilja Preuß
- Re: Paralyzed by TDD
- From: Phlip
- Re: Paralyzed by TDD
- From: jasongorman
- Paralyzed by TDD
- Prev by Date: Re: Repositories, package dependencies, and domain-flavoured exceptions
- Next by Date: Re: OOP/OOD Philosophy
- Previous by thread: Re: Paralyzed by TDD
- Next by thread: Re: Paralyzed by TDD
- Index(es):
Relevant Pages
|