SlideShare a Scribd company logo
Line of code metrics
Faiz ul haque Zeya
Senior associate professor BUKC
• physical SLOC (LOC)
• logical SLOC (LLOC).
• physical SLOC is a count of lines in the text of the program's
source code excluding comment lines.
• Now how many lines of code is this? */
• for (i = 0; i < 100; i++)
• {
• printf("hello");
• }
• 4 physical lines of code (LOC): is placing braces work to be estimated?
• 2 logical lines of code (LLOC): what about all the work writing non-statement lines?
• 1 comment line: tools must account for all code and comments regardless of comment placement.
• Even the "logical" and "physical" SLOC values can have a large number of varying definitions.
• Logical SLOC attempts to measure the number of executable
"statements",
for (i = 0; i < 100; i++) printf("hello"); /* How many lines of code is this? */
• 1 physical line of code (LOC),
• 2 logical lines of code (LLOC) (for statement and printf statement),
• 1 comment line.
Year Operating system SLOC (million)
1993 Windows NT 3.1 4–5[3]
1994 Windows NT 3.5 7–8[3]
1996 Windows NT 4.0 11–12[3]
2000 Windows 2000 more than 29[3]
2001 Windows XP 45[4][5]
2003 Windows Server 2003 50[3]
• Advantages[edit]
1.Scope for automation of counting: since line of code is a physical entity, manual counting
effort can be easily eliminated by automating the counting process. Small utilities may be
developed for counting the LOC in a program. However, a logical code counting utility
developed for a specific language cannot be used for other languages due to the syntactical
and structural differences among languages. Physical LOC counters, however, have been
produced which count dozens of languages.
2.An intuitive metric: line of code serves as an intuitive metric for measuring the size of
software because it can be seen, and the effect of it can be visualized. Function points are
said to be more of an objective metric which cannot be imagined as being a physical entity,
it exists only in the logical space. This way, LOC comes in handy to express the size of
software among programmers with low levels of experience.
3.Ubiquitous measure: LOC measures have been around since the earliest days of software.
[15]
As such, it is arguable that more LOC data is available than any other size measure.
Disadvantages
1.Lack of accountability: lines-of-code measure suffers from some fundamental problems.
Some[who?]
think that it isn't useful to measure the productivity of a project using only
results from the coding phase, which usually accounts for only 30% to 35% of the overall
effort.[citation needed]
2.Lack of cohesion with functionality: though experiments[by whom?]
have repeatedly confirmed
that while effort is highly correlated with LOC, functionality is less well correlated with
LOC. That is, skilled developers may be able to develop the same functionality with far
less code, so one program with less LOC may exhibit more functionality than another
similar program. In particular, LOC is a poor productivity measure of individuals, because
a developer who develops only a few lines may still be more productive than a developer
creating more lines of code – even more: some good refactoring like "extract method" to
get rid of redundant code and keep it clean will mostly reduce the lines of code.
3.Adverse impact on estimation: because of the fact presented under point #1, estimates
based on lines of code can adversely go wrong, in all possibility.
4.Developer's experience: implementation of a specific logic differs based on the
level of experience of the developer. Hence, number of lines of code differs from
person to person. An experienced developer may implement certain functionality
in fewer lines of code than another developer of relatively less experience does,
though they use the same language.
5.Difference in languages: consider two applications that provide the same
functionality (screens, reports, databases). One of the applications is written in
C++ and the other application written in a language like COBOL. The number of
function points would be exactly the same, but aspects of the application would
be different. The lines of code needed to develop the application would certainly
not be the same. As a consequence, the amount of effort required to develop
the application would be different (hours per function point). Unlike lines of code,
the number of function points will remain constant.
• Counting Source Lines of Code (SLOC) (dwheeler.com)
• C. M. Lott: Metrics tools for C/C++ (archive.org)
• RSM Metrics Narration (archive.org)

More Related Content

PPTX
Project Scheduling and Tracking in Software Engineering.pptx
PPTX
Metrics for project size estimation
PPTX
design-3 software engineering unit three
PPTX
Unit 1 introduction to c++.pptx
PPSX
Ic lecture8
PPTX
Software size estimation
PPTX
Programming Paradigm & Languages
PPTX
Programming Paradigm & Languages
Project Scheduling and Tracking in Software Engineering.pptx
Metrics for project size estimation
design-3 software engineering unit three
Unit 1 introduction to c++.pptx
Ic lecture8
Software size estimation
Programming Paradigm & Languages
Programming Paradigm & Languages

