Software Metric capture notions of size and complexity.

Slides:



Advertisements
Similar presentations
Early Effort Estimation of Business Data-processing Enhancements CS 689 November 30, 2000 By Kurt Detamore.
Advertisements

Project Estimation: Metrics and Measurement
Metrics. A Good Manager Measures measurement What do we use as a basis? size? size? function? function? project metrics process metrics process product.
Metrics for Process and Projects
Software Metrics.
Metrics Project and Process Metrics. Why do we measure? Assessing project status Allows us to track risks Before they go critical Adjust workflow See.
Software Engineering II - Topic: Software Process Metrics and Project Metrics Instructor: Dr. Jerry Gao San Jose State University
R&D SDM 1 Metrics How to measure and assess software engineering? 2009 Theo Schouten.
Software project management (intro)
Project Management Metrics.
SOFTWARE PROJECT MANAGEMENT AND COST ESTIMATION © University of LiverpoolCOMP 319slide 1.
1 Cost Estimation CIS 375 Bruce R. Maxim UM-Dearborn.
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 1 Lecture 22: Software Measurement Basics of software measurement.
Cmpe 589 Spring Software Quality Metrics Product  product attributes –Size, complexity, design features, performance, quality level Process  Used.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 22 Instructor Paulo Alencar.
COCOMO Models Ognian Kabranov SEG3300 A&B W2004 R.L. Probert.
Estimation Why estimate? What to estimate? When to estimate?
Software Estimation and Function Point Analysis Presented by Craig Myers MBA 731 November 12, 2007.
Chapter 6 : Software Metrics
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 26 Slide 1 Software cost estimation 1.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 23Slide 1 Chapter 23 Software Cost Estimation.
Function Point Analysis What is Function Point Analysis (FPA)? It is designed to estimate and measure the time, and thereby the cost, of developing new.
Software cost estimation Predicting the resources required for a software development process 1.
Product Metrics An overview. What are metrics? “ A quantitative measure of the degree to which a system, component, or process possesses a given attribute.”
Software Metrics Software Engineering.
Software Engineering SM ? 1. Outline of this presentation What is SM The Need for SM Type of SM Size Oriented Metric Function Oriented Metric 218/10/2015.
1 Estimation Function Point Analysis December 5, 2006.
Software Project Management Lecture # 3. Outline Chapter 22- “Metrics for Process & Projects”  Measurement  Measures  Metrics  Software Metrics Process.
Lecture 4 Software Metrics
10/27/20151Ian Sommerville.  Fundamentals of software measurement, costing and pricing  Software productivity assessment  The principles of the COCOMO.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 3 1 Software Size Estimation I Material adapted from: Disciplined.
Cost Estimation. Problem Our ability to realistically plan and schedule projects depends on our ability to estimate project costs and development efforts.
Project Planning and Estimation
Quality Software Project Management Software Size and Reuse Estimating.
Disciplined Software Engineering Lecture #3 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department.
Function Point Analysis. Function Points Analysis (FPA) What is Function Point Analysis (FPA)? Function points are a standard unit of measure that represent.
SEG3300 A&B W2004R.L. Probert1 COCOMO Models Ognian Kabranov.
Introduction to Software Project Estimation I (Condensed) Barry Schrag Software Engineering Consultant MCSD, MCAD, MCDBA Bellevue.
©Ian Sommerville 2000Software Engineering, 7th edition. Chapter 26Slide 1 Software cost estimation l Predicting the resources required for a software development.
Software cost estimation. Fundamental estimation questions How much effort is required to complete an activity? How much calendar time is needed to complete.
Estimating “Size” of Software There are many ways to estimate the volume or size of software. ( understanding requirements is key to this activity ) –We.
Effort Estimation In WBS,one can estimate effort (micro-level) but needed to know: –Size of the deliverable –Productivity of resource in producing that.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 15a: Product Metrics for Software Software Engineering: A Practitioner’s Approach, 6/e Chapter.
540f07cost12oct41 Reviews Postmortem u Surprises? u Use white background on slides u Do not zip files on CD u Team leader should introduce team members.
Personal Estimation with PROBE CS3300 Fall Process Everybody has one !!! Formal – Completely defined and documented Informal – Just the way things.
Advanced Software Engineering Lecture 4: Process & Project Metrics.
FUNCTION POINT ANALYSIS & ESTIMATION
Intro to Estimating Part Art, Part Science. Importance of Good Estimates Time (Realistic Deadlines) most software projects are late because the time was.
Software Project Management Lecture # 3. Outline Metrics for Process and Projects  Introduction  Software Metrics Process metrics Project metrics Direct.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Software Engineering, COMP201 Slide 1 Software Engineering CSE470.
Cost9b 1 Living with Function Points Bernstein and Lubashevsky Text pp
Software Engineering, COMP201 Slide 1 Software Engineering CSE470.
Cost23 1 Question of the Day u Which of the following things measure the “size” of the project in terms of the functionality that has to be provided in.
Software Metrics 1.
RET Rules One of the following rules applies when counting RETs:
Why Do We Measure? assess the status of an ongoing project
Function Point Analysis
Lecture 17 Software Metrics
Function Point.
Software Metrics “How do we measure the software?”
Activities During SPP Size Estimation
More on Estimation In general, effort estimation is based on several parameters and the model ( E= a + b*S**c ): Personnel Environment Quality Size or.
Why Do We Measure? assess the status of an ongoing project
COCOMO Models.
Software metrics.
Why Do We Measure? assess the status of an ongoing project
Why Do We Measure? assess the status of an ongoing project
COCOMO MODEL.
Presentation transcript:

