The last best practice we will discuss is this statement: testing is not an overhead or a burden; it is the programmer's guide to success. The only question is when to write the test.
There is a compelling argument that requires writing a test before any line of code is written. If you can do it, that is great. We are not going to try and talk you out of it. But if you do not do it, try to start writing a test after you have written one, or all lines of code, you had been tasked to write.
In practice, many experienced programmers find it helpful to start writing testing code after some of the new functionality is implemented, because that is when the programmer understands better how the new code fits into the existing context. They may even try and hard-code some values to see how well the new code is integrated with the code...