2. Q: Explain LOC-oriented model.
• The simplest measure of problem size is lines of code.
• This metric is metric measures the number of source
instructions required to solve a problem.
• While counting the number of source instructions, lines
used for commenting the code and the headers lines are
ignored.
3. • In order to estimate the LOC measure at the beginning of a
project,
project managers divide the problem into module, and
each module into sub-modules and so on.
• Here past experience in developing similar projects can be
helpful.
4. • Looking at the following table, we can know the size of a
module for particular project.
Module Efforts in man-months LOC
Module 1 3 24000
Module 2 4 25000
5. • Looking at the above(TABLE) we have direct measure of the
module in terms of LOC.
• We can derive a productivity metrics from the above
primitive metrics i.e. LOC
Syntax: Productivity of a person = LOC / man-months
Example: Productivity of a person = 24,000 / 3
Productivity of a person = 8,000
• We can also derive quality metrics using LOC.
• Quality = No. of defects/ LOC
6. • E.g. consider there are 1200 defects in MODULE 1 in above
example.
• How we can find quality are as shown below.
• Quality = No. of defects / LOC
• Quality = 1200 / 24,000
• Quality = 1 / 20
• From above result we can estimate that at every 20 lines in
project coding there will be chance in error in 1 line.
7. • Looking at the data in table below, it can be easily observed
that LOC is not an absolute measure of program size and
largely depends off the programming language and tools used
for development activities.
Module Efforts in man-months LOC in COBOL LOC in C LOC in JAVA
Module 1 3 24000 18000 5000
Module 2 4 25000 18500 500
• LOC however only focuses on the coding activity alone
regarding complexity of design and testing things.