3 ms·
>Trying to squeeze in the tests into existing system is painful. So better do the tests before it had become a "legacy system to document". This, but also if y
by protonimitate 7y ago
>Trying to squeeze in the tests into existing system is painful. So better do the tests before it had become a "legacy system to document".
This, but also if you code first then write tests you try to write tests based on your interpretation of how the code you already wrote currently works, when its better to write tests to outline and define how the code _should_ work in the future.
>You'll paint yourself into a corner.
I find it is the exact opposite. If you write all your code first, then write tests, you will inevitably find a bug and refactoring working code to fit a test is infinitely harder than adding more tests or replacing irrelevant ones.