I have often asked, and have been asked; why should we write unit tests before writing the code? Would it not be good enough if we wrote the tests after the code?
Here is what SDMag (Software Developement Magazine) has to say.
When you write tests last, the tests are bigger because they take poor
design issues into account. When you write them first, you typically
end up with well-designed, loosely coupled code.
Agree...? Disagree...? Let me know.