Line of Code
The basis of the Measure LOC is that program length can be used as a predictor of program characterictics such as effort and ease of maintenance. The LOC measure is used to measure size of the software.
There are versions of LOC :
DSI ( Delivered Source Instructions )
It is used in COCOMO'81 as KDSI ( Means thousands of Delivered Source Instructions ). DSI is defined as follows :
- Only Source lines that are DELIVERED as part of the product are included -- test drivers and other support software is excluded
- SOURCE lines are created by the project staff -- code created by applications generators is excluded
- One INSTRUCTION is one line of code or card image
- Declarations are counted as instructions
- Comments are not counted as instructions
Advantages of LOC
- Simple to measure
Drawbacks of LOC
- It is defined on code. For example it cannot measure the size of specification.
- It characterise only one specific view of size, namely length, it takes no account of functionality or complexity
- Bad software design may cause excessive line of code
- It is language dependent
- Users cannot easly understand it
Because of the critics above there have been extensive efforts to characterise other prodeuct size attributes, notably complexity and functionality.
Function Points ( FP )
Function points [Albrecth 1979] is basic data from which productivity metrics could be computed.
FP data is used in two ways:
- as an estimation variable that is used to "size" each element of the software,
- as baseline metrics collected from past projects and used in conjuction with estimation variables to develop cost and effort projections.
The approach is to identify and count a number of unique function types:
Each of these is then individually assessed for complexity and given a weighting value which varies from 3 (for simple external inputs) to 15 (for complex internal files).
- external inputs (e.g. file names)
- external outputs (e.g. reports, messages)
- queries (interactive inputs needing a response)
- external files or interfaces (files shared with other software systems)
- internal files (invisible outside the system)
Unadjusted function points ( UFP ) is calculated as follows :
The sum of all the occurrences is computed by multiplying each function count with a weighting and then adding up all the values. The weights are based on the complexity of the feature being counted. Albrecht’s original method classified the weightings as:
Function Type Low Average High External Input x3 x4 x6 External Input x4 x5 x7 Logical Internal File x7 x10 x15 External Interface File x5 x7 x10 External Inquiry x3 x4 x6
Low, average and high decision can be determined with this table :
1-5 Data element types 6-19 Data elemet types 20+ Data elemet types 0-1 File types referenced Low Low Average 2-3 File types referenced Low Average High 4+ File types referenced Average High High
In order to find adjusted FP, UFP is multiplied by technical complexity factor ( TCF ) which can be calculated by the formula :
TCF = 0.65 + ( sum of factors ) / 100
There are 14 technical complexity factor. Each complexity factor is rated on the basis of its degree of influence, from no influence to very influencial :Then
- Data communications
- Performance
- Heavily used configuration
- Transaction rate
- Online data entry
- End user efficiency
- Online update
- Complex processing
- Reusability
- Installation ease
- Operations ease
- Multiple sites
- Facilitate change
- Distributed functions
FP = UFP x TCF
Function points are recently used also for real time systems.
Advantages of FPDrawbacks of FP
- It is not rescricted to code
- Language independent
- The necessary data is avaiable early in a project. We need onşy a detailed specification.
- More accurate than estimated LOC
- Subjective counting
- Hard to automate and diffucult to compute
- Ignores quality of output
- Oriented to traditional data porcessing applications
- Effort prediction using the unadjusted function count is often no worse than when the TCF is added [Jeffery et al 1993]
Organizations such as the International Function Point Users Group IFPUG have been active in identifying rules for function point counting to ensure that counts are comparable across different organizations.
At IFPUG's Message Board Home Page you can find solutions about practical use of FP.
If sufficient data exists from previous programs, function points can reasonably be converted to an LOC estimate.
There is a list on Function Points I think it is a good source for the up-to-date information on FPs.