Similar to Line of code metrics. Software metrics and estimation (20)

PDF
Programming vs Coding: Unveiling The Key Differences
PDF
Software Metrics Course chapter 5 at Bahir Dar University
PPTX
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
ODP
Programming
PPTX
Line of Code (LOC) Matric and Function Point Matric
PPTX
Programming Development LifeCycle11.pptx
PDF
Compiler Design Lecture Notes Cmu 15411 Itebooks
PDF
Qualidade de Software em zOS usando IBM Debug Tool e RDz
PPT
Introduction to Compiler design
PPTX
Programming C ppt for learning foundations
DOCX
WEBSITE DEVELOPMENT
PDF
Adobe Scan 22-Aug-2024-1167527822678.pdf
DOCX
Comso c++
PDF
Problems of testing 64-bit applications
PPTX
Introduction to Programming kkkkkkkkkkkkk
PDF
Traps detection during migration of C and C++ code to 64-bit Windows
PDF
Code Inspection
PPTX
grade 10 2023.pptx
PDF
CODE REVIEW AND COOPERATIVE PAIR PROGRAMMING BEST PRACTICE
Programming vs Coding: Unveiling The Key Differences
Software Metrics Course chapter 5 at Bahir Dar University
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
Programming
Line of Code (LOC) Matric and Function Point Matric
Programming Development LifeCycle11.pptx
Compiler Design Lecture Notes Cmu 15411 Itebooks
Qualidade de Software em zOS usando IBM Debug Tool e RDz
Introduction to Compiler design
Programming C ppt for learning foundations
WEBSITE DEVELOPMENT
Adobe Scan 22-Aug-2024-1167527822678.pdf
Comso c++
Problems of testing 64-bit applications
Introduction to Programming kkkkkkkkkkkkk
Traps detection during migration of C and C++ code to 64-bit Windows
Code Inspection
grade 10 2023.pptx
CODE REVIEW AND COOPERATIVE PAIR PROGRAMMING BEST PRACTICE
Ad

More from Faiz Zeya (17)

PPTX
FUNCTIONAL SIZE MEASURE AND ESTIMATES. SOFTWARE METRICS COURSE
PPTX
HALSTEAD COMPLEXITY-SOFTWARE METRICS AND ESTIMATION
PPTX
Software metrics lecture 4 Usability metrics
PPTX
Lecture 2 software metrics and estimation.
PPTX
Software metrics and estimation lecture 1
PPTX
Reinforcement learning through human feedback
PPTX
Artificial Intelligence- lecture 1 BUKC lecture
PPT
Structure of Z Formal methods Lecture
PPTX
Elements of Z. Formal methods lecture
PPTX
Text editor in Z
PPTX
First order logic
PPTX
Word2vec Lecture. NLP BUKC lecture.
PPTX
Code completion using OpenAI APIs.pptx
PPTX
Types of machine learning.pptx
PPTX
Linear algebraweek2
PPTX
Query expansion for search improvement by faizulhaque
PPTX
Big data introduction
FUNCTIONAL SIZE MEASURE AND ESTIMATES. SOFTWARE METRICS COURSE
HALSTEAD COMPLEXITY-SOFTWARE METRICS AND ESTIMATION
Software metrics lecture 4 Usability metrics
Lecture 2 software metrics and estimation.
Software metrics and estimation lecture 1
Reinforcement learning through human feedback
Artificial Intelligence- lecture 1 BUKC lecture
Structure of Z Formal methods Lecture
Elements of Z. Formal methods lecture
Text editor in Z
First order logic
Word2vec Lecture. NLP BUKC lecture.
Code completion using OpenAI APIs.pptx
Types of machine learning.pptx
Linear algebraweek2
Query expansion for search improvement by faizulhaque
Big data introduction
Ad

Recently uploaded (20)

PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
L1 - Introduction to python Backend.pptx
PDF
medical staffing services at VALiNTRY
PDF
System and Network Administration Chapter 2
PPT
Introduction Database Management System for Course Database
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Nekopoi APK 2025 free lastest update
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
ai tools demonstartion for schools and inter college
PDF
Digital Strategies for Manufacturing Companies
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
CHAPTER 2 - PM Management and IT Context
L1 - Introduction to python Backend.pptx
medical staffing services at VALiNTRY
System and Network Administration Chapter 2
Introduction Database Management System for Course Database
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Softaken Excel to vCard Converter Software.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Nekopoi APK 2025 free lastest update
Operating system designcfffgfgggggggvggggggggg
ai tools demonstartion for schools and inter college
Digital Strategies for Manufacturing Companies
Design an Analysis of Algorithms I-SECS-1021-03
Wondershare Filmora 15 Crack With Activation Key [2025
VVF-Customer-Presentation2025-Ver1.9.pptx
Odoo POS Development Services by CandidRoot Solutions

Line of code metrics. Software metrics and estimation

  • 1. Line of code metrics Faiz ul haque Zeya Senior associate professor BUKC
  • 2. • physical SLOC (LOC) • logical SLOC (LLOC).
  • 3. • physical SLOC is a count of lines in the text of the program's source code excluding comment lines.
  • 4. • Now how many lines of code is this? */ • for (i = 0; i < 100; i++) • { • printf("hello"); • } • 4 physical lines of code (LOC): is placing braces work to be estimated? • 2 logical lines of code (LLOC): what about all the work writing non-statement lines? • 1 comment line: tools must account for all code and comments regardless of comment placement. • Even the "logical" and "physical" SLOC values can have a large number of varying definitions.
  • 5. • Logical SLOC attempts to measure the number of executable "statements",
  • 6. for (i = 0; i < 100; i++) printf("hello"); /* How many lines of code is this? */ • 1 physical line of code (LOC), • 2 logical lines of code (LLOC) (for statement and printf statement), • 1 comment line.
  • 7. Year Operating system SLOC (million) 1993 Windows NT 3.1 4–5[3] 1994 Windows NT 3.5 7–8[3] 1996 Windows NT 4.0 11–12[3] 2000 Windows 2000 more than 29[3] 2001 Windows XP 45[4][5] 2003 Windows Server 2003 50[3]
  • 8. • Advantages[edit] 1.Scope for automation of counting: since line of code is a physical entity, manual counting effort can be easily eliminated by automating the counting process. Small utilities may be developed for counting the LOC in a program. However, a logical code counting utility developed for a specific language cannot be used for other languages due to the syntactical and structural differences among languages. Physical LOC counters, however, have been produced which count dozens of languages. 2.An intuitive metric: line of code serves as an intuitive metric for measuring the size of software because it can be seen, and the effect of it can be visualized. Function points are said to be more of an objective metric which cannot be imagined as being a physical entity, it exists only in the logical space. This way, LOC comes in handy to express the size of software among programmers with low levels of experience. 3.Ubiquitous measure: LOC measures have been around since the earliest days of software. [15] As such, it is arguable that more LOC data is available than any other size measure.
  • 9. Disadvantages 1.Lack of accountability: lines-of-code measure suffers from some fundamental problems. Some[who?] think that it isn't useful to measure the productivity of a project using only results from the coding phase, which usually accounts for only 30% to 35% of the overall effort.[citation needed] 2.Lack of cohesion with functionality: though experiments[by whom?] have repeatedly confirmed that while effort is highly correlated with LOC, functionality is less well correlated with LOC. That is, skilled developers may be able to develop the same functionality with far less code, so one program with less LOC may exhibit more functionality than another similar program. In particular, LOC is a poor productivity measure of individuals, because a developer who develops only a few lines may still be more productive than a developer creating more lines of code – even more: some good refactoring like "extract method" to get rid of redundant code and keep it clean will mostly reduce the lines of code. 3.Adverse impact on estimation: because of the fact presented under point #1, estimates based on lines of code can adversely go wrong, in all possibility.
  • 10. 4.Developer's experience: implementation of a specific logic differs based on the level of experience of the developer. Hence, number of lines of code differs from person to person. An experienced developer may implement certain functionality in fewer lines of code than another developer of relatively less experience does, though they use the same language. 5.Difference in languages: consider two applications that provide the same functionality (screens, reports, databases). One of the applications is written in C++ and the other application written in a language like COBOL. The number of function points would be exactly the same, but aspects of the application would be different. The lines of code needed to develop the application would certainly not be the same. As a consequence, the amount of effort required to develop the application would be different (hours per function point). Unlike lines of code, the number of function points will remain constant.
  • 11. • Counting Source Lines of Code (SLOC) (dwheeler.com) • C. M. Lott: Metrics tools for C/C++ (archive.org) • RSM Metrics Narration (archive.org)