In LOC we can not determine the LOC just by pure requirements. There are two ways of estimating. First is either you have a history of data or either FP. We will try to understand how to estimate using FP, because history of LOC can be very inconsistent. To estimate effort using LOC in man/days or man/hours we need to also use COCOMO and FP. Alone LOC can not help us as such. Below figure ‘Using LOC’ shows how we can get the effort.
Figure: - Using LOC
Step 1:- We estimate using function points and get the number of function points (In the further chapters we have given the full details of how FP counting works).
Step 2:- If you have history of how many FP is how many lines of code use your company history or else you can refer the below table which has been collected from QSM database. There are many standard databases available which can give you the conversion. From this you will know how many LOC will be derived for that particular FP.
Step 3:- Feed the derived LOC in to the COCOMO formula which was explained previously and you will get the results in man/months.
Below table is taken from Source http://www.qsm.com/FPGearing.html
Language |
SLOC / FP |
Access |
38 |
ADA |
- |
Advantage |
38 |
APS |
83 |
ASP |
62 |
Assembler** |
157 |
C ** |
104 |
C++ ** |
53 |
C# |
59 |
Clipper |
39 |
COBOL ** |
77 |
Cool:Gen/IEF |
31 |
Culprit |
- |
DBase III |
- |
DBase IV |
- |
Easytrieve+ |
34 |
Excel |
46 |
Focus |
42 |
FORTRAN |
- |
FoxPro |
35 |
HTML** |
42 |
Ideal |
52 |
IEF/Cool:Gen |
31 |
Informix |
31 |
J2EE |
50 |
Java** |
59 |
JavaScript** |
54 |
JCL** |
48 |
JSP |
- |
Lotus Notes |
22 |
Mantis |
27 |
Mapper |
81 |
Natural |
52 |
Oracle** |
29 |
Oracle Dev 2K/FORMS |
30 |
Pacbase |
48 |
PeopleSoft |
32 |
Perl |
- |
PL/1** |
58 |
PL/SQL |
31 |
Powerbuilder** |
24 |
REXX |
- |
RPG II/III |
49 |
Sabretalk |
89 |
SAS |
41 |
Siebel Tools |
13 |
Slogan |
82 |
Smalltalk** |
32 |
SQL** |
35 |
VBScript** |
34 |
Visual Basic** |
42 |
VPF |
95 |
Web Scripts |
15 |
Table: - QSM database
Let’s do a simple sample estimation using LOC. Below are the assumptions for the project.
Assumptions |
|
Function points |
400 |
Language |
C# |
Development mode |
Organic |
Table: - Assumptions for COCOMO
Below figure ‘LOC calculation’ shows the effort calculation using LOC. Basically there are three steps:-
Below diagram shows the above calculation in a phase wise manner.
Figure: - LOC calculation