There’s Only One Valid Metric For Developer Productivity And Quality

17 commentsWritten on February 19th, 2011 by
Categories: Code Quality, Opinions, Software Development

Depending on who you ask, software developers have been programming for over 40 to 50 years. And we still have no truly objective way to measure a developer's productivity and quality level. People can think or say that a developer is fast or productive, but they can't truly quantify it. People can think or say that a developer is great, good or bad, but again, they can't truly quantify it with numbers. We often look at other metrics to give us an idea on quality or productivity such as code metrics, or velocity but those numbers often reflect the efforts of a group of people. After all, a codebase is more often the result of the efforts of more than one person, and a team's velocity is typically the result of the productivity of, well, a group of people. Those numbers can't really be used to gain insight to the quality or productivity of a specific developer.

Not only is the current way of trying to determine the productivity or quality of a developer rather subjective, it's quite often based on things that are only one part of the equation: what they did, and the time in which they did it. I've always felt that that only really tells you half the story. I don't hold much value on knowing how long a developer took to write a certain piece of code or to complete a specific feature. I also don't really care a lot about the code metrics for that piece of code or that specific feature. All i know is that it took some effort. The quality or productivity of that effort can't truly be measured without knowing how much extra effort will be introduced later on because of that effort.

Suppose you have 2 developers, John and Sally. You give them both the same task and you tell them that the estimated workload for that task is 12 hours. John completes the task in 10 hours, and Sally needs 14 hours to complete it. It would be easy to think that John is more productive than Sally based on this. Especially if results like those were to repeat quite often. But what if John's solution requires an extra 6 hours of effort down the line to fix some bugs, or because his code was such a mess to follow that it slowed down future tasks which required another developer to comprehend the code of John's task? That would put John's eventual total to 16 hours of effort, instead of the originally reported 10 hours. And what if Sally's solution didn't introduce any future effort whatsoever down the line? Hell, maybe Sally's solution saved someone else an hour here or there because her solution was so easy to comprehend or perhaps even to reuse. Her total for that task remains at 14 while at the same time maybe even reducing future numbers. In this scenario, Sally is clearly a more productive and better programmer than John though we wouldn't know about it if we'd based ourselves on the initial numbers.

Consider another scenario though. John again spends 10 hours on the same task, and Sally again spends 14 hours. John kept it as simple and as straightforward as he could. Hell, he actually took a shortcut or two to finish faster. Sally is an outspoken member of the Software Craftsmanship movement and stays up to date with all of the latest and greatest patterns and approaches that are making their rounds on the internet. Sally spent a little bit of extra effort to make sure the code is as great as it possibly can be. It's incredibly readable and uses a great new pattern that all the cool kids on the internet rave about. The code metrics clearly show that Sally's solution is of a much higher quality. Unfortunately, it turns out that the other team members are having trouble understanding that code and they often lose time trying to figure it out whenever they need to do something which involves that part of the codebase. While Sally may claim that she took more time because she did it 'better', the extra effort wasn't worth it because no matter how well her intentions with that code, it ended up costing other people time. And what if John's shortcuts didn't introduce any future effort?

There are countless variations on this scenario which makes it virtually impossible to come up with a way to measure productivity or quality based on hours spent or code metrics. The only way to objectively measure this is to define a new metric which holds into account the extra effort that will be introduced later on. I'd call this metric Eventual Efficiency. Quality or productivity by themselves don't really mean anything if one influences the other negatively. Efficiency however can be seen as a combination of the two. Did you write truly fantastic code which ended up not mattering at all? Not efficient. Did you write mediocre code that got the job done and didn't (or hardly) introduced future effort? Sounds pretty efficient to me. Did you write great code that reduced future effort? Very efficient! Did you write bad code quickly that ended up introducing a lot of effort? Not efficient at all.

