BDD and TDD - What are they for?

additionally tests prove things on a very abstract level. if the
wright brothers had spent a bunch of time with RSpec they would have
theoretically proved their model of a cylinder would have enough

You mean “Unit Tests”, right? The term “tests” encompasses manual
tests, unit tests, functional tests, integration tests, usability

well, i guess you could say looking at things in a browser is part of
“testing” but thats not the point of this discussion?

i came to ruby cos i like to realize ideas quickly.
premature test cases is like premature optimization.
making a change means fixing a bunch of failing tests…
in the first 24 hours of a project, where you know things are likely
to change a lot, then testing + coding is close to 2X the work.

if you’re working on a billing system for a bank,
or a demo for a flying pumpkin that blows up at midnight,
the needs are completely different.

but i think the prevailing opine that tests somehow give you more
freedom is relative to your event horizon.

/dc

On Wednesday 20 August 2008 21:46:25 Phlip wrote:

Right. The bigger the project, the longer it runs, the more you need tests.

Well, more than that, my point was that the longer you wait, the harder
it’s
going to be to write those tests.

Doing tests early on forces you to make things testable. It forces you
to
break your program down into somewhat-isolated units.

I had a graphic example of this – I was downloading an HTML document
from a
site (with Open-URI) and then parsing it (with Hpricot). How do I test
that?
I suppose I could leave it as-is, but then I’m assuming the site in
question
is always up. I’m not testing the site, I’m testing my code.

So the solution was to refactor – split the parsing from the
downloading, and
provide a convenience wrapper that does both.

But you see – refactoring is exactly what testing is supposed to make
easier.
Wait too long, and you have a catch 22 – you have to refactor to test
effectively, but you need tests to refactor effectively. So either way
you
go, you’re going to be somewhat ineffective.

And the longer you wait, the worse it’s going to get.