Lately, I have been working on a several systems to enhance the continuous integration process for builds.  One of the big areas for improvement was around the centralization of code analysis.  If done right, it is a painless process, done wrong and everyone is upset.

I will explore how to implement code analysis in several painless steps as a blueprint to get code analysis off the ground effectively.  I will start here with a summary of the posts that I will create for this topic.

Summary 1 – Management Said So

Your boss just finished reading a great series of posts on Code Analysis.  You have been asked to go implement it in your code base.  Do I need to go on here?  Well maybe just a little bit.

You might as well get code analysis into your development process up front.  Even in legacy projects.  Do you have one of those teams that only runs code analysis at the end of a development cycle to satisfy the letter of the law instead of the spirit of code analysis.  When you get those 1000+ warnings, do you start suppressing like crazy, stating that it is an invalid rule?  What is the worst that can happen if your team implements code analysis now instead of towards the end?

Summary 2 – The Other Developers Will Despise You

The build just broke because of the stupid code analysis junk that is being forced upon us.  Who thought that those rules even made sense to begin with.  What is wrong with a 500 line method? I have been coding them for years?  I bet some PM made up these rules.  We never need code analysis before.

These are just a few of the tamer comments you may get from the team.  How you implement Code Analysis will be critical to your relationship with teammates.

Summary 3 – Implement But Don’t Obstruct

To implement code analysis without impacting the team’s performance is paramount.  You must prove that it has extra benefits for people other than developers.  Implementation starts at the policy level and moves quickly into standard development and coding practices.  Learn how to start doing code analysis with little or no impact to the development.

Summary 4 – Preach What You Practice

Ready, Set, Turn on Code Analysis.  Have your reporting and measurement strategy in place.  Justify the value, both tangible and intangible.  Understand where the hidden benefits are and how you can use them to your advantage.  Evangelize the good.

Conclusion

Code Analysis implementations in .Net are more political than practice.  As I write this series of posts I will help provide solutions to some of these political landmines. Do you have a successful Code Analysis story to share?  How about a failed implementation?

Advertisements