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 . Its range is 0.65 to 1.35.
- FP = UFP × VAF. Some texts write . Here VAF and CAF mean the same adjustment factor.
- If all GSCs are average, each is rated 3. Then , and . 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
- Define the application boundary. Decide what belongs to the software being measured and what belongs to external systems.
- 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.
- 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.
- Compute UFP. Multiply each count by its weight and add them.
- Rate the 14 GSCs. Each GSC gets an influence value from 0 to 5. Sum them to get DI.
- Compute VAF/CAF. Use .
- Compute adjusted FP. Use .
- 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.
Drawing the diagram…
Formulas
- Let = unadjusted function points, = count of component , = weight of component , = rating of the -th GSC, and = total degree of influence.
- or equivalently,
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 .
Using average weights:
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.
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.
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.
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
| Feature | LOC | Function Points |
|---|---|---|
| Basis | Physical code size | Logical user-visible functions |
| Language dependence | High | Very low |
| Counting time | After code or detailed design | Early from requirements |
| Main use | Effort, defects per KLOC, cost per KLOC | Functional size, productivity, effort |
| Limitation | Coding style and language affect count | Needs precise boundary and counting rules |
| FP component | Meaning | Average weight |
|---|---|---|
| EI | Input entering the application boundary | 4 |
| EO | Output leaving after processing, may include derived data | 5 |
| EQ | Retrieval transaction without significant processing or update | 4 |
| ILF | Data group maintained inside the application | 10 |
| EIF | Data group maintained by another application but referenced | 7 |
| Term | Meaning |
|---|---|
| UFP | Weighted sum of the five component counts |
| VAF / CAF | Adjustment based on 14 GSCs; |
| FP | Adjusted functional size: |
| Size-oriented metric | Normalises quality/productivity by LOC/KLOC |
| Function-oriented metric | Uses functional components, including external interfaces |
| Extended function point metric | Variant such as feature points, extending basic FP to real-time, embedded or engineering software |
Revision summary
- 14 GSCs — not 12, 16 or 20. Each is rated 0 to 5.
- range is 0–70; VAF/CAF range is 0.65–1.35.
- If all GSCs are average, each is 3, so , .
- Average weights: EI 4, EO 5, EQ 4, ILF 10, EIF 7.
- ILF is maintained inside; EIF is maintained outside but referenced.
- EI brings data in; EO sends processed data out; EQ retrieves without significant processing.
- FP is language-independent and requirements-based; LOC is language-dependent and code-based.
- FP is not a source-code metric; LOC and FP both measure software size.
- Productivity = size/effort; effort = size/productivity.
- 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 , with .
- 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:
- Define LOC, KLOC and function points, and state two limitations of LOC.
- Explain why FP is less dependent on programming language than LOC.
- Identify EI, EO, EQ, ILF and EIF correctly from a user-scenario description.
- Compute UFP using average weights and given component counts.
- State that there are 14 GSCs, each rated 0–5, and compute DI and VAF.
- Calculate adjusted FP using .
- Handle the “all GSCs average” case correctly with VAF = 1.07.
- Convert FP to effort, duration and cost using productivity and team salary.
- Solve a two-step numeric problem involving FP, productivity and cost.
- Answer statement, assertion-reason and match-list items on FP components and metrics.
Attempt the PARIKSHA sub-topic test first, then the subject test.