Hacker News new | ask | show | jobs
by michaelmcmillan 4229 days ago
Actually, that's not how tests work. Writing a test after the code has been produced should not be considered a real test. Let me quote Robert C. Martin on this.

    If we lose the production code, we end up with a better designed system that stays clean because it has tests. If we lose the tests, then the production code rots and the team slows down in a never ending spiral of lost productivity.

    So we can conclude that if it became a choice between the tests or the production code, we'd rather preserve the tests. And this means that the tests are a more important component of the system than the production code is. Because the tests are the specs.
http://blog.8thlight.com/uncle-bob/2013/09/23/Test-first.htm...
2 comments

Tests written after are still tests. It may not be 'test driven development', but they are still tests, and TDD is not the final answer IMHO.
nonsense!

these are still tests just as much as if they'd been written first, it's just a different methodology.