Hacker News new | ask | show | jobs
by emaginniss 1177 days ago
I firmly believe that there will always be a horizon effect whereby there will be a solution that matches all of the tests but fails for the general case. Computers are more likely to find that test-solving solution that doesn't handle the general case because of their iterative nature, whereas humans want to solve the general case first and then add in conditions to handle the unexpected cases.
1 comments

As I understand it, the proponents of TDD would argue that as long as the implementation tends towards laziness (avoiding unnecessary complexity), adding more and more tests to handle additional edge cases should cause the code to converse to solving the general case (and avoid local minima).

I suppose that the crucial piece is the laziness, including refactoring whenever possible, to save time on addressing each subsequent test case.