TDD is BS?
Szymon Gatner
noemail at gmail.com
Wed Jun 19 15:15:50 PDT 2013
On Wednesday, 19 June 2013 at 21:59:21 UTC, Jonathan M Davis
wrote:
>
> I _do_ agree with writing the tests fora function as soon as
> the function is
> done, in which case, you're likely going to have to do more
> work on the
> function, since it'll probably fail the test, and you'll
> probably improve the
> tests some more at that point as well. But I completely
> disagree with writing
> the test before the code, which is one of the key features of
> TDD as its
> always been explained to me.
Writing the test before writing the function is exactly the point
of TDD. It forces you to think about parameters it should take
and value(s) it should return first. You first write the code
that uses that function and only when client code looks ok and
and all requirements are understood, only then you implement the
feature.
API change cost is way higher than fixing a bug inside a function
or a class, also you will often realize that what you initially
though was necessary turns out not to be after all.
More information about the Digitalmars-d
mailing list