I've written software test first, and I've written it cowboy. Writing the tests first leaves me with better architecture and fewer defects.
Maybe you do better with the cowboy hat on, I don't.
Maybe you do better with the cowboy hat on, I don't.
On the other hand, if your task is relatively straightforward, you can anticipate the required API and start with tests first.