Hacker News new | ask | show | jobs
by heretoo 1222 days ago
> It sounds like you're making the mistake of thinking that TDD means writing the tests first.

Actually, Kent Beck, who coined the term TDD, has the following to say in his book "Test Driven Development":

"In Test-Driven Development, we Write new code only if an automated test has failed"

This implies that in TDD the test is written first.

Regardless of any definition, test-first and test-last are just two ends of a scale we can use.

2 comments

He’s saying to write a test before its code, but don’t write all the tests before any code.
He's also saying "I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence..." https://stackoverflow.com/questions/153234/how-deep-are-your...