SlideShare a Scribd company logo
1 of 82
Software Metrics and
Estimation
Matakuliah Rekayasa Perangkat Lunak (CS215) – Gasal 2015/2016
Magister Ilmu Komputer - Universitas Budi Luhur
Achmad Solichin, S.Kom, M.T.I (achmatim@gmail.com)
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Overview
• Measure vs. Metrics
• Measure and Metric EstimationTechniques
• Metric EstimationTools
• Software Cost Estimation
• COCOMO Model
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Measure vs. Metrics
• quantitative indication of extent, amount, dimension,
capacity, or size of some attribute of a product or
process.
• Ex: Number of errors
Measure
• quantitative measure of degree to which a system,
component or process possesses a given attribute. “A
handle or guess about a given attribute.”
• Ex: Number of errors found per person hours expended
Metric
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Why Measure Software?
• Determine the quality of the current product or process
• Predict qualities of a product or process
• Improve quality of a product or process
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Motivation for Metrics
• Estimate the cost & schedule of future projects
• Evaluate the productivity impacts of new tools and techniques
• Establish productivity trends over time
• Improve software quality
• Forecast future staffing needs
• Anticipate and reduce future maintenance needs
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Example Metrics
• Defect rates
• Error rates
• Measured by:
• individual
• module
• during development
• Errors should be categorized by origin, type, cost
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Metric Classification
Products
• Explicit results of
software
development
activities
• Deliverables,
documentation, by
products
Processes
• Activities related
to production of
software
Resources
• Inputs into the
software
development
activities
• hardware,
knowledge, people
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Product vs. Process
Process Metrics
• Insights of process paradigm, software
engineering tasks, work product, or
milestones
• Lead to long term process improvement
Product Metrics
• Assesses the state of the project
• Track potential risks
• Uncover problem areas
• Adjust workflow or tasks
• Evaluate teams ability to control quality
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Types of Measures
Direct Measures
(internal attributes)
• Cost
• Effort
• LOC
• Speed
• Memory
Indirect Measures
(external attributes)
• Functionality
• Quality
• Complexity
• Efficiency
• Reliability
• Maintainability
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Size-Oriented Metrics
• Size of the software produced
• LOC - Lines Of Code
• KLOC - 1000 Lines Of Code
• SLOC – Statement Lines of Code (ignore whitespace)
• Typical Measures:
• Errors/KLOC, Defects/KLOC, Cost/LOC, Documentation Pages/KLOC
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
LOC Metrics
• Easy to use
• Easy to compute
• Language & programmer dependent
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Complexity Metrics
• LOC - a function of complexity
• Language and programmer dependent
• Halstead’s Software Science (entropy measures)
• n1 - number of distinct operators
• n2 - number of distinct operands
• N1 - total number of operators
• N2 - total number of operands
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Example
if (k < 2)
{
if (k > 3)
x = x*k;
}
• Distinct operators: if ( ) { } > < = * ;
• Distinct operands: k 2 3 x
• n1 = 10
• n2 = 4
• N1 = 13
• N2 = 7
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Halstead’s Metrics
• Amenable to experimental verification [1970s]
• Program length: N = N1 + N2
• Program vocabulary: n = n1 + n2
• Estimated length: N = n1 log2 n1 + n2 log2 n2
• Close estimate of length for well structured programs
• Purity ratio: PR = N / N
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Program Complexity
• Volume:V = N log2 n
• Number of bits to provide a unique designator for each of the n items in the program
vocabulary.
• Difficulty: 𝐷 =
𝑛1
2
∗
𝑁2
𝑛2
• Program effort: E = D*V
• This is a good measure of program understandability
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
McCabe’s Complexity Measures
• McCabe’s metrics are based on a control flow representation of
the program.
• A program graph is used to depict control flow.
• Nodes represent processing tasks (one or more code statements)
• Edges represent control flow between nodes
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Flow Graph Notation
Sequence
If-then-else
While
Until
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Cyclomatic Complexity
• Set of independent paths through the graph (basis set)
• V(G) = E – N + 2
• E is the number of flow graph edges
• N is the number of nodes
• V(G) = P + 1
• P is the number of predicate nodes
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Example
i = 0;
while (i<n-1) do
j = i + 1;
while (j<n) do
if A[i]<A[j] then
swap(A[i], A[j]);
end do;
i=i+1;
end do;
1
3
54
6
7
2
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
ComputingV(G)
• V(G) = E – N + 2 = 9 – 7 + 2 = 4
• V(G) = P + 1 = 3 + 1 = 4
• Basis Set
• 1, 7
• 1, 2, 6, 1, 7
• 1, 2, 3, 4, 5, 2, 6, 1, 7
• 1, 2, 3, 5, 2, 6, 1, 7
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Another Example
1
6
7
4
5
8
3
9
2
What isV(G)?
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Meaning
• V(G) is the number of (enclosed) regions/areas of the planar
graph
• Number of regions increases with the number of decision paths
and loops
• A quantitative measure of testing difficulty and an indication of
ultimate reliability
• Experimental data shows value ofV(G) should be no more then
10 - testing is very difficulty above this value
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
McClure’s Complexity Metric
• Complexity = C +V
• C is the number of comparisons in a module
• V is the number of control variables referenced in the module
• decisional complexity
• Similar to McCabe’s but with regard to control variables
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Metrics and Software Quality
FURPS
• Functionality – features of system
• Usability – aesthesis, documentation
• Reliability – frequency of failure, security
• Performance – speed, throughput
• Supportability – maintainability
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Measures of Software Quality
• Correctness – degree to which a program operates according to
specification
• Defects/KLOC
• Defect is a verified lack of conformance to requirements
• Failures/hours of operation
• Maintainability – degree to which a program is open to change
• Mean time to change
• Change request to new version (Analyze, design etc)
• Cost to correct
• Integrity - degree to which a program is resistant to outside attack
• Fault tolerance, security & threats
• Usability – easiness to use
• Training time, skill level necessary to use, Increase in productivity, subjective questionnaire
or controlled experiment
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
McCall’sTriangle of Quality
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
product
operation revision transition
reliability efficiency usability maintainability testability portability reusability
Metrics
Quality Model
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
High level Design Metrics
• Structural Complexity
• Data Complexity
• System Complexity
• Card & Glass ’80
• Structural Complexity S(i) of a module i.
• S(i) = fout
2(i)
• Fan out is the number of modules immediately subordinate (directly invoked).
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Design Metrics
• Data Complexity D(i)
• D(i) = v(i)/[fout(i)+1]
• v(i) is the number of inputs and outputs passed to and from i
• System Complexity C(i)
• C(i) = S(i) + D(i)
• As each increases the overall complexity of the architecture increases
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
System Complexity Metric
• Another metric:
• length(i) * [fin(i) + fout(i)]2
• Length is LOC
• Fan in is the number of modules that invoke i
• Graph based:
• Nodes + edges
• Modules + lines of control
• Depth of tree, arc to node ratio
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Coupling
• Data and control flow
• di – input data parameters
• ci input control parameters
• do output data parameters
• co output control parameters
• Global
• gd global variables for data
• gc global variables for control
• Environmental
• w fan in
• r fan out
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Metrics for Coupling
•Mc = k/m, k=1
•m = di + aci + do + bco + gd + cgc + w + r
•a, b, c, k can be adjusted based on actual data
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Component Level Metrics
• Cohesion (internal interaction) - a function of data objects
• Coupling (external interaction) - a function of input and output parameters,
global variables, and modules called
• Complexity of program flow - hundreds have been proposed (e.g.,
cyclomatic complexity)
• Cohesion – difficult to measure
• Bieman ’94,TSE 20(8)
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Using Metrics
• The Process
• Select appropriate metrics for problem
• Utilized metrics on problem
• Assessment and feedback
• Formulate
• Collect
• Analysis
• Interpretation
• Feedback
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Metrics for the Object Oriented
• Chidamber & Kemerer ’94TSE 20(6)
• Metrics specifically designed to address object oriented software
• Class oriented metrics
• Direct measures
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Weighted Methods per Class
WMC =
• ci is the complexity (e.g., volume, cyclomatic complexity,
etc.) of each method
• Viewpoints: (of Chidamber and Kemerer)
-The number of methods and complexity of methods is an indicator of how much
time and effort is required to develop and maintain the object
-The larger the number of methods in an object, the greater the potential impact on
the children
-Objects with large number of methods are likely to be more application specific,
limiting the possible reuse

