The meaning of code metrics

What assumptions come to your mind when you view this unhip bank account?

account-simple

Based upon the amount of cash found in both the savings and checking accounts, you could probably presume one thing– this person doesn’t have a lot of money. If that were my bank statement around the beginning of the month, I’d find myself in a world of stress worrying about a mortgage, for one thing.

But what if I told you that the account holder is 5 years old? All of a sudden, you may find yourself making different assumptions– perhaps you’re impressed that this 5 year old has both a checking and a savings account!

Clearly, background information on the owner of the account certainly helps put into perspective how one would view the funds available. Similarly, with software metrics, the same lesson holds true– the application being measured needs to be considered in context during analysis . Applications built to run on a wrist watch will most likely yield metrics quite different and even considered harmful if they we obtained from a copacetic web application, for instance.

Take another look at this bank account below.

account-simple

Having read this far, you may be thinking this account may indicate a positive balance if the owner is 5 years old, but probably a negatively focused balance should the owner be an adult with a family to support. Now take a look at the next bank account statement.

account-withcredit

Now, regardless of the bank account owner’s age, this person most likely has some debt challenges. If this person is 5, perhaps you could infer fraud or identity theft. If this person is a father of a few children, could you infer the same things? Perhaps so. Perhaps not.

The point being, of course, is that once another piece of data has been introduced, many assumptions are altered– the same holds true for software metrics. You can view a few of them in context and infer one aspect of quality, perhaps, but once another metric has been introduced, your inference on quality can be totally changed . Just like viewing one’s checking and savings accounts without viewing any debt associated with a credit card yields a partial picture, the same thing holds for metrics– they only give you a partial picture of an application, so to speak.

Take a look at the account below.

account-highcash

What inferences do you draw about this account’s holder? At first look, things seem to be ok (depending on one’s cash requirements), right?

Now take a look at a snap shot of the same account from yesterday.

account-highcash-yesterday

Clearly there has been a rather negative change in the accounts. The change isn’t terribly concerning though– perhaps a mortgage was paid. Now examine a neat-o snap shot of the same account from a week ago.

account-highcash-lastweek

Having examined three snap shots of this account that span roughly a week, what deductions can you draw? Clearly, in the context of time, these snap shots indicate a negative trend, by which various inferences can be made, such as that this person is losing money. But the data has only been viewed over two weeks– what if tomorrow is pay day? How do you think the accounts will look then, man?

Also too, what happens when you add in the other contexts from above, such as the age of the account’s holder and a snap shot of the person’s credit card balance? If you add the credit card balance to this mix of cash, I’m betting your outlook may be less positive, right?

Now examine another three snap shots of an account. Below is today’s balance.

lowcash-today

Next, have a look at last month’s balance. What do you notice?

lowcash-lastweek

Check out the balance below from three months ago. Notice how the balance has demonstrated a clear growth.

lowcash-lastmonth

Both trend images sets show different patterns– one demonstrates a negative trend and the other demonstrates a growth pattern. What’s more, each initial balance may have initially given you a different impression. With code metrics, the same holds true– they should be viewed over time as the trend they may exhibit gives a more realistic view.

With code metrics, keep three things in mind:

  1. They are objective measures of something but they must be applied subjectively.
  2. Metrics should be viewed in concert with other metrics to enable a more precise picture.
  3. These same metrics should be viewed over time to produce a more accurate picture as to how things are progressing or have progressed.

Of course, there is still the question on what the data actually means; however, before you can begin to derive information from numbers, you must understand how to actually view them. Dig it?

10 Responses to “The meaning of code metrics”

  1. on 15 Dec 2006 at 11:42 pm Brian

    WOW is this a lame article. It is like it was written by a 5 year old, for a 5 year old to read.

  2. on 16 Dec 2006 at 3:10 pm Andy

    Thanks for your intelligent analysis, Brian. Based upon your comment, I’d guess you’re 7 or maybe 8 years old? Thanks for reading!

  3. on 18 Dec 2006 at 12:28 pm kocka

    it is a good explaination why people should use tools like qalab, but recently, most projects use simple generated software metrics reports, and sometimes take a look at it until they get bored of it :)

  4. on 25 Dec 2006 at 7:09 pm Tom Copeland

    A good writeup, Andy. You’re right, trends are much more interesting than point-in-time snapshots. Neat stuff!

  5. on 28 Jan 2007 at 2:41 pm Andy

    kocka- yeah, tools that provide trending tend to be quite helpful!

  6. on 06 Apr 2007 at 6:19 pm David Longstreet

    you may want to check out my site www.SoftwareMetrics.Com, there is a free function point training manual available at www.SoftwareMetrics.Com/freemanual.htm, there is a lot of information on software metrics besides just function points.

  7. on 12 Apr 2007 at 1:46 pm Andy

    Thank you, David for the pointer to the manual!

  8. on 26 Jun 2007 at 4:12 pm David Longstreet

    I have posted an article that your readers my find interesting

    Agile Methods and Other Fairy Tales

    http://www.SoftwareMetrics.Com/Agile


  9. […] from refactoring). I’ve also found that, on the whole, metrics are more copasetic when combined with other metrics and trended– for instance, complexity alone is somewhat interesting, but pairing complexity with code […]


  10. […] trends with PMDReports- Trending metrics? Why would anyone want to do that, man? Seriously though, PMDReports looks […]

Trackback this Post | Feed on comments to this Post

Leave a Reply