Unfortunately, we'll probably never get to the point where we can actually measure the Eventual Efficiency of developers. Until we do, it's worth keeping in mind that whatever numbers we might be looking at don't really mean anything without the link to the related future effort.

  • Mark

    The main issue for me is that the people in a position to reflect on these choices usually aren’t the problem. If you consciously decide how far to take a bit of code, whether to test it to the nines, do no testing or to hack it in (mentally counting up the debt costs down the line), thinking of the maintenance costs of using new cool pattern x and so on, then I would say, “great; I bet you’re a diligent developer and a credit to your team”. If you get it wrong, it will inform future decisions. No big deal.

    The disconnect in teams is that most of the cowboys I’ve had the misfortune to work with in the past evidently didn’t have these thoughts; they made no conscious decisions to tailor their code to the problem. They just (as we say here), “fucked it in” and to hell with the consequences. This angers me; it says of the offender, “my time is more precious than everyone else’s time combined”.

    Still worse is that these people are often looked upon as talented, impressive developers because they can shovel shit the fastest. There’s a time and place for shovelling shit, but it shouldn’t be the standard option. It’s a double blow because they invariably shovel shit from their pit right into the conscientious developer’s face leaving them to clean up the mess as well as complete their own duties. Management usually have no idea about why this is bad and focus on the progress made.

    I remember trying in vain to explain to a producer why development teams can’t just go hell for leather while attempting to maintain continuous deployment and that being ‘agile’ is more than going to a scrum once a day. It’s a tough job to explain…

  • http://twitter.com/fquednau Frank L. Quednau

    Great code is great because it is understandable and communicates its intent. Additionally, if a codebase is looking good on a software metric side, chances are considerably higher that future effort is reduced. Coupling has direct influence on maintainability as much as large methods, cyclomatic complexity, ladida. What I’m saying is, as much as I agree with you, I hope you don’t just throw out the few metrics we do have.

    Efficiency is usually a measure of real work over ideal work. I am wondering whether we can establish the notion of ideal work, considering that you take into account the usability of some programmed artefact versus unknown usage scenarios in the future. In the light of not knowing what comes around the next bend in the pipeline of your product, I think having people writing clean code while maintaining a steady flow of adding value is the best thing we can get for now.

  • Pingback: Tweets that mention There’s Only One Valid Metric For Developer Productivity And Quality -- Topsy.com

  • http://timvw.myopenid.com/ timvw

    Our eventual efficiency depends on the skillsets of the people working with our code at a later point in time.
    Lowest common denominator does not seem a good strategy for writing code.

  • Guest

    can you add tl;dr version?

    • http://davybrion.com Davy Brion

      nope, if you can’t stay focused for 2 minutes, it wouldn’t matter anyway

  • http://twitter.com/robbowley Rob Bowley

    Hurrah, another tedious misrepresentation of Software Craftsmanship. Otherwise a good article

  • Pingback: The Morning Brew - Chris Alcock » The Morning Brew #798

  • Mikkel Toudal Kristiansen

    I agree with the points of this blog entry, but I would like to offer an additional conclusion:

    Being productive and produce high quality software is just one part of being a great developer. Being a team player, sharing your knowledge, listening to your team mates, requesting and appreciating contructive code reviews and generally being a likable person is just as important as being able to write high quality code in a short time.

    Therefore, since we will never really be able to measure the Eventual Efficiency of a developer objectively, the next best thing might be to listen to the developer’s team mates. If they think the developer is a great developer, then it is probably true. If they don’t, that is probably true as well. :-)

    Just my humble opinion …

    • http://davybrion.com Davy Brion

      Fully agreed

      It’s too bad that a large part of this industry seems to have an obsession with numbers/metrics
      Talking with and listening to developers often tells you all you need to know to learn about the good and the bad about a lot of the stuff that is related to the project and its developers. But that takes time, which i suppose is the reason why it happens so rarely ;)

      • Mikkel Toudal Kristiansen

        I think the reason is more political than that. Managers might be reluctant to base their own evaluation of a developer upon the opinions of other developers, because that might be considered “hear-say”, or the other developers might be biased against or towards a certain developer …

        • http://davybrion.com Davy Brion

          Could be, but then i can’t help but wonder: do they really ‘get’ it? Let me put it this way: do development shops that routinely put out quality material worry a lot about the politics and the numbers? My gut feeling says ‘no’.

  • Pingback: links for 2011-02-25 « pabloidz

  • http://www.semanticarchitecture.net Patrick Kalkman

    Thank you for sharing this good article. I also see that developer productivity is mostly measured in hours needed to perform the task. While other things such as code quality or Eventual efficiency as you call it are never taking into account.

  • Pingback: There’s Only One Valid Metric For Developer Productivity And Quality « Hornet Dear Bernard

  • MikeBrunner

    There’s actually software tools called Timesheet Verification software (like ProjectCodeMeter for example) that can measure developer productivity based on the complexity of their source code. It works quite well from my experience.

  • http://www.facebook.com/soundar.moorthy Soundar Moorthy

    One of the problems i had seen is the people who actually evluate the efficiency are either not a member of the problem space or not at all a technical person. :)