If you want to buy the project management book mail
[email protected] for
more details or call any of our book shops MUMBAI-22078296/97/022-22070989,
KOLKATA-22826518/19 HYDERABAD-24756967,24756400,BANGALORE-25587923,
25584641,AHMEDABAD-26421611,BHATINA(PUNJAB)-2237387,CHENNAI-28410796,28550491,DELHI/NEWDELHI-23254990/91,23325760,26415092,24691288.If
you want to write to the author directly email at
[email protected]
LOC (Lines of Code) is a metric to measure size of software program by counting the number of lines in the program’s source code. There are two types of LOC units:-
For instance the below code snippet has 5 physical lines of code while 2 logical lines of code (we excluded comments and curly brackets when we count logical lines of code).
// Loop and display the value
for (int i = 0; i < 10; i++)
{
System.Console.WriteLine(Convert.ToString(i));
}
SEI (Software Engineering Institute) has come out with a check list called as ‘Logical Source Statement of code’. So if we want to get the logical lines of code we should follow the below simplified SEI table.
|
Litmus Test |
Include in Counting or Not |
|
Depending on Statement Type |
|
|
Executable |
Yes |
|
Non-executable |
|
|
Declarations |
Yes |
|
Compiler directives |
Yes |
|
Comments |
|
|
On their Own lines |
No |
|
On lines with Source Code |
No |
|
Banners and nonblank spacers |
No |
|
Blank (Empty) Comments |
No |
|
Blank Lines |
No |
|
How Produced |
|
|
Programmed = = |
Yes |
|
Generated with Source Code Generators |
Yes |
|
Converted with automated Translators |
Yes |
|
Copied or reused without Change |
Yes |
|
Modified |
Yes |
|
Removed |
No |
|
Origin |
|
|
New Work: no Prior Existence |
Yes |
|
Prior Work: Taken or adapted from |
|
|
A previous version, build or release |
Yes |
|
COTS Commercial, off- the- shelf Software, other then reuse libraries |
Yes |
|
Another Product |
Yes |
|
A vendor- supplied language support library (unmodified) |
No |
|
A vendor- supplied Operating system or utility (unmodified) |
No |
|
A local or modified language support Library or operating System |
Yes |
|
Other Commercial library |
Yes |
|
A reuse library (software designed for reuse) |
Yes |
|
Other software component or library |
Yes |
|
Usage |
|
|
In or as part of primary product |
Yes |
|
External to or in support of the primary product |
Yes |
|
Delivery |
|
|
Delivered |
|
|
Delivered as Source |
Yes |
|
Delivered in Compiled or executable form, but not as source |
Yes |
|
Not delivered |
|
|
Under Configuration control |
No |
|
Not under configuration control |
No |
|
Functionality |
|
|
Operative |
Yes |
|
Inoperative (Dead, bypassed, unused, unreferenced or unaccessed) |
|
|
Functional (Intentional Dead Code, reactivated for special purpose) |
Yes |
|
Nonfunctional (unintentionally present)No |
No |
|
Replications |
|
|
Master Source Statements (originals) |
Yes |
|
Physical replicates of master statements, stored in master code |
Yes |
|
Copies inserted, instantiated, or expanded when compiling or linking |
No |
|
Postproduction replicates- as in distributed, redundant or reparameterized systems |
No |
|
Development status |
|
|
Estimated or planned |
No |
|
Designed |
No |
|
Coded |
No |
|
Unit tests Completed |
No |
|
Integrated into components |
No |
|
Test readiness review completed |
No |
|
Software (CI) test completed |
No |
|
System test completed |
Yes |
Table: - SEI check list (Courtesy SEI)
If you count line of code with out using SEI check list that means it is physical lines of code.
Advantages of LOC
Disadvantages of LOC
If you want to buy the project management book mail
[email protected] for
more details or call any of our book shops MUMBAI-22078296/97/022-22070989,
KOLKATA-22826518/19 HYDERABAD-24756967,24756400,BANGALORE-25587923,
25584641,AHMEDABAD-26421611,BHATINA(PUNJAB)-2237387,CHENNAI-28410796,28550491,DELHI/NEWDELHI-23254990/91,23325760,26415092,24691288.If
you want to write to the author directly email at
[email protected]