I made that observation, while doing PHP TDD-style,
in my previous post. In this
interview with Dave Astels and Steven Baker, they also note that TDD is a necessity in dynamic languages such as Ruby. Let me quote:
It (the compiler, in statically-typed languages) is, it's testing that you are passing the right types around, and
then things are hanging together that way, you're passing the right
number arguments you have the method spelled properly, it's doing all
those checks. Something that Ruby is dynamically typed you don't have
those checks ahead of time. That happens at runtime, you call a method
and if you misspell a method name you get a "no method defined". And
that's where your tests come in; they nail down all that behavior.
It's a cool interview; those bandwidth-starved among us who don't like to watch geeks speaking can just read the text transcript. They also discuss Behavior-Driven Development or BDD. In my opinion, BDD is just TDD with a different orientation. They just call it "specifications" instead of "tests." In a way, I agree with them that too much focus on "testing" with TDD can be unhealthy because TDD is a design approach and is not a full-blown testing methodology. Nowadays when I write code I think of my test code as specifications or behavior that my actual code must fulfill.
Posted
04-10-2007 10:39 AM
by
cruizer