When I am writing test first, it isn't much a matter of verifying correct functioning of my code, not really a matter of black box or white box or whatever related to quality assurance, and here is why...
Over the years I practiced and polished a skill to convince management that I need good testers 1, 2, 3 and this suffices to ensure that my code will work as intended without me having to think much about it.
Main reason why I prefer test first is it helps me understand how to design my code so that it's convenient to use. I am not good at imagining in my head how my module will be used by other modules so I can do it overly complicated and that will bite me later and possibly even require redesign.
This is a problem no matter whether I am coding a module for myself or for someone else, it is equally painful using inconvenient interface myself as well as having to explain its usage to other programmers.
"Test-first" approach saves me from that pain; it doesn't require imagination to immediately see how my module will be used if designed this or that way and makes it easy to choose the more convenient one.
When coding module for someone else, it also saves me from the need to painfully explain how to use it.
Look, code in
this test shows how you should use that module and if you run it, you'll also see what results you should expect. Using any other way than shown in
this test would be a mistake. Now go away and let me do something interesting.