This is my first question here, so i'll make it short and to the point.

When Writing unit tests, should you write them before or after you have made the underlying framework for them? This came up in a discussion between my CEO and President, and I wanted your opinion on this.

Personally, I have always wrote the code first, then wrote the unit tests, but what about you?

I would have to say unit tests first then coding. Even with the best will in the world, tight deadlines and other priorities will simply mean they will get pushed back or not done at all. Leaving a bigger headache for those who'll have to maintain the codebase.

Besides writing the unit test should help you formulate what your trying to achive.