Home > technical > Metrics Dilemma

Metrics Dilemma

“Not everything that counts can be counted. Not everything that can be counted counts.” – Albert Einstein.

When I started my current programming project, I decided to track and publicly record (via the internal company Wiki) the program’s source code growth. The list below shows the historical rise in SLOC (Source Lines Of Code) up until 10/08/09.

10/08/09: Files= 33, Classes=12, funcs=96, Lines Code=1890
10/07/09: Files= 31, Classes=12, funcs=89, Lines Code=1774
10/06/09: Files= 33, Classes=14, funcs=86, Lines Code=1683
10/01/09: Files= 33, Classes=14, funcs=83, Lines Code=1627
09/30/09: Files= 31, Classes=14, funcs=74, Lines Code=1240
09/29/09: Files= 28, Classes=13, funcs=67, Lines Code=1112
09/28/09: Files= 28, Classes=13, funcs=66, Lines Code=1004
09/25/09: Files= 28, Classes=14, funcs=57, Lines Code=847
09/24/09: Files= 28, Classes=14, funcs=53, Lines Code=780
09/23/09: Files= 28, Classes=14, funcs=50, Lines Code=728
09/22/09: Files= 28, Classes=14, funcs=48, Lines Code=652
09/21/09: Files= 26, Classes=10, funcs=35, Lines Code=536
09/15/09: Files= 26, Classes=10, funcs=29, Lines Code=398

The fact that I know that I’m tracking and publicizing  SLOC growth is having a strange and negative effect on the way that I’m writing the code. As I iteratively add code, test it, and reflect on its low level physical design, I’m finding that I’m resisting the desire to remove code that I discover (after-the-fact) is not needed. I’m also tending to suppress the desire to replace unnecessarily bloated code blocks with more efficient segments comprised of fewer lines of code.

Hmm, so what’s happening here? I think that my subconscious mind is telling me two things:

  1. A drop in SLOC size from one day to the next is a bad thing – it could be perceived by corpo STSJs (Status Takers and Schedule Jockeys) as negative progress.
  2. If I spend time refactoring the existing code to enhance future maintainability and reduce size, it’ll put me behind schedule because that time could be better spent adding new code.

The moral of this story is  that the “best practice” of tracking metrics, like everything in life, has two sides.

  1. Ray's avatar
    Ray
    October 16, 2009 at 8:16 am

    This has been part of software development forever. the perception of progress is based on the number of lines of code, size of the design document, size of the design artifacts…

    If you sitting typing away you are making progress. Sitting and thinking and designing does not look like progress to the management. That is because many managers are of the assembly line mentality (last century). If it is not moving forward (or perceived to be) then there is something wrong. This works it way down into the way we think. Hence your reluctance to refactor.

    Refactoring sometimes can only be done by the next person if they are given permission and politely trash the previous software person.

    • October 17, 2009 at 3:13 am

      “the perception of progress is based on the number of lines of code, size of the design document, size of the design artifacts… “

      Hmmm. My experience has been that progress has been measured by “periodic polling” of the useless, obsolete, but still used, “percent done” metric. Periodic status reports of artifact sizes have never been asked for. I have also never seen those metrics utilized for future estimates of work effort. Have you? If so, was it an improvement over the situations where those metrics weren’t collected? Were the metrics reused in the future?

  1. No trackbacks yet.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.