Software Metric capture notions of size and complexity

Size metrics Ideally, we want to define a set of attributes for software size analogous to human height and weight. That is, we want them to be fundamental so that each attribute captures a key aspect of software size – Length (LOC) – Functionality – Complexity

LOC The most commonly used size indicator. Issues: – How to define LOC? – How to know LOC before any coding? – How to interpret LOC? (is 250 more productive than 200?) What about different programming languages?

Lines of Code Calculation What can be consideredas a line? statement data definition comments? Line ≠ debug code? Different languages? Assembly and Java Scaling factor

Beta Distribution Measurement Ask developers for the following LOC values: Optimistic (O) Pessimistic (P) Realistic (R) LOC = (O+P+4*R)/6 E.g., R=250, O=200, P=400 => LOC=266

The Blitz Based on historical observation of previous projects. LOC = Processes x prgs/processes x avg. prg size Process = class, db table, … E.g., 20 classes, 1 program/class, 50 Java LOC/prg => LOC = 20*1*50 = 1000

Functionality Many software engineers argue that length is misleading and that the amount of functionality in an inherent product paints a better picture of product size In particular, those who generate effort and duration estimates from early development often prefer to estimate functionality rather than physical size

Function points (FP) Uses the functionality of the software as a measure Analogy: For a given house, we can say how many square meters it has (LOC) or we can say how many bedrooms and bathrooms it has (FP). The idea was first put forward by Allan Albrecht of IBM in 1979.

Function points (FP) Derived using an empirical relationship based on countable (direct) measures of software’s information domain (i.e., things in the external behavior that will require processing) A function point count is a measure of the amount of functionality in a product Can be estimated early in project before a lot is known

Information domain values Number of external inputs (EI) – Originates from a user or is transmitted from another application and provides distinct application-oriented data or control information Number of external outputs (EO) – Derived within the application and provides information to the user Number of external inquiries (EQ) – Interactive inputs requiring a response

Information domain values Number of internal logical files (ILF) – A logical grouping of data that resides within the application’s boundary and is maintained via external inputs Number of external interface files (EIF) – A logical grouping of data that resides external to the application but provides data that may be of use to the application

Computing function points: step 1 Establish count for information domain values Number of external inputs Number of external outputs Number of external inquiries Number of internal logical files Number of external interface files

Computing function points: step 2 Associate complexity value with each count Simple, Average, Complex Determined based on organisational experience based criteria. Nonetheless, the determination of complexity is somewhat subjective Compute count total

Computing function points: step 2

Computing function points: step 3 Calculate complexity adjustment values (F i, where i  [1..14]) Does the system require reliable backup and recovery? Are data communications required? Are there distributed processing functions? Is performance critical? Will the system run in an existing, heavily utilised operating environment? Does the system require on-line data entry?

