3 ms·
> - You write one test. > - Write JUST enough code to make it pass. Those two steps aren't really trivial. Even just writing the single test might require mak
by gjulianm 4y ago
> - You write one test.
> - Write JUST enough code to make it pass.
Those two steps aren't really trivial. Even just writing the single test might require making a lot of design decisions that you can't really make up-front without the code.
- User23 4y agoThis acts as a forcing function for the software design. That TDD requires you to think about properly separating concerns via decomposition is a feature, not a bug. In my experience the architectural consequences are of greater value than the test coverage. Sadly TDD is right up there with REST in being almost universally misunderstood.
- bluefirebrand 4y ago> Sadly TDD is right up there with REST in being almost universally misunderstood. That's a flaw in TDD and REST, not in the universe.
- 0x457 4y agoThe first test could be as simple as method signature check. Yes, you still have to make a design decision here, but you have to make it either way.
- giantrobot 4y agoThen you need to keep the test and signature in lock step. Your method signature is likely to change as the code evolves. I'm not arguing against tests but requiring them too early generates a lot of extra work.
- lucumo 4y agoInteresting. The method signature is usually the last thing I create.