You have it backwards.
The reason you spend so much time writing tests is because your code is lousy.
The reason your code is lousy is because you are constantly interrupted and can never concentrate.
The reason you are constantly interrupted is because you are adulterating your work with fashionable methodologies that actually hinder you with extra layers of process, far exceeding any benefit they may bring.
I started working as a developer in 1988, Back then companies understood keenly that letting us work uninterrupted was the best thing they could do to get good work out of us, and lots of it too.
Somewhere along the way we forgot about that.
Allow me to remind you