Question

Recently, we were asked to find the lines of code in our application by our managers. I have actually been pondering since then; what does this metric signify ?

  1. Is it to measure the average lines of code the developer has written over the time ?

    • IF no re-factoring happens then this can be a possibility.
  2. Does it tell how good is your application ?

  3. Does it help one in marketing the product ?

I don't know how does it help. Can some one please guide me in the right direction or answer what does this metric signify ?

Thanks.

Something I found recently http://folklore.org/StoryView.py?project=Macintosh&story=Negative_2000_Lines_Of_Code.txt&sub=HN0

Était-ce utile?

La solution

The number of lines of code is a popular but a problematic metrics.

Advantages

  1. Number of lines of code shows a moderate (0.4-0.5) correlation with the number of bugs [Rosenberg 1997, Zhang 2009], i.e., larger modules usually have more bugs, and which might be more interesting, more bugs per line [Fenton and Ohlsson 2000, Zhang 2009]. I would like to stress that there are better (but more complex) ways to predict the number of bugs.
  2. Number of lines of code can be used to predict the development effort, i.e., there are effort prediction models (e.g., COCOMO) that take the number of source lines of code as one of the input parameters.
  3. Some of the more complex OO-metrics show strong correlation with class size [El Emam et al. 2001].

Disadvantages

  1. Using lines of code as a productivity measure is extremely problematic since it becomes difficult to compare modules in different languages or written by different developers. Indeed, some languages are more verbose due to, e.g., presence/absence of “built-in” functionality or structural verbosity (e.g., .h in C). Moreover, as already mentioned above, some developers are paid per line of code which necessarily leads to ridiculously complicated code. Finally, code generation should be taken into account.
  2. While "lines of code" is a common metrics, one has to be careful with distinguishing different kinds of "lines of code": with blank lines or without, with comments or without, counting logical statements of physical lines...

Autres conseils

What does number of lines of code tell you about your application?

The number of lines of code will tell you roughly how much disk space you need to store the uncompressed source files. Even this is rough, as each line will have a different number of characters and different encodings could be used (UTF-8 takes twice the disk space of Latin-1).

Is it to measure the average lines of code the developer has written over the time ?

No.

Does it tell how good is your application ?

No.

Does it help one in marketing the product ?

No.

It signifies that your managers are incompetent

If you were being measured by number of lines of code, as a developer what would you do to achieve the target...

Google for this metric, it will tell you it's the dumbest strategy since Adolf decided to win the war in Europe by invading Russia.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top