Monday, June 18, 2012

Code quality Vs productivity

I will not discuss the importance of code quality, we all agree that having code quality is a very important thing in any project. Recently, our manager has decided to take into account KPI's for code quality. Is this a good idea?


Short answer: NO.

If you have done a bit of development in your career, or worked with other developers, you have probably come across the "my code is the coolest" kind of developer. What happens when you have a team of 5 people and all of them are of this kind? What happens if one day you decide to tell them you're going to measure their code quality?

You get what we're getting now: Code quality becomes the primary objective for the team. And do not get me wrong, that would be excellent if we were trying to deliver the nicest code on earth, problem is, we're not. We're trying to deliver as many story points as possible, and guess what, we're delivering very much less than what we could.

Some people has argued in favor of this approach, saying that the time you lose now, will actually give you better productivity later. And yes, it is a valid point, but then again, if focus is on having the nicest code, and not working code (by working I mean, what business requires), what's the point?

You will understand my issue by this example, they had a party to celebrate 17% J-unit code coverage!!
I have never seen them for delivering X story points, or because business accepted all stories in a demo!

Again, it is important to have good metrics, it is important to have code quality, but do not let this become your main objective.




No comments:

Post a Comment