Source lines of code
lines of codeLOCSLOCline of codelinesinstructionsK-LOCKLOCLine numberinglines" of code
Source lines of code (SLOC), also known as lines of code (LOC), is a software metric used to measure the size of a computer program by counting the number of lines in the text of the program's source code.wikipedia
113 Related Articles
Programming productivity
programmer productivity
SLOC is typically used to predict the amount of effort that will be required to develop a program, as well as to estimate programming productivity or maintainability once the software is produced.
The rest of the model is based on function points and finally source lines of code (LOC).
Software metric
software metricsmetricmetrics
Source lines of code (SLOC), also known as lines of code (LOC), is a software metric used to measure the size of a computer program by counting the number of lines in the text of the program's source code.
Maintainability
maintainableMaintainability indexunmaintainable
SLOC is typically used to predict the amount of effort that will be required to develop a program, as well as to estimate programming productivity or maintainability once the software is produced.
The maintainability index is calculated with certain formulae from lines-of-code measures, McCabe measures and Halstead complexity measures.
Duplicate code
code duplicationduplicated codeDuplication
Furthermore, inexperienced developers often resort to code duplication, which is highly discouraged as it is more bug-prone and costly to maintain, but it results in higher SLOC.
Refactoring duplicate code can improve many software metrics, such as lines of code, cyclomatic complexity, and coupling.

COCOMO
COCOMO IIConstructive Cost Modelconstructive-cost model
There are several cost, schedule, and effort estimation models which use SLOC as an input parameter, including the widely used Constructive Cost Model (COCOMO) series of models by Barry Boehm et al., PRICE Systems True S and Galorath's SEER-SEM.
The study examined projects ranging in size from 2,000 to 100,000 lines of code, and programming languages ranging from assembly to PL/I.
SEER-SEM
There are several cost, schedule, and effort estimation models which use SLOC as an input parameter, including the widely used Constructive Cost Model (COCOMO) series of models by Barry Boehm et al., PRICE Systems True S and Galorath's SEER-SEM.
Supported sizing metrics include source lines of code (SLOC), function points, function-based sizing (FBS) and a range of other measures.
Linux kernel
LinuxLinux kernel mainlinekernel
It had 10,239 lines of code.








OS/2
OS/2 WarpIBM OS/2OS/2 Warp 4
How much money we made off OS/2, how much they did.
Microsoft programmers also became frustrated with IBM's bureaucracy and its use of lines of code to measure programmer productivity.







Cost estimation in software engineering
software estimationEstimation in software engineeringestimate
Software size is typically sized in SLOC, Function Point or Agile story points.
Function point
function pointsFunction point analysisAutomated Function Point
Many have advocated the use of function points instead of SLOC as a measure of functionality, but since function points are highly correlated to SLOC (and cannot be automatically measured) this is not a universally held view.
Linux
GNU/LinuxLinux on the desktopLin
David A. Wheeler studied the Red Hat distribution of the Linux operating system, and reported that Red Hat Linux version 7.1 (released April 2001) contained over 30 million physical SLOC.
A 2001 study of Red Hat Linux 7.1 found that this distribution contained 30 million source lines of code.









Software development effort estimation
Comparison of development estimation softwareestimationsoftware effort estimation
Computer program
programprogramscomputer programs
Source lines of code (SLOC), also known as lines of code (LOC), is a software metric used to measure the size of a computer program by counting the number of lines in the text of the program's source code.







Source code
codesourcesource file
Source lines of code (SLOC), also known as lines of code (LOC), is a software metric used to measure the size of a computer program by counting the number of lines in the text of the program's source code.
Order of magnitude
orders of magnitudeorderon the order of
Many useful comparisons involve only the order of magnitude of lines of code in a project.

Man-hour
man hourman-daysman-years
While it is debatable exactly how to measure lines of code, discrepancies of an order of magnitude can be clear indicators of software complexity or man-hours.
C (programming language)
CC programming languageC language
Logical SLOC attempts to measure the number of executable "statements", but their specific definitions are tied to specific computer languages (one simple logical SLOC measure for C-like programming languages is the number of statement-terminating semicolons).


Programming language
programming languageslanguagedialect
Logical SLOC attempts to measure the number of executable "statements", but their specific definitions are tied to specific computer languages (one simple logical SLOC measure for C-like programming languages is the number of statement-terminating semicolons).



Robert E. Park
Robert Ezra ParkRobert ParkPark
Robert E. Park (while at the Software Engineering Institute) and others developed a framework for defining SLOC values, to enable people to carefully explain and define the SLOC measure used in a project.

Software Engineering Institute
SEISoftware Engineering Institute (SEI)Carnegie Mellon Software Engineering Institute
Robert E. Park (while at the Software Engineering Institute) and others developed a framework for defining SLOC values, to enable people to carefully explain and define the SLOC measure used in a project.



Fortran
Fortran 77Fortran 90FORTRAN IV
At the time that people began using SLOC as a metric, the most commonly used languages, such as FORTRAN and assembly language, were line-oriented languages.





Assembly language
assemblerassemblyassembly code
At the time that people began using SLOC as a metric, the most commonly used languages, such as FORTRAN and assembly language, were line-oriented languages.

Punched card
punched cardspunch cardpunch cards
These languages were developed at the time when punched cards were the main form of data entry for programming.








