Slashdot Mirror


The Futility of Developer Productivity Metrics

snydeq writes "Fatal Exception's Neil McAllister discusses why code analysis and similar metrics provide little insight into what really makes an effective software development team, in the wake of a new scorecard system employed at IBM. 'Code metrics are fine if all you care about is raw code production. But what happens to all that code once it's written? Do you just ship it and move on? Hardly — in fact, many developers spend far more of their time maintaining code than adding to it. Do your metrics take into account time spent refactoring or documenting existing code? Is it even possible to devise metrics for these activities?' McAllister writes. 'Are developers who take time to train and mentor other teams about the latest code changes considered less productive than ones who stay heads-down at their desks and never reach out to their peers? How about teams that take time at the beginning of a project to coordinate with other teams for code reuse, versus those who charge ahead blindly? Can any automated tool measure these kinds of best practices?'"

22 of 203 comments (clear)

  1. Refactor... by Tsingi · · Score: 4, Insightful

    Refactor, refactor, refactor

    KISS technology, nothing beats it.

    1. Re:Refactor... by ZeroExistenZ · · Score: 5, Informative

      Application design (have someone think about everything in broad lines, set out a main architecture-model in ADVANCE.)

      Iterative design.

      A good project manager prioritizing and communicating current development shielding programmer from clients (who during the "waiting time", are fantasizing changes).

      In contrast, in debugging and QA, free way between the client and the developer (more efficient and gives more motivation to the dev as to slave for )

      Realistic expectations: don't get your devs running around doing "quick" jobs left and right while they're trying to keep a tight schedule.

      Keep everybody current: short standup meeting in the morning

      Motivate communication; devs tend to get absorbed in their coding-problem (nd prioritize being "productive") but forget to be a team

      The right personality on the right segment of a project: developers have their strengths and their weaknesses.

      ...

      --
      I think we can keep recursing like this until someone returns 1
    2. Re:Refactor... by sg_oneill · · Score: 4, Interesting

      Refactoring and metrics are often rarely agree. I remember one job I came into, I was given this steaming horrible piece of php (ugh) mess to fix up and add a bunch of features for the client. I took one look at it, and said "I need a good two months to fix this code" and demonstrated a series of horrible vunerabilities and fuckups in the code. Realising the vunerabilities (hint, demonstrating security holes in existing code is a REALLY good way to convince management you need to spend some quality time refatoring it) where just plain dangerous, I got given the go ahead.

      A couple of weeks in, the manager called me into the office asking "Shayne, this is very strange. You know we take a metric of how many lines of code per hour are written into account here?". "Yes" I replied, "You also know I think its idiotic". The guy said "Right , well your registering a highly negative score on this. I dont even know if this is working right?".

      The reality was this code was written by someone who really didn't "get" databases. A table would be loaded in, then iiterated over, and each pass would issue new sql calls for data, which would then be loaded in and iiterated again. I'd just delete all of the twenty+ pages of code, write a half-page winner of an SQL query, drop it into a mysql stored procedure, and select from it, then spending half a page formatting it and displaying it. It was robust, safe, and fast as hell. I went through the whole code like this turning hundreds of pages of code into tens of pages, all neatly commented, scrubbed of nasties, isolating out the design from the logic, putting models into model classes, views into templates and controllers to glue it all together.

      And the end result was every day the code would lose twenty-thirty pages of code and develop 2 or 3 pages of terse, clean, maintainable code.

      And as an end result, my metrics where fucked. I tried to argue that they needed to look at more sane metrics, like what was coming out of the CI software, and if they wanted to be really clever, things like complexity metrics and the like.

      Ultimately however ,they still wanted the "codes of line per day" metrics because as non technical people it made them feel like they understood what was going on, but ultimately they didn't. My suggestion to them however was "When developing fresh new code, that number should increase, when refactoring code, it should decrease. But only if the coder knows what he's frigging doing."

      --
      Excuse the Unicode crap in my posts. That's an apostrophe, and slashdot is busted.
  2. Writing for reuse is lacking use case by rednip · · Score: 4, Interesting

    If you don't have a use case for reuse, you shouldn't try to code for it. To many 'interfaces' are single use, see 'servlet' vs. 'http servlet'.

    --
    The force that blew the Big Bang continues to accelerate.
  3. It's tricky by LunaticTippy · · Score: 5, Insightful

    Whatever you measure will be gamed. Measure bugs fixed, and you will find people wasting time listing each tiny variation of a bug. Measure lines of code, you will get spaghetti code.

    It almost seems better to measure a bunch of things and use a secret formula to determine productivity.

    --
    Man, you really need that seminar!
    1. Re:It's tricky by abroadwin · · Score: 5, Insightful

      Or you could just communicate with your developers, be aware of the work they're doing and judge their performance based on their effective productivity from your perspective. I've heard this called "management" before, but I know that word has been twisted to mean something more sinister as of late.

    2. Re:It's tricky by ackthpt · · Score: 5, Insightful

      Whatever you measure will be gamed. Measure bugs fixed, and you will find people wasting time listing each tiny variation of a bug. Measure lines of code, you will get spaghetti code.

      It almost seems better to measure a bunch of things and use a secret formula to determine productivity.

      In my book there are only three ways to measure code:

      • For speed
      • For size
      • For readability

      Emphasis on any one and the others suffer. They're goal should be on bug-free code which meets a spec. Writing code is like practicing medicine, every patient is different and has its own demands.

      --

      A feeling of having made the same mistake before: Deja Foobar
    3. Re:It's tricky by icebraining · · Score: 5, Insightful

      So, you want to reward Wally? He probably doesn't introduce much bugs...

    4. Re:It's tricky by Curunir_wolf · · Score: 4, Insightful

      Or you could just communicate with your developers, be aware of the work they're doing and judge their performance based on their effective productivity from your perspective. I've heard this called "management" before, but I know that word has been twisted to mean something more sinister as of late.

      That won't work, because we laid off all the middle managers years ago. Developers are all exactly the same - we just need to know which ones to slot into the critical path.

      --
      "Somebody has to do something. It's just incredibly pathetic it has to be us."
      --- Jerry Garcia
    5. Re:It's tricky by nine-times · · Score: 5, Insightful

      Yeah, I've come to realize that nobody understands what a manager is supposed to do anymore. Most people's concept is that managers exist to play the part of the PHB, but they don't do anything useful.

      More and more, I think no one even understands the value of having a knowledgeable person make difficult decisions based on well thought-out judgments. People want procedures that they can just give to anyone and assume that the outcome will be the same, and then they want metrics that they can use to measure the outcome without knowing anything about the situation.

      The proper role of a manager-- aside from particular responsibilities he/she might have on top of this-- is to understand the people working for him and understand his unit's role in the greater context of the company, and then to eliminate obstacles that prevent the people working for him from performing their roles. This might mean protecting the people that work for you from upper management, it might mean recognizing and rewarding good performance, or it might mean all sorts of other things. But to do it right, it takes a lot of work and it takes good judgment.

    6. Re:It's tricky by marcosdumay · · Score: 4, Insightful

      Yes, they are objective and quantitative. Managers love that, because being objective excuses them from forming the kind of bias people used to call "leadership", and being quantitative they fit into nice formulas where they can convey no information at all to higher managers that are too insecure to ask what it means.

      Just don't expect those quantitative and objective metrics to be correlated with the overall profit of your business.

  4. Problem by bigsexyjoe · · Score: 5, Insightful

    A lot of problems rating developer productivity. First, if a system is that good, then managers won't be able to game it to play favorites. Second, writing code for future use is always harder than writing code specific to the problem. Third, almost any metric is going to penalize a simpler solution. (Keep in mind that once you see a simple solution it seems obvious and everyone thinks they'd think of it. Fourth, evaluating developers well would require making the best coders managers, and that rarely happens for several reasons.

  5. Pfft by Allicorn · · Score: 5, Insightful

    Can any automated tool measure these kinds of best practices?

    No. The - for the sake of politeness, let's call them "people" - who invested time and effort into devising these schemes have actually built a complete chain of negative productivity by doing so. Remarkable.

    --
    OMG!!! Ponies!!!
  6. Measure the objective not the code by Crashmarik · · Score: 4, Insightful

    Personally I am always happy with the guy who can get things done with one line of code instead of a hundred, but what I really care about is that objective is met and we don't have a host of bugs that require 10 times the cost of the development just to maintain. Its not hard stuff but it does require common sense and a hard nosed attitude both of which can be scarce commodities these days.

    1. Re:Measure the objective not the code by MadKeithV · · Score: 5, Insightful

      Personally I am always happy with the guy who can get things done with one line of code instead of a hundred, but what I really care about is that objective is met and we don't have a host of bugs that require 10 times the cost of the development just to maintain. Its not hard stuff but it does require common sense and a hard nosed attitude both of which can be scarce commodities these days.

      I am also REALLY happy to have "that guy" that has absolutely shit productivity, but somehow manages to pick up on every time a "solution" is proposed by the rest of the team to a problem that doesn't exist or doesn't matter, and stops THEM from being really efficient at doing the wrong thing.
      I'm also really happy to have "that girl" that doesn't seem to really be doing anything, but take her out of the team and everyone else starts floundering because she's actually constantly helping them be a lot more productive.
      "Meeting the objective" is actually potentially just as bad as any other metric, because it depends on how you define the objective, and meeting it. What the customer asked? What the customer wanted? Or what the customer actually needed?

  7. We need metric metrics by naroom · · Score: 5, Funny

    metrics provide little insight

    If only we had some kind of.... metric metric.

  8. lazy management by J-1000 · · Score: 5, Insightful

    This all comes down to lazy, gutless management. Why take the time to get to know Dave and monitor the quality of Dave's work when we can just look at a spreadsheet at the end of the month? Managers prefer to tinker with automatic analysis software rather than manage.

    Which is more fun, getting a better handle on what Dave is doing, or researching fancy new software tools that might get you all sorts of praise from metric-craving executives?

    Dave's job, which was once about creating a quality product, now shifts to merely satisfying the metrics.

  9. Repeatability by 3count · · Score: 4, Insightful

    Metrics are valuable if you do the same thing repeatedly. If you build a new building that is like the previous one, you can collect metrics and compare your performance against history. If you write the same search algorithm again and again, you can collect metrics and compare to see how your performance changes over time. Of course, with software, you never repeat. Somewhere around the third time, you move it into some form of library, reuse it, and start on a fresh problem. Perhaps metrics are helpful in some situations, such if your team keeps repeating the same mistakes, you might find similarity in those mistakes (code smells.) There are plenty of people working on these problems and tools. But, from a management point of view, if you keep doing the same thing, you are doing it wrong, and code metrics are not going to help much.

  10. Why are metrics so damn important by Riceballsan · · Score: 4, Insightful

    I don't get the concept of everything needing to be quantified. Does the team accomplish what the goals of having the team are? Does it get developed in a fair timeframe? Is everyone on the team pulling their own weight, or are there complaints of someone slacking off? In the end if the product works then the team is doing well, if the product isn't there should be at least one hybrid manager/coder that actually works with the team members sees who is committing what and can tell off the bat if there is or isn't a weak link dragging the rest down. Actually putting a pen and paper number on a complex project is silly. Do authors get judged by the number of pages they write in a day, no they get paid by the success or failure of the book. You can't judge by the number of lines of code, bugs per line ratio or anything like that, because it is all subjective and has little to no bearing on the end product.

  11. more reasons than just reuse. by RingDev · · Score: 5, Interesting

    Writing for reuse can be excessive, but there are a number of reasons to move in that direction even if you don't intend to reuse that specific code block:

    1) Unit Tests. If you abstract your functionality in a way that allows reuse, it also abstracts in for extremely easy unit testing. And unit testing will save you an incredible amount of effort in code maintenance.

    2) Consistency. If you follow the same design pattern for all of your abstractions, all of your developers should be familiar with it. This makes it significantly easier for different developers to step into projects as the hopefully don't have to learn another person's style for abstraction.

    3) Replacement and isolation. Need to implement a functional change? If your code is abstracted, like it would be for reuse, the functional change is limited to a single block, which is easily identifiable and if you're doing it right, unit-testable.

    4) Just in case. Most of the time abstracted code doesn't get reused, and event when it does get reused it's usually a copy and paste job instead of a reference. Even so, if anyone ever does need the same functionality, it allows them to quickly rip off the exact piece they are looking for as opposed to trying to strip out your programs logic to get the tiny bit they want.

    -Rick

    --
    "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    1. Re:more reasons than just reuse. by c++0xFF · · Score: 4, Insightful

      And the "reusable" version very often isn't reusable at all, since the original coder didn't properly envision what other use cases would look like.

  12. Re:Coding is an art by stanlyb · · Score: 4, Insightful

    And every developer starts as an engineer, and ends as an artist. As simple as that. The engineer can do anything, but have not done it yet. The artist knows what to NOT DO, because he has already done it, and does not wanna to repeat all the teenage mistakes again. The artist just gives you the solution. End of story.