3 ms·
There is a big difference between "true" TDD and simply writing the tests before you write the code. According to the TDD evangelism I've seen, it means (1) wr
by tbrownaw 13y ago
There is a big difference between "true" TDD and simply writing the tests before you write the code.
According to the TDD evangelism I've seen, it means (1) writing tests one at a time, which should fail at the time that they're written; (2) after adding each test, write code that will past that one test while being deliberately ignorant of any requirements that will show up in future tests; (3) refactor, rewrite, etc, as needed as new tests are added.
I suppose this could be meant to mimic how code in long-lived systems evolves as requirements are discovered and changed. Or it could be meant to promote awareness of you-aint-gonna-need it and reduce over-engineering. Either way it also will necessarily cause extreme short-sightedness and err strongly on the side of under-engineering, and in the case of mimicking natural code evolution it would be an example of cargo-cult thinking.