n
i
i
c
1
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Depth of InheritanceTree
• DIT is the maximum length from a node to the root (base class)
• Viewpoints:
• Lower level subclasses inherit a number of methods making behavior harder to predict
• Deeper trees indicate greater design complexity
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Number of Children
• NOC is the number of subclasses immediately subordinate to a
class
• Viewpoints:
• As NOC grows, reuse increases - but the abstraction may be diluted
• Depth is generally better than breadth in class hierarchy, since it
promotes reuse of methods through inheritance
• Classes higher up in the hierarchy should have more sub-classes then
those lower down
• NOC gives an idea of the potential influence a class has on the design:
classes with large number of children may require more testing
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Coupling between Classes
• CBO is the number of collaborations between two classes (fan-out of a
class C)
• the number of other classes that are referenced in the class C (a reference to
another class,A, is an reference to a method or a data member of classA)
• Viewpoints:
• As collaboration increases reuse decreases
• High fan-outs represent class coupling to other classes/objects and thus are
undesirable
• High fan-ins represent good object designs and high level of reuse
• Not possible to maintain high fan-in and low fan outs across the entire system
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Response for a Class
• RFC is the number of methods that could be called in response to
a message to a class (local + remote)
• Viewpoints: As RFC increases
• testing effort increases
• greater the complexity of the object
• harder it is to understand
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Lack of Cohesion in Methods
• LCOM – poorly described in [Pressman, 2010]
• Class Ck with n methods M1,…Mn
• Ij is the set of instance variables used by Mj
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
LCOM
• There are n such sets I1 ,…, In
• P = {(Ii, Ij) | (Ii  Ij ) = }
• Q = {(Ii, Ij) | (Ii  Ij )  }
• If all n sets Ii are  then P = 
• LCOM = |P| - |Q|, if |P| > |Q|
• LCOM = 0 otherwise
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Example LCOM
• Take class C with M1, M2, M3
• I1 = {a, b, c, d, e}
• I2 = {a, b, e}
• I3 = {x, y, z}
• P = {(I1, I3), (I2, I3)}
• Q = {(I1, I2)}
• Thus LCOM = 1
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Explanation
• LCOM is the number of empty intersections minus the number of non-
empty intersections
• This is a notion of degree of similarity of methods
• If two methods use common instance variables then they are similar
• LCOM of zero is not maximally cohesive
• |P| = |Q| or |P| < |Q|
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Some other cohesion metrics
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Class Size
• CS
• Total number of operations (inherited, private, public)
• Number of attributes (inherited, private, public)
• May be an indication of too much responsibility for a class
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Number of Operations Overridden
• NOO
• A large number for NOO indicates possible problems with the design
• Poor abstraction in inheritance hierarchy
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Number of Operations Added
• NOA
• The number of operations added by a subclass
• As operations are added it is farther away from super class
• As depth increases NOA should decrease
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Method Inheritance Factor
MIF = .
• Mi(Ci) is the number of methods inherited and not overridden in Ci
• Ma(Ci) is the number of methods that can be invoked with Ci
• Md(Ci) is the number of methods declared in Ci