Computing function points: step 3 Does the on-line data entry require the input transaction to be built over multiple screens or operations? Are the master files updated on-line? Are the inputs, outputs, files or inquiries complex? Is the internal processing complex? Is the code designed to be reusable? Are conversion and installation included in the design? Is the system designed for multiple installations in different organisations? Is the application designed to facilitate change and ease of use by the user?

Computing function points: step 3 Answer each question using a scale of 0 (N/A) to 5 (absolutely essential) Sum the 14 complexity adjustment values  F i

Calculate 0.65 and 0.01 are empirically derived constants Computing function points: step 4 FP = count total  (  F i )

Function point (FP): Advantages Programming language independent Used readily countable characteristics that are determined early in the software process Does not “penalize” inventive (short) implementations that use fewer LOC than other more clumsy versions

Comparing LOC and FP Rough Estimates

LOC and FP LOC and FP-based metrics have been found to be relatively accurate predictors of software development effort and cost Typical metrics – $ per LOC, $ per FP – LOC per person-month, FP per person-month – errors per KLOC, errors per FP – pages of documentation per KLOC, pages of documentation per FP

Complexity metrics Numerous metrics have been proposed for measuring program complexity – probably more than for any other program characteristic Complexity can be interpreted in different ways, depending on our perspective – Problem complexity (also called computational complexity) measures the complexity of the underlying problem – Algorithmic complexity reflects the complexity of the algorithm implemented to solve the problem – Structural complexity measures the structure of the software used to implement the algorithm – Cognitive complexity measures the effort required to understand the software

Complexity metrics Numerous metrics have been proposed for measuring program complexity – probably more than for any other program characteristic Complexity can be interpreted in different ways, depending on our perspective – Problem complexity (also called computational complexity) measures the complexity of the underlying problem – Algorithmic complexity reflects the complexity of the algorithm implemented to solve the problem – Structural complexity measures the structure of the software used to implement the algorithm – Cognitive complexity measures the effort required to understand the software

Complexity metrics Our intuition tells us that the complexity of a program can affect the time it takes to code it, test it, and fix it We suspect that complexity can help us to understand when a module is prone to contain faults We often assume that we know what complexity is, and we measure complexity without first defining it in the real world Many software developers define program complexity as the cyclomatic number proposed by McCabe

Cyclomatic complexity Cyclomatic complexity is a software metric that provides a quantitative measure of the logical complexity of a program It was proposed by Tom McCabe in 1976 This number, based on a graph-theoretic concept, counts the number of linearly independent paths through a program (we have seen this in the context of testing with basis path testing) McCabe felt that the number of such paths was a key indicator not just of testability but also of complexity

Cyclomatic complexity A number of industry studies have indicated that the higher the cyclomatic complexity of a module is, the higher the probability of errors In one experiment, modules with cyclomatic complexity > 10 were shown to have statistically more errors If there are lots of modules to test and it is not feasible to test all of them, concentrate on the ones with highest cyclomatic complexity values, they are the ones that are most likely to be error prone

Cyclomatic complexity: actual cases [Grady, 1994] reported a study at Hewlett- Packard where cyclomatic number was computed for each module of 850,000 lines of FORTRAN code A close relationship between a module’s cyclomatic complexity number and the number of updates required was discovered The study team concluded that 15 should be the maximum cyclomatic number allowed in a module

Cyclomatic complexity: actual cases The quality assurance procedure for the software in the Channel Tunnel rail requires that a module be rejected if its cyclomatic number is greater than 20, or if it has more than 50 statements [Bennett, 1994]

Cyclomatic complexity The cyclomatic number presents only a partial view of complexity – There are many programs that have a large number of decisions but are easy to understand, code, and maintain – Relying only on the cyclomatic number to measure actual program complexity can be misleading

Current state of software metrics Even in the case of widely studied metrics (e.g., LOC, Halstead’s metrics, McCabe’s cyclomatic complexity), not universally agreed what they measure Difficult to interpret and compare quoted metric results. For example, if different programming languages are involved, metrics involving LOC values can, if not carefully interpreted lead to incorrect conclusions – Do you see any problem(s) with LOC/month as a productivity measure? Could suggest that assembly language programmers are more productive than high-level language programmers Despite these problems, if properly used, many software metrics can lead to very useful results