Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Software Engineering Tutorial
  • Software Development Life Cycle
  • Waterfall Model
  • Software Requirements
  • Software Measurement and Metrics
  • Software Design Process
  • System configuration management
  • Software Maintenance
  • Software Development Tutorial
  • Software Testing Tutorial
  • Product Management Tutorial
  • Project Management Tutorial
  • Agile Methodology
  • Selenium Basics
Open In App
Next Article:
Differentiate between LOC and Function Point in Software Engineering
Next article icon

Differentiate between LOC and Function Point in Software Engineering

Last Updated : 25 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

1. Lines of Code (LOC) :
The line of code (LOC) metric is any line of text in a code that is not a comment or blank line, in any case of the number of statements or fragments of statements on the line. LOC consists of all lines containing program header files, declaration of any variable, and executable and non-executable statements. As Lines of Code (LOC) only counts the proportion of code, you can only utilize it to compare or estimate projects that utilize the same language and are programmed using the same coding standards.

Example of Line of Code :

C++
void selSort(int x[], int n) {   //Below function sorts an array in ascending order     int i, j, min, temp;    for (i = 0; i < n - 1; i++) {       min = i;       for (j = i + 1; j < n; j++)       if (x[j] < x[min])       min = j;       temp = x[i];       x[i] = x[min];       x[min] = temp;    } } 

So, now If LOC is simply a count of the number of lines then the above function shown contains 13 lines of code (LOC). But when comments and blank lines are ignored, the function shown above contains 12 lines of code (LOC).

2. Function Point (FP) :
In the function point metric, the number and type of functions held up by the software are used to find FPC (function point count).

Example of function point :
Check out this article for a detailed example : Calculation of Function Point (FP)
Both function point and LOC are measurement units for the size of the software. The size of the software that is dependent on development is necessary to come up with accurate estimates of the effort, cost, and duration of a project. Most parametric estimation models such as the Constructive Cost Model (COCOMO) accept size conveyed in either FP or LOC as an input.

For a comprehensive overview of LOC and FP, including detailed examples and calculations, explore our course, " Complete Guide to Software Testing ," at GeeksforGeeks.


Difference between LOC and Function Point :

Function Point (FP) Line of Code (LOC)
Function Point metric is specification-based. LOC metric is based on analogy.
Function Point metric is language independent. LOC metric is dependent on language.
Function Point metric is user-oriented. LOC metric is design-oriented.
Function Point metric is extendible to Line of Code. It is changeable to FP (i.e. backfiring)
Function Point is used for data processing systems LOC is used for calculating the size of the computer program
Function Point can be used to portray the project time LOC is used for calculating and comparing the productivity of programmers.

In general, people prefer the functional size of software indicated as Function Point for one very important reason, i.e, the size expressed using the Function point metric stays constant in any case and whichever language or languages are used.



Next Article
Differentiate between LOC and Function Point in Software Engineering

T

tarunsinghwap7
Improve
Article Tags :
  • Difference Between
  • Software Engineering
  • Software Testing
  • Software Testing

Similar Reads

    Function Oriented Design - Software Engineering
    The design process for software systems often has two levels. At the first level, the focus is on deciding which modules are needed for the system based on SRS (Software Requirement Specification) and how the modules should be interconnected. Function Oriented Design is an approach to software desig
    3 min read
    Software Engineering | Calculation of Function Point (FP)
    Function Point (FP) is an element of software development which helps to approximate the cost of development early in the process. It may measures functionality from user's point of view. Counting Function Point (FP): Step-1: F = 14 * scale Scale varies from 0 to 5 according to character of Complexi
    4 min read
    Lines of Code (LOC) in Software Engineering
    A line of code (LOC) is any line of text in a code that is not a comment or blank line, and also header lines, in any case of the number of statements or fragments of statements on the line. LOC consists of all lines containing the declaration of any variable, and executable and non-executable state
    4 min read
    Difference between Function and Procedure
    Pre-requisites: What is SQL? Structured Query Language is a computer language that we use to interact with a relational database.SQL is a tool for organizing, managing, and retrieving archived data from a computer database. In this article, we will see the difference between Function and Procedure.
    3 min read
    Difference between Program and Function
    1. Program : Program, as name suggest, are set or collection of instructions used by computer to execute specific task and these are created using particular programming languages such as C++, Python, Ruby, etc. 2. Function : Function, as name suggests, is basic concept in computer programming that
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences