1. Gyanastra
  2. Software Engineering
  3. Estimation and Scheduling
  4. Sizing LOC and Function Points
Free lesson, no account needed 9 min read 11 practice questions after it
Asked in past papers11 times
  • ISRO20182016
  • UGC NET202220202017201520142013201220072004

Software Engineering · Estimation and Scheduling

Sizing LOC and Function Points

Overview

Software sizing estimates how large a software product is, so that effort, cost, duration, productivity, quality and risk can be estimated and normalised.
The two standard UGC NET sizing measures are Lines of Code (LOC) and Function Points (FP). LOC measures physical implementation size, while FP measures functional size from the user’s point of view.
This topic sits in the Estimation and Scheduling area of Software Engineering. Before studying it, know the basic idea of software metrics, productivity, effort, and cost.

Key concepts

  • LOC (Lines of Code) is a size-oriented metric. It counts source code lines or logical program lines, often expressed as KLOC = LOC/1000.
  • LOC is language-dependent, coding-style-dependent, and can be counted accurately only after code exists. It is useful for defects/KLOC, cost/KLOC and productivity in LOC/person-month.
  • Function Point Analysis (FPA) measures the functional size of software from the user’s logical view. It is largely independent of implementation language and can be applied before coding.
  • The five function point components are:
    • EI (External Input): data or control information entering the application boundary.
    • EO (External Output): data leaving the boundary after processing, often with derived data.
    • EQ (External Inquiry): a retrieval transaction that presents data without significant processing or updating internal files.
    • ILF (Internal Logical File): a logical group of data maintained within the application boundary.
    • EIF (External Interface File): a logical group of data referenced by the application but maintained by another application.
  • The standard average complexity weights are: EI = 4, EO = 5, EQ = 4, ILF = 10, EIF = 7.
  • UFP (Unadjusted Function Points) is the weighted sum of the five component counts.
  • Function point adjustment uses 14 General System Characteristics (GSCs), also called value adjustment factors or complexity adjustment factors. Each GSC is rated from 0 to 5.
  • DI (Total Degree of Influence) = sum of the 14 GSC ratings. Its range is 0 to 70.
  • VAF (Value Adjustment Factor) is also called CAF (Complexity Adjustment Factor) in many texts. Its formula is VAF=0.65+0.01×DIVAF = 0.65 + 0.01 \times DI. Its range is 0.65 to 1.35.
  • FP = UFP × VAF. Some texts write FP=UFP×CAFFP = UFP \times CAF. Here VAF and CAF mean the same adjustment factor.
  • If all GSCs are average, each is rated 3. Then DI=14×3=42DI = 14 \times 3 = 42, and VAF=0.65+0.42=1.07VAF = 0.65 + 0.42 = 1.07. This is a common exam trap.
  • Function count/FP is language-independent; LOC is language-dependent. Both LOC and FP are software size measures.
  • FP is not a source-code metric. Source-code metrics include Halstead metrics, cyclomatic complexity and length metrics. FP is calculated mainly from user requirements and logical functions.

How it works

  1. Define the application boundary. Decide what belongs to the software being measured and what belongs to external systems.
  2. Identify the five function point components. Count user-recognisable EIs, EOs, EQs, ILFs and EIFs. Use the user’s logical view, not the internal database or code structure.
  3. Assign complexity and weights. Each component is classified as low, average or high. In UGC NET problems, average weights are often used: EI 4, EO 5, EQ 4, ILF 10, EIF 7.
  4. Compute UFP. Multiply each count by its weight and add them.
  5. Rate the 14 GSCs. Each GSC gets an influence value from 0 to 5. Sum them to get DI.
  6. Compute VAF/CAF. Use VAF=0.65+0.01×DIVAF = 0.65 + 0.01 \times DI.
  7. Compute adjusted FP. Use FP=UFP×VAFFP = UFP \times VAF.
  8. Use FP for estimation. Productivity = FP/effort.
    Effort = FP/productivity.
    For a team, duration = effort/team size under the simplified full-time parallel-work assumption.
    Cost = effort × cost per person-month, or team monthly cost × duration.

For LOC-based sizing, first fix the counting convention: physical LOC counts source lines, while logical LOC counts executable statements. Then compute LOC/KLOC and use historical productivity such as LOC/person-month.
LOC is easy to count but depends on language, coding style and libraries. FP avoids language dependence because it counts logical user functions, not implementation tokens.

Figure. It shows the ordered sequence: define boundary, identify EI EO EQ ILF EIF, classify complexity, compute UFP, rate 14 GSCs, compute VAF, adjusted FP, then estimate effort, cost and schedule.

Formulas

  • Let UFPUFP = unadjusted function points, CiC_i = count of component ii, WiW_i = weight of component ii, FjF_j = rating of the jj-th GSC, and DIDI = total degree of influence.

UFP=∑i=15CiWiUFP = \sum_{i=1}^{5} C_i W_i

DI=∑j=114Fj,0≤Fj≤5DI = \sum_{j=1}^{14} F_j, \qquad 0 \le F_j \le 5

VAF=CAF=0.65+0.01×DIVAF = CAF = 0.65 + 0.01 \times DI

FP=UFP×VAF=UFP×(0.65+0.01×DI)FP = UFP \times VAF = UFP \times (0.65 + 0.01 \times DI)

KLOC=LOC1000KLOC = \frac{LOC}{1000}

Productivity=SizeEffort\text{Productivity} = \frac{\text{Size}}{\text{Effort}}

Effort=SizeProductivity\text{Effort} = \frac{\text{Size}}{\text{Productivity}}

Duration=EffortTeam size\text{Duration} = \frac{\text{Effort}}{\text{Team size}}

Cost=Effort×cost per person-month\text{Cost} = \text{Effort} \times \text{cost per person-month}

  • or equivalently,

Cost=Team monthly cost×Duration\text{Cost} = \text{Team monthly cost} \times \text{Duration}

Worked examples

Example 1: Compute UFP and adjusted FP.
A project has 20 EIs, 15 EOs, 10 EQs, 8 ILFs and 4 EIFs, all average complexity. Total GSC influence DI=35DI = 35.
Using average weights: UFP=20(4)+15(5)+10(4)+8(10)+4(7)UFP = 20(4)+15(5)+10(4)+8(10)+4(7) =80+75+40+80+28=303=80+75+40+80+28=303 VAF=0.65+0.01(35)=0.65+0.35=1.00VAF = 0.65+0.01(35)=0.65+0.35=1.00 FP=303×1.00=303FP = 303 \times 1.00 = 303 Answer: 303 FP.

Example 2: Average GSC trap.
All 14 GSCs are rated average, i.e. each is 3. Find VAF. If UFP = 600, find FP.
DI=14×3=42DI=14 \times 3=42 VAF=0.65+0.01(42)=0.65+0.42=1.07VAF=0.65+0.01(42)=0.65+0.42=1.07 FP=600×1.07=642FP=600 \times 1.07=642 Answer: VAF = 1.07; FP = 642. The minimum VAF is 0.65 when all GSCs are 0; the maximum is 1.35 when all are 5.

Example 3: LOC to effort, duration and cost.
A software module is estimated at 15,000 LOC. Historical productivity is 500 LOC/person-month. Team size is 5. The team’s total monthly salary is Rs 4,00,000.
Effort=15000500=30 person-months\text{Effort}=\frac{15000}{500}=30 \text{ person-months} Duration=305=6 months\text{Duration}=\frac{30}{5}=6 \text{ months} Cost=6×4,00,000=24,00,000\text{Cost}=6 \times 4,00,000 = 24,00,000 Answer: 30 person-months, 6 months, Rs 24,00,000.

Example 4: FP to effort, duration and cost.
A project is 240 FP. Team productivity is 8 FP/person-month. Team size is 6. The team cost is Rs 3,00,000 per month.
Effort=2408=30 person-months\text{Effort}=\frac{240}{8}=30 \text{ person-months} Duration=306=5 months\text{Duration}=\frac{30}{6}=5 \text{ months} Cost=5×3,00,000=15,00,000\text{Cost}=5 \times 3,00,000 = 15,00,000 Answer: 30 person-months, 5 months, Rs 15,00,000.

Example 5: Statement type.
Statement I: An ILF is maintained within the application boundary.
Statement II: An EIF is referenced by the application but maintained by another application.
Statement III: An EQ normally updates internal logical files and creates derived data.
Statement I is true. Statement II is true. Statement III is false: an EQ is a retrieval transaction with no significant processing and no update of ILFs. Answer: I and II only.

Comparison

FeatureLOCFunction Points
BasisPhysical code sizeLogical user-visible functions
Language dependenceHighVery low
Counting timeAfter code or detailed designEarly from requirements
Main useEffort, defects per KLOC, cost per KLOCFunctional size, productivity, effort
LimitationCoding style and language affect countNeeds precise boundary and counting rules
FP componentMeaningAverage weight
EIInput entering the application boundary4
EOOutput leaving after processing, may include derived data5
EQRetrieval transaction without significant processing or update4
ILFData group maintained inside the application10
EIFData group maintained by another application but referenced7
TermMeaning
UFPWeighted sum of the five component counts
VAF / CAFAdjustment based on 14 GSCs; 0.65+0.01×DI0.65+0.01 \times DI
FPAdjusted functional size: UFP×VAFUFP \times VAF
Size-oriented metricNormalises quality/productivity by LOC/KLOC
Function-oriented metricUses functional components, including external interfaces
Extended function point metricVariant such as feature points, extending basic FP to real-time, embedded or engineering software

Revision summary

  1. 14 GSCs — not 12, 16 or 20. Each is rated 0 to 5.
  2. DIDI range is 0–70; VAF/CAF range is 0.65–1.35.
  3. If all GSCs are average, each is 3, so DI=42DI=42, VAF=1.07VAF=1.07.
  4. Average weights: EI 4, EO 5, EQ 4, ILF 10, EIF 7.
  5. ILF is maintained inside; EIF is maintained outside but referenced.
  6. EI brings data in; EO sends processed data out; EQ retrieves without significant processing.
  7. FP is language-independent and requirements-based; LOC is language-dependent and code-based.
  8. FP is not a source-code metric; LOC and FP both measure software size.
  9. Productivity = size/effort; effort = size/productivity.
  10. For a team, duration = effort/team size under the simplified exam assumption.

Previous-year exam insights

  • Direct questions ask the number of complexity adjustment factors (14) or the number of questions used for VAF.
  • Formula-based questions ask FP=UFP×CAF/VAFFP = UFP \times CAF/VAF, with VAF=0.65+0.01∑FiVAF = 0.65 + 0.01 \sum F_i.
  • Numeric FP questions usually provide counts for EI, EO, EQ, ILF and EIF. Multiply by average or given weights, then apply VAF.
  • A common trap is treating “all GSCs average” as VAF = 1.00. Correctly, average GSC = 3 and VAF = 1.07.
  • Match-list questions mix size-oriented metrics, function-oriented metrics and function point components.
  • Statement/assertion questions test whether FP can be counted before code and why it is language-independent.
  • Cost/productivity questions require two or three steps: FP → effort → duration → cost.
  • Do not confuse function count/FP with LOC or with source-code metrics such as Halstead and cyclomatic complexity.

Practice at PARIKSHA

You are ready for the PARIKSHA tests of this sub-topic when you can:

  1. Define LOC, KLOC and function points, and state two limitations of LOC.
  2. Explain why FP is less dependent on programming language than LOC.
  3. Identify EI, EO, EQ, ILF and EIF correctly from a user-scenario description.
  4. Compute UFP using average weights and given component counts.
  5. State that there are 14 GSCs, each rated 0–5, and compute DI and VAF.
  6. Calculate adjusted FP using FP=UFP×VAFFP = UFP \times VAF.
  7. Handle the “all GSCs average” case correctly with VAF = 1.07.
  8. Convert FP to effort, duration and cost using productivity and team salary.
  9. Solve a two-step numeric problem involving FP, productivity and cost.
  10. Answer statement, assertion-reason and match-list items on FP components and metrics.

Attempt the PARIKSHA sub-topic test first, then the subject test.

Pages 1–2 of 2