Test-driven development makes you more productive

I think that test-driven development (TDD) makes you productive.

Firstly, you save time by not needing to switch from your code to a terminal or browser to test it.

But, just as importantly, TDD reduces procrastination. It's much clearer to see what the next steps are.

You're either thinking and designing your code when writing a failing test or fixing the test failures in the implementation code to get the test to pass. You can focus on each failure and message separately and get them to pass instead of thinking about the whole feature or the rest of the application.

Once you have a working test, you can focus on refactoring any code or moving on to writing the next assertion or the next test.

I think that achieving small tasks with short feedback loops using test-driven development makes it much easier to remain productive and focussed.