Thinking about how you will observe whether things are working correctly or not ahead of time can also have a big impact on the quality of the code you write.
YES. This feel similar to the way that TDD can also improve the code that you write, but with a broader/more comprehensive outlook.