Lines of Code (LOC) Measure
(Redirected from Lines of Code)
A Lines of Code (LOC) Measure is a software size measure within source code files that aims to quantify program size by counting code lines in the program's source code.
- AKA: LOC Metric, Source Lines of Code (SLOC), Lines of Code Metric, Code Line Count.
- Context:
- It can typically estimate Software Development Effort through LOC-based estimation models.
- It can typically measure Programming Productivity via LOC per time unit.
- It can typically assess Software Project Size using LOC counts.
- It can typically track Code Growth Rate through LOC trend analysis.
- It can typically support Software Cost Estimation via LOC-based pricing.
- ...
- It can often indicate Software Complexity Trends through LOC growth patterns.
- It can often enable Software Team Comparison by LOC productivity metrics.
- It can often facilitate Software Portfolio Analysis via LOC distribution.
- It can often guide Software Maintenance Planning through LOC maintenance ratios.
- ...
- It can range from being a Physical Lines of Code (LOC) Measure to being a Logical Lines of Code (LOC) Measure, depending on its LOC counting method.
- It can range from being a Source Lines of Code (SLOC) Measure to being an Executable Lines of Code (ELOC) Measure, depending on its LOC inclusion criteria.
- It can range from being a Language-Specific Lines of Code (LOC) Measure to being a Language-Agnostic Lines of Code (LOC) Measure, depending on its LOC normalization approach.
- ...
- It can vary significantly based on Programming Language Verbosity, Coding Style, and Code Formatting Standards.
- It can be criticized for not measuring Software Functionality or Software Quality.
- It can be easily manipulated through Code Duplication or Verbose Coding Practices.
- It can correlate with but not determine Software Maintainability or Software Defect Density.
- It can be automatically calculated by Static Analysis Tools and Code Metric Tools.
- ...
- Example(s):
- Physical LOC Counting Methods, such as:
- Total Lines Count, counting every line including blank lines and comment lines.
- Non-Blank Lines Count, excluding empty lines from LOC total.
- Non-Comment Lines Count, excluding comment-only lines from LOC count.
- Gross Lines Count, including all physical lines in source files.
- Logical LOC Counting Methods, such as:
- Statement Count, measuring executable statements regardless of physical lines.
- Effective Lines of Code, counting semantically meaningful lines.
- Delivered Source Instructions (DSI), measuring delivered executable instructions.
- Logical Source Statements, counting logical program statements.
- Language-Specific LOC Measures, such as:
- Java LOC Count, considering Java syntax and Java conventions.
- Python LOC Count, accounting for Python indentation and Python style.
- C++ LOC Count, handling C++ preprocessor directives and C++ templates.
- SQL LOC Count, measuring SQL statements and SQL procedures.
- Specialized LOC Variants, such as:
- KLOC (Thousands of Lines of Code), measuring large-scale software systems.
- MLOC (Millions of Lines of Code), quantifying enterprise software scale.
- NCLOC (Non-Comment Lines of Code), focusing on executable code lines.
- LLOC (Logical Lines of Code), measuring logical statement counts.
- LOC-Based Productivity Measures, such as:
- LOC per Developer Day, measuring individual coding productivity.
- LOC per Team Sprint, tracking team development velocity.
- LOC per Dollar, assessing development cost efficiency.
- LOC per Function Point, comparing size-to-functionality ratios.
- ...
- Physical LOC Counting Methods, such as:
- Counter-Example(s):
- Function Point Analysis, which measures software functionality rather than code volume.
- Cyclomatic Software Complexity Measure, which assesses control flow complexity rather than code size.
- Story Point Estimate, which gauges development effort rather than code line count.
- Code Coverage Metric, which measures test completeness rather than program size.
- Technical Debt Measure, which evaluates code quality issues rather than code quantity.
- See: Maintainability, Software Size, Computer Program, Source Code, Programming Productivity, Software Size Measure, Software Metric, Software Complexity Measure, Software Engineering-Related Measure, Code Quality Metric.
References
2018
- (Wikipedia, 2018) ⇒ https://en.wikipedia.org/wiki/Source_lines_of_code Retrieved:2018-3-5.
- 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. 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.