Hacker News new | past | comments | ask | show | jobs | submit login

Bob Martin famously tried to write a Sudoku solver using TDD, he gave up after a few blog posts...



Do you have a link to that? This is too funny to pass up.


Just to clarify, it was Ron Jeffries who tried the TDD Sudoku solver, not Bob Martin.

You can find links to all the the blog posts, plus some commentary here:

http://ravimohan.blogspot.ca/2007/04/learning-from-sudoku-so...

I try not to be too hard on Jeffries in this case. Although he failed to write a Sudoku solver, expressing the requirements in the form of tests can be a decent way to start in cases where you know some valid outputs for a series of given inputs.

I tend to solve Leetcode/Hacker Rank problems this way, and it works pretty well. The catch is that the tests won't tell you what algorithm will best solve the problem. And there's of course no guarantee the tests you've thought up will cover all edge cases.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: