That supposes to have a clear idea of what youâre going to code. Otherwise, itâs a lot of time wasted to constantly rewrite both the code and tests as you better understand how youâre going to solve the task while trying. I guess it works for very narrowed tasks rather than opened problems.
The only projects Iâve ever found interesting in my career was the stuff where nobody had any idea yet how the problem was going to be handled, and youâre right that starting with tests is not even possible in this scenario (prototyping is whatâs really important). Whenever Iâve written yet another text/email/calling/video Skype clone for yet another cable company, itâs possible to start with tests because you already know everything thatâs going into it.
constantly rewrite both the code and tests as you better understand how youâre going to solve the task while trying
The tests should be decoupled from the âhowâ though. Itâs obviously not possible to completely decouple them, but if youâre âconstantlyâ rewriting, something is going wrong.
Brilliant talk on that topic (with slight audio problems): https://www.youtube.com/watch?v=EZ05e7EMOLM