n
i
ia
n
i
ii
CM
CM
1
1
)(
)(
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
MIF
• Ma(Ci) = Md(Ci) + Mi(Ci)
• All that can be invoked = new or overloaded + things inherited
• MIF is [0,1]
• MIF near 1 means little specialization
• MIF near 0 means large change
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Coupling Factor
CF= .
• is_client(x,y) = 1 iff a relationship exists between the client class
and the server class. 0 otherwise
• (TC2-TC) is the total number of relationships possible
• CF is [0,1] with 1 meaning high coupling
)(
),(_
2
TCTC
CCclientisi j ji


CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Polymorphism Factor
PF = .
• Mn() is the number of new methods
• Mo() is the number of overriding methods
• DC() number of descendent classes of a base class
• The number of methods that redefines inherited methods, divided by
maximum number of possible distinct polymorphic situations
 

i iin
i io
CDCCM
CM
)()(
)(
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Operational Oriented Metrics
• Average operation size (LOC, volume)
• Number of messages sent by an operator
• Operation complexity – cyclomatic
• Average number of parameters/operation
• Larger the number the more complex the collaboration
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Encapsulation
• Lack of cohesion
• Percent public and protected
• Public access to data members
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Inheritance
• Number of root classes
• Fan in – multiple inheritance
• NOC, DIT, etc.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Metric tools
• McCabe & Associates ( founded byTom McCabe, Sr.)
• TheVisual QualityToolSet
• TheVisualTestingToolSet
• TheVisual ReengineeringToolSet
• Metrics calculated
• McCabe Cyclomatic Complexity
• McCabe EssentialComplexity
• Module DesignComplexity
• IntegrationComplexity
• Lines of Code
• Halstead
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
CCCC
• A metric analyser C, C++, Java, Ada-83, and Ada-95 (byTim Littlefair
of Edith Cowan University, Australia)
• Metrics calculated
• Lines Of Code (LOC)
• McCabe’s cyclomatic complexity
• C&K suite (WMC, NOC, DIT, CBO)
• Generates HTML and XML reports
• freely available at http://cccc.sourceforge.net/
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Jmetric
• OO metric calculation tool for Java code (by Cain andVasa for a
project at COTAR, Australia)
• Requires Java 1.2 (or JDK 1.1.6 with special extensions)
• Metrics
• Lines Of Code per class (LOC)
• Cyclomatic complexity
• LCOM (by Henderson-Seller)
• Availability
• is distributed under GPL
• http://www.it.swin.edu.au/projects/jmetric/products/jmetric/
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
JMetric tool result
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
GEN++
(University ofCalifornia, Davis and Bell Laboratories)
• GEN++ is an application-generator for creating code analyzers for
C++ programs
• simplifies the task of creating analysis tools for the C++
• several tools have been created with GEN++, and come with the package
• these can both be used directly, and as a springboard for other applications
• Freely available
• http://www.cs.ucdavis.edu/~devanbu/genp/down-red.html
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
More tools on Internet
• A Source of Information for Mission Critical Software Systems,
Management Processes, and Strategies
http://www.niwotridge.com/Resources/PM-SWEResources/SWTools.htm
• Defense Software Collaborators (by DACS)
http://www.thedacs.com/databases/url/key.hts?keycode=3
http://www.qucis.queensu.ca/Software-
Engineering/toolcat.html#label208
• Object-oriented metrics http://me.in-berlin.de/~socrates/oo_metrics.html
• Software Metrics Sites on the Web (Thomas Fetcke)
• Metrics tools for C/C++ (Christofer Lott) http://www.chris-
lott.org/resources/cmetrics/
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Software Cost Estimation
• Two techniques:
• Experience-based techniques.The estimate of future effort requirements is based on
the manager’s experience of past projects and the application domain.
• Algorithmic cost modeling. In this approach, a formulaic approach is used to compute
the project effort based on estimates of product attributes, such as size, and process
characteristics, such as experience of staff involved
• If the initial estimate of effort required is x months of effort, they found that
the range may be from 0.25x to 4x of the actual effort as measured when
the system was delivered [Boehm et al., 1995]
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Algorithmic Cost Modeling
• Uses a mathematical formula to predict project costs based on estimates of the
project size; the type of software being developed; and other team, process, and
product factors.
• Boehm et al. (2000):
• A is a constant factor which depends on local organizational practices and the type of
software that is developed.
• Size may be either an assessment of the code size of the software or a functionality
estimate expressed in function or application points.
• The value of exponent B usually lies between 1 and 1.5.
• M is a multiplier made by combining process, product, and development attributes, such as
the dependability requirements for the software and the experience of the development
team.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Effort = A * SizeB * M
Algorithmic Cost Modeling
The two problems:
• It is often difficult to estimate Size at an early stage in a project, when only
the specification is available. Function-point and application-point
estimates are easier to produce than estimates of code size but are still
often inaccurate.
• The estimates of the factors contributing to B and M are subjective.
Estimates vary from one person to another, depending on their background
and experience of the type of system that is being developed.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
COCOMO II Modeling
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
• COnstructive COst MOdel.
• COCOMO II was developed from earlier COCOMO cost estimation models,
which were largely based on original code development [Boehm, 1981;
Boehm and Royce, 1989]
• Have been proposed to help estimate the effort, schedule, and costs of a
software project.
• Well-documented and nonproprietary estimation model.
• Support spiral model and more modern approaches to software
development, such as rapid development using dynamic languages,
• Development by component composition, and use of database
programming
COCOMO II Modeling
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
COCOMO II Modeling
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
• An application-composition model.This models the effort required to
develop systems that are created from reusable components, scripting, or
database programming.
• An early design model.This model is used during early stages of the system
design after the requirements have been established, but design has not yet
started.
• A reuse model.This model is used to compute the effort required to
integrate reusable components and/or automatically generated program
code.
• A post-architecture model. Once the system architecture has been
designed, a more accurate estimate of the software size can be made.
Application composition model
• Supports prototyping projects and projects where there is extensive reuse.
• Based on standard estimates of developer productivity in application
(object) points/month.
• Takes CASE tool use into account.
• Formula is
• PM = ( NAP  (1 - %reuse/100 ) ) / PROD
• PM is the effort in person-months, NAP is the number of application points and
PROD is the productivity.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Application-point productivity
Developer’s
experience and
capability
Very low Low Nominal High Very high
ICASE maturity
and capability
Very low Low Nominal High Very high
PROD
(NAP/month)
4 7 13 25 50
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Early design model
• Estimates can be made after the requirements have been agreed.
• Based on a standard formula for algorithmic models
• PM = A  SizeB  M where
• M = PERS  RCPX  RUSE  PDIF  PREX  FCIL  SCED;
• A = 2.94 in initial calibration, Size in KLOC, B varies from 1.1 to 1.24 depending on
novelty of the project, development flexibility, risk management approaches and the
process maturity.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Multipliers
• Multipliers reflect the capability of the developers, the non-functional
requirements, the familiarity with the development platform, etc.
• RCPX - product reliability and complexity;
• RUSE - the reuse required;
• PDIF - platform difficulty;
• PREX - personnel experience;
• PERS - personnel capability;
• SCED - required schedule;
• FCIL - the team support facilities.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
The reuse model
• Takes into account black-box code that is reused without change and code
that has to be adapted to integrate it with new code.
• There are two versions:
• Black-box reuse where code is not modified. An effort estimate (PM) is computed.
• White-box reuse where code is modified. A size estimate equivalent to the number of
lines of new source code is computed.This then adjusts the size estimate for new code.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Reuse model estimates 1
• For generated code:
• PM = (ASLOC * AT/100)/ATPROD
• ASLOC is the number of lines of generated code
• AT is the percentage of code automatically generated.
• ATPROD is the productivity of engineers in integrating this code.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Reuse model estimates 2
• When code has to be understood and integrated:
• ESLOC = ASLOC * (1-AT/100) * AAM.
• ASLOC andAT as before.
• AAM is the adaptation adjustment multiplier computed from the costs of changing the
reused code, the costs of understanding how to integrate the code and the costs of
reuse decision making.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Post-architecture level
• Uses the same formula as the early design model but with 17 rather than 7
associated multipliers.
• The code size is estimated as:
• Number of lines of new code to be developed;
• Estimate of equivalent number of lines of new code computed using the reuse model;
• An estimate of the number of lines of code that have to be modified according to
requirements changes.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
• This depends on 5 scale factors (see next slide).Their sum/100 is added to
1.01
• A company takes on a project in a new domain.The client has not defined
the process to be used and has not allowed time for risk analysis.The
company has a CMM level 2 rating.
• Precedenteness - new project (4)
• Development flexibility - no client involvement -Very high (1)
• Architecture/risk resolution - No risk analysis -V. Low .(5)
• Team cohesion - new team - nominal (3)
• Process maturity - some control - nominal (3)
• Scale factor is therefore 1.17.
The exponent term
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Scale factors used in the exponent
computation in the post-architecture model
Scale factor Explanation
Precedentedness Reflects the previous experience of the organization with this type of project. Very low
means no previous experience; extra-high means that the organization is completely
familiar with this application domain.
Development flexibility Reflects the degree of flexibility in the development process. Very low means a
prescribed process is used; extra-high means that the client sets only general goals.
Architecture/risk resolution Reflects the extent of risk analysis carried out. Very low means little analysis; extra-
high means a complete and thorough risk analysis.
Team cohesion Reflects how well the development team knows each other and work together. Very
low means very difficult interactions; extra-high means an integrated and effective
team with no communication problems.
Process maturity Reflects the process maturity of the organization. The computation of this value
depends on the CMM Maturity Questionnaire, but an estimate can be achieved by
subtracting the CMM process maturity level from 5.
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
• Product attributes
• Concerned with required characteristics of the software product being developed.
• Computer attributes
• Constraints imposed on the software by the hardware platform.
• Personnel attributes
• Multipliers that take the experience and capabilities of the people working on the
project into account.
• Project attributes
• Concerned with the particular characteristics of the software development project.
Multipliers
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
The effect of cost drivers on effort estimates
Exponent value 1.17
System size (including factors for reuse and
requirements volatility)
128,000 DSI
Initial COCOMO estimate without cost drivers 730 person-months
Reliability Very high, multiplier = 1.39
Complexity Very high, multiplier = 1.3
Memory constraint High, multiplier = 1.21
Tool use Low, multiplier = 1.12
Schedule Accelerated, multiplier = 1.29
Adjusted COCOMO estimate 2,306 person-months
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
The effect of cost drivers on effort estimates
Exponent value 1.17
Reliability Very low, multiplier = 0.75
Complexity Very low, multiplier = 0.75
Memory constraint None, multiplier = 1
Tool use Very high, multiplier = 0.72
Schedule Normal, multiplier = 1
Adjusted COCOMO estimate 295 person-months
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
References
• Roger S. Pressman, 2010, Software Engineering: A Practitioner’s Approach
7th edition, McGraw-Hill.
• Ian Sommerville, 2011, Software Engineering 9th edition, Addison-Wesley.
• Boehm, B. 2000. “COCOMO II Model Definition Manual”. Center for
Software Engineering, University of Southern California.
http://csse.usc.edu/csse/research/COCOMOII/cocomo2000.0/CII_modelman
2000.0.pdf.
• Other references
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
Thanks
• Achmad Solichin, S.Kom, M.T.I
• achmatim@gmail.com
• Twitter: @achmatim
• Facebook: facebook.com/achmatim
• Web: http://achmatim.net
CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur

More Related Content

What's hot

4.software management
4.software management4.software management
4.software management
Deepak Sharma
 
Beit 381 se lec 5, 6, 7 & 8 - 69 - 12 feb21,22,28,29 - sw process 1-3 sdlc m...
Beit 381 se lec 5, 6, 7 & 8 - 69 - 12 feb21,22,28,29  - sw process 1-3 sdlc m...Beit 381 se lec 5, 6, 7 & 8 - 69 - 12 feb21,22,28,29  - sw process 1-3 sdlc m...
Beit 381 se lec 5, 6, 7 & 8 - 69 - 12 feb21,22,28,29 - sw process 1-3 sdlc m...
babak danyal
 

What's hot (20)

software metrics(process,project,product)
software metrics(process,project,product)software metrics(process,project,product)
software metrics(process,project,product)
 
Software System Engineering - Chapter 2
Software System Engineering - Chapter 2Software System Engineering - Chapter 2
Software System Engineering - Chapter 2
 
SECh123
SECh123SECh123
SECh123
 
Software product quality
Software product qualitySoftware product quality
Software product quality
 
Software Engineering (Testing Overview)
Software Engineering (Testing Overview)Software Engineering (Testing Overview)
Software Engineering (Testing Overview)
 
Software Engineering (Introduction)
Software Engineering (Introduction)Software Engineering (Introduction)
Software Engineering (Introduction)
 
Process and Project Metrics-1
Process and Project Metrics-1Process and Project Metrics-1
Process and Project Metrics-1
 
Software Engineering by Pankaj Jalote
Software Engineering by Pankaj JaloteSoftware Engineering by Pankaj Jalote
Software Engineering by Pankaj Jalote
 
4.software management
4.software management4.software management
4.software management
 
Beit 381 se lec 5, 6, 7 & 8 - 69 - 12 feb21,22,28,29 - sw process 1-3 sdlc m...
Beit 381 se lec 5, 6, 7 & 8 - 69 - 12 feb21,22,28,29  - sw process 1-3 sdlc m...Beit 381 se lec 5, 6, 7 & 8 - 69 - 12 feb21,22,28,29  - sw process 1-3 sdlc m...
Beit 381 se lec 5, 6, 7 & 8 - 69 - 12 feb21,22,28,29 - sw process 1-3 sdlc m...
 
Software quality management standards
Software quality management standardsSoftware quality management standards
Software quality management standards
 
Software Engineering (An Agile View of Process)
Software Engineering (An Agile View of Process)Software Engineering (An Agile View of Process)
Software Engineering (An Agile View of Process)
 
Software Reliability
Software ReliabilitySoftware Reliability
Software Reliability
 
INTRODUCTION TO SOFTWARE ENGINEERING
INTRODUCTION TO SOFTWARE ENGINEERINGINTRODUCTION TO SOFTWARE ENGINEERING
INTRODUCTION TO SOFTWARE ENGINEERING
 
Software Quality Metrics
Software Quality MetricsSoftware Quality Metrics
Software Quality Metrics
 
Software Engineering (Requirements Engineering & Software Maintenance)
Software Engineering (Requirements Engineering  & Software Maintenance)Software Engineering (Requirements Engineering  & Software Maintenance)
Software Engineering (Requirements Engineering & Software Maintenance)
 
Intoduction to software engineering part 2
Intoduction to software engineering part 2Intoduction to software engineering part 2
Intoduction to software engineering part 2
 
Phased life cycle model
Phased life cycle modelPhased life cycle model
Phased life cycle model
 
Software Engineering (Project Planning & Estimation)
Software Engineering (Project Planning &  Estimation)Software Engineering (Project Planning &  Estimation)
Software Engineering (Project Planning & Estimation)
 
Software Engineering (Project Management )
Software Engineering (Project  Management )Software Engineering (Project  Management )
Software Engineering (Project Management )
 

Viewers also liked (14)

Mapa mental planning the project (hallows)
Mapa mental planning the project (hallows)Mapa mental planning the project (hallows)
Mapa mental planning the project (hallows)
 
Modul rekayasa-perangkat-lunak
Modul rekayasa-perangkat-lunakModul rekayasa-perangkat-lunak
Modul rekayasa-perangkat-lunak
 
REKAYASA PERANGKAT LUNAK
REKAYASA PERANGKAT LUNAKREKAYASA PERANGKAT LUNAK
REKAYASA PERANGKAT LUNAK
 
Konsep Rekayasa Perangakat Lunak
Konsep Rekayasa Perangakat LunakKonsep Rekayasa Perangakat Lunak
Konsep Rekayasa Perangakat Lunak
 
Modul rekayasa-perangkat-lunak-lunak-ver-1
Modul rekayasa-perangkat-lunak-lunak-ver-1Modul rekayasa-perangkat-lunak-lunak-ver-1
Modul rekayasa-perangkat-lunak-lunak-ver-1
 
Cohesion & Coupling
Cohesion & Coupling Cohesion & Coupling
Cohesion & Coupling
 
Object Oriented Software Engineering
Object Oriented Software EngineeringObject Oriented Software Engineering
Object Oriented Software Engineering
 
COCOMO MODEL
COCOMO MODELCOCOMO MODEL
COCOMO MODEL
 
Project manager roles responsibilities
Project manager roles responsibilitiesProject manager roles responsibilities
Project manager roles responsibilities
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Project Planning in Software Engineering
Project Planning in Software EngineeringProject Planning in Software Engineering
Project Planning in Software Engineering
 
Roles and-responsibilities-project manager
Roles and-responsibilities-project managerRoles and-responsibilities-project manager
Roles and-responsibilities-project manager
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 

Similar to Lecture 04 Software Metrics and Estimation

05softwarequalitymanagement-150802165244-lva1-app6891.pdf
05softwarequalitymanagement-150802165244-lva1-app6891.pdf05softwarequalitymanagement-150802165244-lva1-app6891.pdf
05softwarequalitymanagement-150802165244-lva1-app6891.pdf
Samar954063
 
05softwarequalitymanagement-150802165244-lva1-app6891 (2).pdf
05softwarequalitymanagement-150802165244-lva1-app6891 (2).pdf05softwarequalitymanagement-150802165244-lva1-app6891 (2).pdf
05softwarequalitymanagement-150802165244-lva1-app6891 (2).pdf
Samar954063
 
Machine Learning in Software Engineering
Machine Learning in Software EngineeringMachine Learning in Software Engineering
Machine Learning in Software Engineering
Alaa Hamouda
 
Introduction-to-Software-Engineering.ppt
Introduction-to-Software-Engineering.pptIntroduction-to-Software-Engineering.ppt
Introduction-to-Software-Engineering.ppt
DrPreethiD1
 
Pertemuan 2-apbo-software-developmeng-processing
Pertemuan 2-apbo-software-developmeng-processingPertemuan 2-apbo-software-developmeng-processing
Pertemuan 2-apbo-software-developmeng-processing
Abi Bobon
 
Software requirement verification & validation
Software requirement verification & validationSoftware requirement verification & validation
Software requirement verification & validation
Abdul Basit
 

Similar to Lecture 04 Software Metrics and Estimation (20)

05softwarequalitymanagement-150802165244-lva1-app6891.pdf
05softwarequalitymanagement-150802165244-lva1-app6891.pdf05softwarequalitymanagement-150802165244-lva1-app6891.pdf
05softwarequalitymanagement-150802165244-lva1-app6891.pdf
 
Lecture 05 Software Quality Management
Lecture 05 Software Quality ManagementLecture 05 Software Quality Management
Lecture 05 Software Quality Management
 
05softwarequalitymanagement-150802165244-lva1-app6891 (2).pdf
05softwarequalitymanagement-150802165244-lva1-app6891 (2).pdf05softwarequalitymanagement-150802165244-lva1-app6891 (2).pdf
05softwarequalitymanagement-150802165244-lva1-app6891 (2).pdf
 
Lecture 02 Software Process Model
Lecture 02 Software Process ModelLecture 02 Software Process Model
Lecture 02 Software Process Model
 
Managing software project, software engineering
Managing software project, software engineeringManaging software project, software engineering
Managing software project, software engineering
 
Project Matrix and Measuring S/W
Project Matrix and Measuring S/WProject Matrix and Measuring S/W
Project Matrix and Measuring S/W
 
Algorithmic Software Cost Modeling
Algorithmic Software Cost ModelingAlgorithmic Software Cost Modeling
Algorithmic Software Cost Modeling
 
Machine Learning in Software Engineering
Machine Learning in Software EngineeringMachine Learning in Software Engineering
Machine Learning in Software Engineering
 
Se 381 - lec 25 - 32 - 12 may29 - program size and cost estimation models
Se 381 - lec 25 - 32 - 12 may29 - program size and cost estimation modelsSe 381 - lec 25 - 32 - 12 may29 - program size and cost estimation models
Se 381 - lec 25 - 32 - 12 may29 - program size and cost estimation models
 
Software engineering 11 software quality assurance plans
Software engineering 11 software quality assurance plansSoftware engineering 11 software quality assurance plans
Software engineering 11 software quality assurance plans
 
Software Engineering (Project Scheduling)
Software Engineering (Project Scheduling)Software Engineering (Project Scheduling)
Software Engineering (Project Scheduling)
 
Introduction-to-Software-Engineering.ppt
Introduction-to-Software-Engineering.pptIntroduction-to-Software-Engineering.ppt
Introduction-to-Software-Engineering.ppt
 
Introduction-to-Software-Engineering (1).ppt
Introduction-to-Software-Engineering (1).pptIntroduction-to-Software-Engineering (1).ppt
Introduction-to-Software-Engineering (1).ppt
 
Introduction to Software Engineering ppt
Introduction to Software Engineering pptIntroduction to Software Engineering ppt
Introduction to Software Engineering ppt
 
Introduction-to-Software-Engineering (1).ppt
Introduction-to-Software-Engineering (1).pptIntroduction-to-Software-Engineering (1).ppt
Introduction-to-Software-Engineering (1).ppt
 
Introduction-to-Software-Engineering.ppt
Introduction-to-Software-Engineering.pptIntroduction-to-Software-Engineering.ppt
Introduction-to-Software-Engineering.ppt
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
 
Presentation No.1
Presentation No.1Presentation No.1
Presentation No.1
 
Pertemuan 2-apbo-software-developmeng-processing
Pertemuan 2-apbo-software-developmeng-processingPertemuan 2-apbo-software-developmeng-processing
Pertemuan 2-apbo-software-developmeng-processing
 
Software requirement verification & validation
Software requirement verification & validationSoftware requirement verification & validation
Software requirement verification & validation
 

More from Achmad Solichin

More from Achmad Solichin (20)

Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
 
Materi Webinar Web 3.0 (16 Juli 2022)
Materi Webinar Web 3.0 (16 Juli 2022)Materi Webinar Web 3.0 (16 Juli 2022)
Materi Webinar Web 3.0 (16 Juli 2022)
 
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
 
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
 
Webinar PHP-ID: Machine Learning dengan PHP
Webinar PHP-ID: Machine Learning dengan PHPWebinar PHP-ID: Machine Learning dengan PHP
Webinar PHP-ID: Machine Learning dengan PHP
 
Webinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Webinar Data Mining dengan Rapidminer | Universitas Budi LuhurWebinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Webinar Data Mining dengan Rapidminer | Universitas Budi Luhur
 
TREN DAN IDE RISET BIDANG DATA MINING TERBARU
TREN DAN IDE RISET BIDANG DATA MINING TERBARUTREN DAN IDE RISET BIDANG DATA MINING TERBARU
TREN DAN IDE RISET BIDANG DATA MINING TERBARU
 
Metodologi Riset: Literature Review
Metodologi Riset: Literature ReviewMetodologi Riset: Literature Review
Metodologi Riset: Literature Review
 
Materi Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHPMateri Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHP
 
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan RadiasiPercobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
 
Metodologi Riset: Literature Review
Metodologi Riset: Literature ReviewMetodologi Riset: Literature Review
Metodologi Riset: Literature Review
 
Depth First Search (DFS) pada Graph
Depth First Search (DFS) pada GraphDepth First Search (DFS) pada Graph
Depth First Search (DFS) pada Graph
 
Breadth First Search (BFS) pada Graph
Breadth First Search (BFS) pada GraphBreadth First Search (BFS) pada Graph
Breadth First Search (BFS) pada Graph
 
Binary Search Tree (BST) - Algoritma dan Struktur Data
Binary Search Tree (BST) - Algoritma dan Struktur DataBinary Search Tree (BST) - Algoritma dan Struktur Data
Binary Search Tree (BST) - Algoritma dan Struktur Data
 
Computer Vision di Era Industri 4.0
Computer Vision di Era Industri 4.0Computer Vision di Era Industri 4.0
Computer Vision di Era Industri 4.0
 
Seminar: Become a Reliable Web Programmer
Seminar: Become a Reliable Web ProgrammerSeminar: Become a Reliable Web Programmer
Seminar: Become a Reliable Web Programmer
 
The Big 5: Future IT Trends
The Big 5: Future IT TrendsThe Big 5: Future IT Trends
The Big 5: Future IT Trends
 
Modern PHP Developer
Modern PHP DeveloperModern PHP Developer
Modern PHP Developer
 
Seminar: PHP Developer for Dummies
Seminar: PHP Developer for DummiesSeminar: PHP Developer for Dummies
Seminar: PHP Developer for Dummies
 
Pertemuan 1 - Algoritma dan Struktur Data 1
Pertemuan 1 - Algoritma dan Struktur Data 1Pertemuan 1 - Algoritma dan Struktur Data 1
Pertemuan 1 - Algoritma dan Struktur Data 1
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

Lecture 04 Software Metrics and Estimation

  • 1. Software Metrics and Estimation Matakuliah Rekayasa Perangkat Lunak (CS215) – Gasal 2015/2016 Magister Ilmu Komputer - Universitas Budi Luhur Achmad Solichin, S.Kom, M.T.I (achmatim@gmail.com) CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 2. Overview • Measure vs. Metrics • Measure and Metric EstimationTechniques • Metric EstimationTools • Software Cost Estimation • COCOMO Model CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 3. Measure vs. Metrics • quantitative indication of extent, amount, dimension, capacity, or size of some attribute of a product or process. • Ex: Number of errors Measure • quantitative measure of degree to which a system, component or process possesses a given attribute. “A handle or guess about a given attribute.” • Ex: Number of errors found per person hours expended Metric CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 4. Why Measure Software? • Determine the quality of the current product or process • Predict qualities of a product or process • Improve quality of a product or process CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 5. Motivation for Metrics • Estimate the cost & schedule of future projects • Evaluate the productivity impacts of new tools and techniques • Establish productivity trends over time • Improve software quality • Forecast future staffing needs • Anticipate and reduce future maintenance needs CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 6. Example Metrics • Defect rates • Error rates • Measured by: • individual • module • during development • Errors should be categorized by origin, type, cost CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 7. Metric Classification Products • Explicit results of software development activities • Deliverables, documentation, by products Processes • Activities related to production of software Resources • Inputs into the software development activities • hardware, knowledge, people CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 8. Product vs. Process Process Metrics • Insights of process paradigm, software engineering tasks, work product, or milestones • Lead to long term process improvement Product Metrics • Assesses the state of the project • Track potential risks • Uncover problem areas • Adjust workflow or tasks • Evaluate teams ability to control quality CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 9. Types of Measures Direct Measures (internal attributes) • Cost • Effort • LOC • Speed • Memory Indirect Measures (external attributes) • Functionality • Quality • Complexity • Efficiency • Reliability • Maintainability CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 10. Size-Oriented Metrics • Size of the software produced • LOC - Lines Of Code • KLOC - 1000 Lines Of Code • SLOC – Statement Lines of Code (ignore whitespace) • Typical Measures: • Errors/KLOC, Defects/KLOC, Cost/LOC, Documentation Pages/KLOC CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 11. LOC Metrics • Easy to use • Easy to compute • Language & programmer dependent CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 12. Complexity Metrics • LOC - a function of complexity • Language and programmer dependent • Halstead’s Software Science (entropy measures) • n1 - number of distinct operators • n2 - number of distinct operands • N1 - total number of operators • N2 - total number of operands CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 13. Example if (k < 2) { if (k > 3) x = x*k; } • Distinct operators: if ( ) { } > < = * ; • Distinct operands: k 2 3 x • n1 = 10 • n2 = 4 • N1 = 13 • N2 = 7 CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 14. Halstead’s Metrics • Amenable to experimental verification [1970s] • Program length: N = N1 + N2 • Program vocabulary: n = n1 + n2 • Estimated length: N = n1 log2 n1 + n2 log2 n2 • Close estimate of length for well structured programs • Purity ratio: PR = N / N CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 15. Program Complexity • Volume:V = N log2 n • Number of bits to provide a unique designator for each of the n items in the program vocabulary. • Difficulty: 𝐷 = 𝑛1 2 ∗ 𝑁2 𝑛2 • Program effort: E = D*V • This is a good measure of program understandability CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 16. McCabe’s Complexity Measures • McCabe’s metrics are based on a control flow representation of the program. • A program graph is used to depict control flow. • Nodes represent processing tasks (one or more code statements) • Edges represent control flow between nodes CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 17. Flow Graph Notation Sequence If-then-else While Until CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 18. Cyclomatic Complexity • Set of independent paths through the graph (basis set) • V(G) = E – N + 2 • E is the number of flow graph edges • N is the number of nodes • V(G) = P + 1 • P is the number of predicate nodes CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 19. Example i = 0; while (i<n-1) do j = i + 1; while (j<n) do if A[i]<A[j] then swap(A[i], A[j]); end do; i=i+1; end do; 1 3 54 6 7 2 CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 20. ComputingV(G) • V(G) = E – N + 2 = 9 – 7 + 2 = 4 • V(G) = P + 1 = 3 + 1 = 4 • Basis Set • 1, 7 • 1, 2, 6, 1, 7 • 1, 2, 3, 4, 5, 2, 6, 1, 7 • 1, 2, 3, 5, 2, 6, 1, 7 CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 21. Another Example 1 6 7 4 5 8 3 9 2 What isV(G)? CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 22. Meaning • V(G) is the number of (enclosed) regions/areas of the planar graph • Number of regions increases with the number of decision paths and loops • A quantitative measure of testing difficulty and an indication of ultimate reliability • Experimental data shows value ofV(G) should be no more then 10 - testing is very difficulty above this value CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 23. McClure’s Complexity Metric • Complexity = C +V • C is the number of comparisons in a module • V is the number of control variables referenced in the module • decisional complexity • Similar to McCabe’s but with regard to control variables CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 24. Metrics and Software Quality FURPS • Functionality – features of system • Usability – aesthesis, documentation • Reliability – frequency of failure, security • Performance – speed, throughput • Supportability – maintainability CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 25. Measures of Software Quality • Correctness – degree to which a program operates according to specification • Defects/KLOC • Defect is a verified lack of conformance to requirements • Failures/hours of operation • Maintainability – degree to which a program is open to change • Mean time to change • Change request to new version (Analyze, design etc) • Cost to correct • Integrity - degree to which a program is resistant to outside attack • Fault tolerance, security & threats • Usability – easiness to use • Training time, skill level necessary to use, Increase in productivity, subjective questionnaire or controlled experiment CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 26. McCall’sTriangle of Quality CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 27. product operation revision transition reliability efficiency usability maintainability testability portability reusability Metrics Quality Model CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 28. High level Design Metrics • Structural Complexity • Data Complexity • System Complexity • Card & Glass ’80 • Structural Complexity S(i) of a module i. • S(i) = fout 2(i) • Fan out is the number of modules immediately subordinate (directly invoked). CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 29. Design Metrics • Data Complexity D(i) • D(i) = v(i)/[fout(i)+1] • v(i) is the number of inputs and outputs passed to and from i • System Complexity C(i) • C(i) = S(i) + D(i) • As each increases the overall complexity of the architecture increases CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 30. System Complexity Metric • Another metric: • length(i) * [fin(i) + fout(i)]2 • Length is LOC • Fan in is the number of modules that invoke i • Graph based: • Nodes + edges • Modules + lines of control • Depth of tree, arc to node ratio CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 31. Coupling • Data and control flow • di – input data parameters • ci input control parameters • do output data parameters • co output control parameters • Global • gd global variables for data • gc global variables for control • Environmental • w fan in • r fan out CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 32. Metrics for Coupling •Mc = k/m, k=1 •m = di + aci + do + bco + gd + cgc + w + r •a, b, c, k can be adjusted based on actual data CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 33. Component Level Metrics • Cohesion (internal interaction) - a function of data objects • Coupling (external interaction) - a function of input and output parameters, global variables, and modules called • Complexity of program flow - hundreds have been proposed (e.g., cyclomatic complexity) • Cohesion – difficult to measure • Bieman ’94,TSE 20(8) CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 34. Using Metrics • The Process • Select appropriate metrics for problem • Utilized metrics on problem • Assessment and feedback • Formulate • Collect • Analysis • Interpretation • Feedback CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 35. Metrics for the Object Oriented • Chidamber & Kemerer ’94TSE 20(6) • Metrics specifically designed to address object oriented software • Class oriented metrics • Direct measures CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 36. Weighted Methods per Class WMC = • ci is the complexity (e.g., volume, cyclomatic complexity, etc.) of each method • Viewpoints: (of Chidamber and Kemerer) -The number of methods and complexity of methods is an indicator of how much time and effort is required to develop and maintain the object -The larger the number of methods in an object, the greater the potential impact on the children -Objects with large number of methods are likely to be more application specific, limiting the possible reuse  n i i c 1 CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 37. Depth of InheritanceTree • DIT is the maximum length from a node to the root (base class) • Viewpoints: • Lower level subclasses inherit a number of methods making behavior harder to predict • Deeper trees indicate greater design complexity CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 38. Number of Children • NOC is the number of subclasses immediately subordinate to a class • Viewpoints: • As NOC grows, reuse increases - but the abstraction may be diluted • Depth is generally better than breadth in class hierarchy, since it promotes reuse of methods through inheritance • Classes higher up in the hierarchy should have more sub-classes then those lower down • NOC gives an idea of the potential influence a class has on the design: classes with large number of children may require more testing CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 39. Coupling between Classes • CBO is the number of collaborations between two classes (fan-out of a class C) • the number of other classes that are referenced in the class C (a reference to another class,A, is an reference to a method or a data member of classA) • Viewpoints: • As collaboration increases reuse decreases • High fan-outs represent class coupling to other classes/objects and thus are undesirable • High fan-ins represent good object designs and high level of reuse • Not possible to maintain high fan-in and low fan outs across the entire system CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 40. Response for a Class • RFC is the number of methods that could be called in response to a message to a class (local + remote) • Viewpoints: As RFC increases • testing effort increases • greater the complexity of the object • harder it is to understand CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 41. Lack of Cohesion in Methods • LCOM – poorly described in [Pressman, 2010] • Class Ck with n methods M1,…Mn • Ij is the set of instance variables used by Mj CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 42. LCOM • There are n such sets I1 ,…, In • P = {(Ii, Ij) | (Ii  Ij ) = } • Q = {(Ii, Ij) | (Ii  Ij )  } • If all n sets Ii are  then P =  • LCOM = |P| - |Q|, if |P| > |Q| • LCOM = 0 otherwise CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 43. Example LCOM • Take class C with M1, M2, M3 • I1 = {a, b, c, d, e} • I2 = {a, b, e} • I3 = {x, y, z} • P = {(I1, I3), (I2, I3)} • Q = {(I1, I2)} • Thus LCOM = 1 CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 44. Explanation • LCOM is the number of empty intersections minus the number of non- empty intersections • This is a notion of degree of similarity of methods • If two methods use common instance variables then they are similar • LCOM of zero is not maximally cohesive • |P| = |Q| or |P| < |Q| CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 45. Some other cohesion metrics CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 46. Class Size • CS • Total number of operations (inherited, private, public) • Number of attributes (inherited, private, public) • May be an indication of too much responsibility for a class CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 47. Number of Operations Overridden • NOO • A large number for NOO indicates possible problems with the design • Poor abstraction in inheritance hierarchy CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 48. Number of Operations Added • NOA • The number of operations added by a subclass • As operations are added it is farther away from super class • As depth increases NOA should decrease CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 49. Method Inheritance Factor MIF = . • Mi(Ci) is the number of methods inherited and not overridden in Ci • Ma(Ci) is the number of methods that can be invoked with Ci • Md(Ci) is the number of methods declared in Ci     n i ia n i ii CM CM 1 1 )( )( CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 50. MIF • Ma(Ci) = Md(Ci) + Mi(Ci) • All that can be invoked = new or overloaded + things inherited • MIF is [0,1] • MIF near 1 means little specialization • MIF near 0 means large change CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 51. Coupling Factor CF= . • is_client(x,y) = 1 iff a relationship exists between the client class and the server class. 0 otherwise • (TC2-TC) is the total number of relationships possible • CF is [0,1] with 1 meaning high coupling )( ),(_ 2 TCTC CCclientisi j ji   CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 52. Polymorphism Factor PF = . • Mn() is the number of new methods • Mo() is the number of overriding methods • DC() number of descendent classes of a base class • The number of methods that redefines inherited methods, divided by maximum number of possible distinct polymorphic situations    i iin i io CDCCM CM )()( )( CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 53. Operational Oriented Metrics • Average operation size (LOC, volume) • Number of messages sent by an operator • Operation complexity – cyclomatic • Average number of parameters/operation • Larger the number the more complex the collaboration CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 54. Encapsulation • Lack of cohesion • Percent public and protected • Public access to data members CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 55. Inheritance • Number of root classes • Fan in – multiple inheritance • NOC, DIT, etc. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 56. Metric tools • McCabe & Associates ( founded byTom McCabe, Sr.) • TheVisual QualityToolSet • TheVisualTestingToolSet • TheVisual ReengineeringToolSet • Metrics calculated • McCabe Cyclomatic Complexity • McCabe EssentialComplexity • Module DesignComplexity • IntegrationComplexity • Lines of Code • Halstead CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 57. CCCC • A metric analyser C, C++, Java, Ada-83, and Ada-95 (byTim Littlefair of Edith Cowan University, Australia) • Metrics calculated • Lines Of Code (LOC) • McCabe’s cyclomatic complexity • C&K suite (WMC, NOC, DIT, CBO) • Generates HTML and XML reports • freely available at http://cccc.sourceforge.net/ CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 58. Jmetric • OO metric calculation tool for Java code (by Cain andVasa for a project at COTAR, Australia) • Requires Java 1.2 (or JDK 1.1.6 with special extensions) • Metrics • Lines Of Code per class (LOC) • Cyclomatic complexity • LCOM (by Henderson-Seller) • Availability • is distributed under GPL • http://www.it.swin.edu.au/projects/jmetric/products/jmetric/ CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 59. JMetric tool result CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 60. GEN++ (University ofCalifornia, Davis and Bell Laboratories) • GEN++ is an application-generator for creating code analyzers for C++ programs • simplifies the task of creating analysis tools for the C++ • several tools have been created with GEN++, and come with the package • these can both be used directly, and as a springboard for other applications • Freely available • http://www.cs.ucdavis.edu/~devanbu/genp/down-red.html CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 61. More tools on Internet • A Source of Information for Mission Critical Software Systems, Management Processes, and Strategies http://www.niwotridge.com/Resources/PM-SWEResources/SWTools.htm • Defense Software Collaborators (by DACS) http://www.thedacs.com/databases/url/key.hts?keycode=3 http://www.qucis.queensu.ca/Software- Engineering/toolcat.html#label208 • Object-oriented metrics http://me.in-berlin.de/~socrates/oo_metrics.html • Software Metrics Sites on the Web (Thomas Fetcke) • Metrics tools for C/C++ (Christofer Lott) http://www.chris- lott.org/resources/cmetrics/ CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 62. Software Cost Estimation • Two techniques: • Experience-based techniques.The estimate of future effort requirements is based on the manager’s experience of past projects and the application domain. • Algorithmic cost modeling. In this approach, a formulaic approach is used to compute the project effort based on estimates of product attributes, such as size, and process characteristics, such as experience of staff involved • If the initial estimate of effort required is x months of effort, they found that the range may be from 0.25x to 4x of the actual effort as measured when the system was delivered [Boehm et al., 1995] CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 63. Algorithmic Cost Modeling • Uses a mathematical formula to predict project costs based on estimates of the project size; the type of software being developed; and other team, process, and product factors. • Boehm et al. (2000): • A is a constant factor which depends on local organizational practices and the type of software that is developed. • Size may be either an assessment of the code size of the software or a functionality estimate expressed in function or application points. • The value of exponent B usually lies between 1 and 1.5. • M is a multiplier made by combining process, product, and development attributes, such as the dependability requirements for the software and the experience of the development team. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur Effort = A * SizeB * M
  • 64. Algorithmic Cost Modeling The two problems: • It is often difficult to estimate Size at an early stage in a project, when only the specification is available. Function-point and application-point estimates are easier to produce than estimates of code size but are still often inaccurate. • The estimates of the factors contributing to B and M are subjective. Estimates vary from one person to another, depending on their background and experience of the type of system that is being developed. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 65. COCOMO II Modeling CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur • COnstructive COst MOdel. • COCOMO II was developed from earlier COCOMO cost estimation models, which were largely based on original code development [Boehm, 1981; Boehm and Royce, 1989] • Have been proposed to help estimate the effort, schedule, and costs of a software project. • Well-documented and nonproprietary estimation model. • Support spiral model and more modern approaches to software development, such as rapid development using dynamic languages, • Development by component composition, and use of database programming
  • 66. COCOMO II Modeling CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 67. COCOMO II Modeling CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur • An application-composition model.This models the effort required to develop systems that are created from reusable components, scripting, or database programming. • An early design model.This model is used during early stages of the system design after the requirements have been established, but design has not yet started. • A reuse model.This model is used to compute the effort required to integrate reusable components and/or automatically generated program code. • A post-architecture model. Once the system architecture has been designed, a more accurate estimate of the software size can be made.
  • 68. Application composition model • Supports prototyping projects and projects where there is extensive reuse. • Based on standard estimates of developer productivity in application (object) points/month. • Takes CASE tool use into account. • Formula is • PM = ( NAP  (1 - %reuse/100 ) ) / PROD • PM is the effort in person-months, NAP is the number of application points and PROD is the productivity. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 69. Application-point productivity Developer’s experience and capability Very low Low Nominal High Very high ICASE maturity and capability Very low Low Nominal High Very high PROD (NAP/month) 4 7 13 25 50 CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 70. Early design model • Estimates can be made after the requirements have been agreed. • Based on a standard formula for algorithmic models • PM = A  SizeB  M where • M = PERS  RCPX  RUSE  PDIF  PREX  FCIL  SCED; • A = 2.94 in initial calibration, Size in KLOC, B varies from 1.1 to 1.24 depending on novelty of the project, development flexibility, risk management approaches and the process maturity. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 71. Multipliers • Multipliers reflect the capability of the developers, the non-functional requirements, the familiarity with the development platform, etc. • RCPX - product reliability and complexity; • RUSE - the reuse required; • PDIF - platform difficulty; • PREX - personnel experience; • PERS - personnel capability; • SCED - required schedule; • FCIL - the team support facilities. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 72. The reuse model • Takes into account black-box code that is reused without change and code that has to be adapted to integrate it with new code. • There are two versions: • Black-box reuse where code is not modified. An effort estimate (PM) is computed. • White-box reuse where code is modified. A size estimate equivalent to the number of lines of new source code is computed.This then adjusts the size estimate for new code. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 73. Reuse model estimates 1 • For generated code: • PM = (ASLOC * AT/100)/ATPROD • ASLOC is the number of lines of generated code • AT is the percentage of code automatically generated. • ATPROD is the productivity of engineers in integrating this code. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 74. Reuse model estimates 2 • When code has to be understood and integrated: • ESLOC = ASLOC * (1-AT/100) * AAM. • ASLOC andAT as before. • AAM is the adaptation adjustment multiplier computed from the costs of changing the reused code, the costs of understanding how to integrate the code and the costs of reuse decision making. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 75. Post-architecture level • Uses the same formula as the early design model but with 17 rather than 7 associated multipliers. • The code size is estimated as: • Number of lines of new code to be developed; • Estimate of equivalent number of lines of new code computed using the reuse model; • An estimate of the number of lines of code that have to be modified according to requirements changes. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 76. • This depends on 5 scale factors (see next slide).Their sum/100 is added to 1.01 • A company takes on a project in a new domain.The client has not defined the process to be used and has not allowed time for risk analysis.The company has a CMM level 2 rating. • Precedenteness - new project (4) • Development flexibility - no client involvement -Very high (1) • Architecture/risk resolution - No risk analysis -V. Low .(5) • Team cohesion - new team - nominal (3) • Process maturity - some control - nominal (3) • Scale factor is therefore 1.17. The exponent term CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 77. Scale factors used in the exponent computation in the post-architecture model Scale factor Explanation Precedentedness Reflects the previous experience of the organization with this type of project. Very low means no previous experience; extra-high means that the organization is completely familiar with this application domain. Development flexibility Reflects the degree of flexibility in the development process. Very low means a prescribed process is used; extra-high means that the client sets only general goals. Architecture/risk resolution Reflects the extent of risk analysis carried out. Very low means little analysis; extra- high means a complete and thorough risk analysis. Team cohesion Reflects how well the development team knows each other and work together. Very low means very difficult interactions; extra-high means an integrated and effective team with no communication problems. Process maturity Reflects the process maturity of the organization. The computation of this value depends on the CMM Maturity Questionnaire, but an estimate can be achieved by subtracting the CMM process maturity level from 5. CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 78. • Product attributes • Concerned with required characteristics of the software product being developed. • Computer attributes • Constraints imposed on the software by the hardware platform. • Personnel attributes • Multipliers that take the experience and capabilities of the people working on the project into account. • Project attributes • Concerned with the particular characteristics of the software development project. Multipliers CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 79. The effect of cost drivers on effort estimates Exponent value 1.17 System size (including factors for reuse and requirements volatility) 128,000 DSI Initial COCOMO estimate without cost drivers 730 person-months Reliability Very high, multiplier = 1.39 Complexity Very high, multiplier = 1.3 Memory constraint High, multiplier = 1.21 Tool use Low, multiplier = 1.12 Schedule Accelerated, multiplier = 1.29 Adjusted COCOMO estimate 2,306 person-months CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 80. The effect of cost drivers on effort estimates Exponent value 1.17 Reliability Very low, multiplier = 0.75 Complexity Very low, multiplier = 0.75 Memory constraint None, multiplier = 1 Tool use Very high, multiplier = 0.72 Schedule Normal, multiplier = 1 Adjusted COCOMO estimate 295 person-months CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 81. References • Roger S. Pressman, 2010, Software Engineering: A Practitioner’s Approach 7th edition, McGraw-Hill. • Ian Sommerville, 2011, Software Engineering 9th edition, Addison-Wesley. • Boehm, B. 2000. “COCOMO II Model Definition Manual”. Center for Software Engineering, University of Southern California. http://csse.usc.edu/csse/research/COCOMOII/cocomo2000.0/CII_modelman 2000.0.pdf. • Other references CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur
  • 82. Thanks • Achmad Solichin, S.Kom, M.T.I • achmatim@gmail.com • Twitter: @achmatim • Facebook: facebook.com/achmatim • Web: http://achmatim.net CS215 – Rekayasa Perangkat Lunak – Magister Ilmu Komputer Universitas Budi Luhur