Unit tested test for accuracy, if your code isn’t “shaped to drive tests nicely”, it’s bad code.
They enforce requirements. You do start with code, you start with the “shape”, you architect how your application should be developed and you write unit tests for the functions you already know you want but haven’t written the logic to yet, the unit test validates the logic so you don’t spend 2 hours hunting down a missing negative sign.
Except that then you’ll shape your interfaces to drive tests nicely, instead of being, you know, sane and useful (been there, done that).
Unit tested test for accuracy, if your code isn’t “shaped to drive tests nicely”, it’s bad code.
They enforce requirements. You do start with code, you start with the “shape”, you architect how your application should be developed and you write unit tests for the functions you already know you want but haven’t written the logic to yet, the unit test validates the logic so you don’t spend 2 hours hunting down a missing negative sign.
Read my comment again, instead of half way through.