To do that, you would need a clear and complete specification
If you feel like writing tests before you start coding, go ahead
If you want to code first, go ahead