News for hackers. Stuff that matters.
Re:Ask HN: How to plan a minimal restructuring to enable TDD by muzani on Friday March 26, 2021 @03:12AM (#26589543)
Have you read the original TDD book by Kent Beck? There's a lot of tips inside. Part of it is starting with what's easy but not obvious. Like a 1+1 might be too obvious, but testing addition and deletion from a list might not be. You don't need a detailed plan. It might also help to just build tests moving forward rather than changing the structure.

The book handholds you through getting stuck on things so I highly recommend it. Tips include: If you know what to type, then type the Obvious Implementation. If not, fake it. If it's still not clear, write more tests and triangulate.

Also remember that refactoring without tests is not really refactoring. So ironically writing the tests first will help a lot.

There are no comments on this comment yet.