Use of LOC to determine project size
Asked Answered
S

4

5

How many lines of code (LOC) does it take to be considered a large project? How about for just one person writing it?

I know this metric is questionable, but there is a significant difference, for a single developer, between 1k and 10k LOC. I typically use space for readability, especially for SQL statements, and I try to reduce the amount of LOC for maintenance purpose to follow as many best practice as i can.

For example, I created a unified diff of the code I modified today, and it was over 1k LOC (including comments and blank lines). Is "modified LOC" a better metric? I have ~2k LOC, so it's surprising I modified 1k. I guess rewriting counts as both a deletion and addition which doubles the stats.

Simultaneous answered 3/6, 2009 at 8:8 Comment(4)
Note that LOC refers to lines of code - blank lines, inserted for readability, and comment lines are ignored for the purposes of this metric.Expansile
LOC really isn't a metric fit for determining when a project is 'large'. I would parhaps look at number of modules, their complexety and the interdependencies between them as being a better metric, but I don't think there's one fixed answer to as to when a project is large. Are you trying to solve a specific problem, or is this more of a general question?Anteater
@Banang: A general feel at what people consider to be large.Sleekit
Make this a community wiki, as there is no one "right" answer.Overestimate
S
3

A slightly less useless metric - time of compilation.
If your project takes more than... say, 30 minutes to compile, it's large :)

Squawk answered 3/6, 2009 at 8:15 Comment(1)
In C++ 30 minutes compile time point to a much smaller project then let's say in Delphi.Indelicate
P
3

Using Steve Yegge as the benchmark at the upper range of the scale, let's say that 500k lines of code is (over?) the maximum a single developer can maintain.

More seriously though; I think once you hit 100k LOC you are probably going to want to start looking for re-factorings before extensions to the code.

Note however that one way around this limit is obviously to compartmentalise the code more. If the sum-total of all code consists of two or three large libraries and an application, then combined this may well be more than you could maintain as a single code-base, but as long as each library is nicely self-contained you aren't going to exceed the capacity to understand each part of the solution.

Paramorphism answered 3/6, 2009 at 8:16 Comment(0)
I
2

Maybe another measurement for this would be the COCOMO measure - even though it is probably as useless as LOC.

A single developer could only do organic projects - "small" teams with "good" experience working with "less than rigid" requirements.

In this case, efford applied in man months are calculated as

2.4 * (kLOC)^1.05

This said, 1kLOC would need 2.52 man month. You can use several factors to refine that, based on product, hardware, personel, and project attributes.

But all we have done now is projected LOC to a time measurement. Here you again have to decide whether a 2-month or 20-month project is considered large.

But as you said, LOC probably is not the right measure to use. Keywords: software metrics, function points, evidence based scheduling, the planing game.

Indelicate answered 3/6, 2009 at 8:28 Comment(2)
kLOC is per 1000 LOC ? i had 1k written in a day then cleaned up and debugged in another 2 days with more additions to bring it up to 1kLOC. This formula seems faulty. My current project is 4kLOC (after cleanup). A specific 500LOC took me 2 weeks to learn and write with tons of gotchas (i hated that one...) so i am unsure how that formula should apply. Does it only apply to lines you have no previous experience with?Sleekit
It applies to the development of new projects, but includes all phases of a project. It has been established in 2000, so maybe some productivity has been gained. COCOMO has been calculated through post mortem analysis of many projects. It only applies to teams, not single developers. Good developers are up to 10 times faster than bad ones, so your experience may not apply. One might also take into consideration the definition of LOC: nothing generated, handwritten just statement lines. And of course it depends on the programming language (ASM - C). So both LOC and COCOMO seem rather useless.Indelicate
R
1

In my opinion it also depends on the design of your code - i've worked on projects in the 1-10K loc range, that was so poorly designed, that it felt like a really large project.

But is LOC really an interesting meassure for code? ;-)

Rutherfordium answered 3/6, 2009 at 8:22 Comment(1)
LOC may not be an absolute measure of code complexity, but it is a reasonable approximation, especially if you pay more attention to the magnitude than the exact value (1k vs. 10k vs. 100k)Paramorphism

© 2022 - 2024 — McMap. All rights reserved.