Edit: It was brought to my attention that the content of this post was potentially offensive, in light of the readership base, I think these comments are fair. As such, I have altered the post, hopefully the sentiment won’t be lost as I think an important point is being made.
We’ve been trying to promote the use of Unit Testing for some time now but have only really seen a limited amount of success in my opinion. There’s a number of reasons for this I think, some is down to the lack of training and support that we provide the developers and some is down to the fact that we’ve never really enforced coding standards (something that we have identified and are now working to resolve.).
Where we have seen success it was either from our stronger developers, or from the contractors that have come in with previous experience in unit testing. Considering the amount of contractors that we have recently recruited and that during the recruitment process we have paid particular attention to ensure that they understand the principles too, I had hoped that reaching a critical amount of people that just did Unit Testing would start to bring the other members of the department along.
It was interesting then to see Ed Gibbs’ post the other day about the difficulties they’re having in promoting the use of TDD. We’re considering changing our approach to unit testing in that we will probably be mandating that no application with at least 75% coverage will be allowed to be released to our environments.
I also came across this post on Doug Seven’s blog which is similarly of interest. I’m actually in the middle of composing the mail that I will send out to both our developers and the Project Office to let them know about our thoughts on both Unit Testing and Continuous Integration.