Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction
Why we measure?
Evaluate the productivity
Evaluate the profits
A previous stage before estimate
Justify using new tools
Software projects are typically controlled by four major variables; time, requirements,
resources (people, infrastructure/materials, and money), and risks.
Overestimating needs can be very expensive for the organization
3 kinds of methods
Metrics Attributes
Simple and computable. It should be relatively easy to learn how to derive the metric, and its
computation should not demand inordinate effort or time
Empirically and intuitively persuasive. The metric should satisfy the engineers intuitive notions
about the product attribute under consideration
Consistent and objective. The metric should always yield results that are unambiguous.
Consistent in its use of units and dimensions. The mathematical computation of the metric should
use measures that do not lead to bizarre combinations of unit.
Programming language independent. Metrics should be based on the analysis model, the design
model, or the structure of the program itself.
Effective mechanism for quality feedback. That is, the metric should provide a software engineer
with information that can lead to a higher quality end product
Size Measurement
Size matters!
Direct impact on staffing, duration, and budget.
Size indicators:
Lines of Code (SLOC)
Function Points
Feature Points
Object Points
Number of boxes on a data flow diagram
Number of classes in a design diagram
Source lines of code
Source lines of code (SLOC or LOC) is a software metric
used to measure the size of a software program by
counting the number of lines in the text of the program's
source code.
SLOC is typically used to predict the amount of effort that
will be required to develop a program, as well as to
estimate programming productivity or effort once the
software is produced.
Measurement methods
2 major types of SLOC measures:
physical SLOC (LOC)
logical SLOC (LLOC)
Logical LOC - Measure the number of statements.
Physical SLOC - Count the lines of the program's source code.
SLOC Example
Consider this snippet of C code as an example of the ambiguity
encountered when determining SLOC:
SLOC Example
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. HELLOWORLD.
000300
000400*
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
#include <stdio.h> 000900
001000 DATA DIVISION.
int main(void) { 001100 FILE SECTION.
001200
printf("Hello World"); 100000 PROCEDURE DIVISION.
return 0; 100100
} 100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS.
100500 DISPLAY "Hello world!" LINE 15 POSITION
10.
100600 STOP RUN.
100700 MAIN-LOGIC-EXIT.
100800 EXIT.
14
Function Point Computation
Counting Outputs
The following list includes "hints" to keep in mind when counting outputs:
External outputs are things produced by the software that go to the outside of the system.
Outputs are units of business information produced by the software for the end user (application-
oriented).
Examples include screen data, report data, error messages, and so on.
Count each unique unit of output that leaves the application boundary. An output unit is unique if it
has a different format and/or requires different processing logic.
Function Point Analysis Outputs Weighting Factors
15 Data Items Referenced 619 Data Items Referenced 20 or More Data Items
Referenced
0 or 1 File Referenced Simple (4) Simple (4) Average (5)
2 or 3 Files Referenced Simple (4) Average (5) Complex (7)
4 or More Files Referenced Average (5) Complex (7) Complex (7)
15
Function Point Computation
Counting Inputs
Remember the following when counting inputs:
External inputs are things received by the software from outside of the system.
Inputs are units of business information input by the user to the software for processing or
storage.
Count each unique unit of input.
16
Function Point Computation
Counting Inquiries (Output/Input)
When counting inquiries, keep the following in mind:
External inquiries are specific commands or requests that the software performs,
generated from the outside. It is online input that causes a software response.
Inquiries are direct accesses to a database that retrieve specific data, use simple keys,
are real-time (requires an immediate response), and perform no update functions.
Count each unique unit of inquiry. An inquiry is considered unique in either of two cases:
It has a format different from others in either its input or output portions.
It has the same format, both input and output, as another inquiry but requires
different processing logic in either.
Inquiries with different input and output portions will have different complexity weighting
factors, as explained later.
Queries are not inquiries. Queries are usually classified as either inputs or outputs because
they often use many keys and include operations or calculations on data.
17
Function Point Computation
Function Point Analysis Inquiries Weighting Factors
Output Part (Note: Select the
20 or More Data Items
Greatest ValueOutput or 15 Data Items Referenced 619 Data Items Referenced
Referenced
Input)
0 or 1 File Referenced Simple (4) Simple (4) Average (5)
2 or 3 Files Referenced Simple (4) Average (5) Complex (7)
4 or More Files Referenced Average (5) Complex (7) Complex (7)
18
Function Point Computation
Counting Data Structures (Files)
Things to keep in mind when counting data structures (files) include:
Internal files are logical files within the program.
Data structures (previously known as "files") are each primary logical group of user data
permanently stored entirely within the software system boundary.
Data structures are available to users via inputs, outputs, inquiries, or interfaces.
Function Point Analysis Files Weighting Factors
Note: Count of Logical
51 or More Data Items
Relationships, Not Physical 19 Data Items Referenced 2050 Data Items Referenced
Referenced
Record Types
1 Logical Record Simple (7) Simple (7) Average (10)
Format/Relationship
25 Logical Record Simple (7) Average (10) Complex (15)
Format/Relationships
6 or More Logical Record Average (10) Complex (15) Complex (15)
Format/Relationships
19
Function Point Computation
Counting Interfaces
When counting interfaces, keep these thoughts in mind:
External files are machine-generated files used by the program.
Interfaces are data (and control) stored outside the boundary of the software system being
evaluated.
Data structures shared between systems are counted as both interfaces and data structures.
Count each data and control flow in each direction as a unique interface.
Function Point Analysis Interfaces Weighting Factors
Note: Number of Logical
51 or More Data Items
Relationships, Not Physical 19 Data Items Referenced 2050 Data Items Referenced
Referenced
Record Types
1 Logical Record Simple (5) Simple (5) Average (7)
Format/Relationship
25 Logical Record Simple (5) Average (7) Complex (10)
Format/Relationships
6 or More Logical Record Average (7) Complex (10) Complex (10)
Format/Relationships 20
Function Point Computation
2) Apply Complexity Weighting Factors
Multiply each the number of each type (simple, average,
complex) within each category (output, input, inquiries
[output/input], data structure [files], interfaces) by the appropriate
weighting factor.
Add the totals for each category.
Notice that the total results in a "raw function point" count.
Function Point Computation
Step 1. Count Number of Functions in Each Category
Step 2. Apply Complexity Weighting Factors
Simple Average Complex Function Points
Number of Outputs 12 x 4 = 48 11 x 5 = 55 5 x 7 = 35 48 + 55 + 35 = 138
Number of Inputs 8 x 3 = 24 9 x 4 = 36 6 x 6 = 36 24 + 36 + 36 = 96
Number of Inquiry 5 x 4 = 20 7 x 5 = 35 3 x 7 = 21 20 + 35 + 21
Outputs
Number of Inquiry Inputs 5 x 3 = 15 8 x 4 = 32 4 x 6 = 24 15 + 32 + 24 = 71
Number of Files 12 x 7 = 84 3 x 10 = 30 2 x 15 = 30 84 + 30 + 30 = 144
Number of Interfaces 9 x 5 = 45 6 x 7 = 42 4 x 10 = 40 45 + 42+ 40 = 127
Function points Not all systems and lacks Hard to train Need to re-estimate the
precision in small projects size as we have more
product knowledge
Lines of code Many metrics use LOC as Easy Based in other projects or
an input in own experience
Conclusion
The fundamental goals of software estimation are to produce
estimations of effort and schedule for anticipated software projects