Liutauras Vilda wrote:It doesn't. TDD does not promise a guarantee correctness of your solution...but rather forces you to think about the requirements prior jumping on the actual implementation.
Yes, that makes a lot of sense. I guess it goes back to the
"what" I'm always banging on about.
Back in Jurassic times, one of the things we were taught was to spend time on a "mission statement" - ie, a short sentence or paragraph that outlines the
goal of an app, or module or program - which was one of our ways of "keeping your eye on the ball" and avoiding
feature creep.
Unfortunately, it was by no means universal, and the quality of these statements could vary wildly (if there was even one to begin with), so I do like the formality of having to write a suite of tests
before you start coding.
I guess my worry is that the tests could become an end in themselves, and that you write code simply to pass the tests rather than to perform the
function they're meant to model.
Either way, it suggests to me that the tests that Ranajoy (or codebat) supplied are incomplete because they don't fully define the problem, whereas if they'd supplied a
test like mine
with an expected result, there would be no ambiguity.
Which probably makes it a good example of a "bad" test suite.
Interesting stuff.
Winston