University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 1 Lecture 22: Software Measurement Basics of software measurement.

Slides:



Advertisements
Similar presentations
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Advertisements

Estimation using COCOMO More Science, Less Art. COCOMO History COCOMO History Constructive Cost Model Dr. Barry Boehm TRW in 1970s COCOMO
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Software.
So far.. We have covered a) Requirements gathering: observation & interview. b) Requirements specification. c) Requirements validation. d) Design/paper.
Software engineering for real-time systems
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 23Slide 1 Software Cost Estimation.
Ch8: Management of Software Engineering. 1 Management of software engineering  Traditional engineering practice is to define a project around the product.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Unit Testing CS 414 – Software Engineering I Don Bagert Rose-Hulman Institute of Technology January 16, 2003.
 Software Software  Program vs Software Products Program vs Software Products  Software Characteristics Software Characteristics  Software Crisis.
Software Cost Estimation Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn.
University of Toronto Department of Computer Science CSC444 Lec04- 1 Lecture 4: Software Lifecycles The Software Process Waterfall model Rapid Prototyping.
Cost Estimation Van Vliet, chapter 7 Glenn D. Blank.
Cyclomatic Complexity Dan Fleck Fall 2009 Dan Fleck Fall 2009.
© The McGraw-Hill Companies, Software Project Management 4th Edition Software effort estimation Chapter 5.
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.
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec13 1 Lecture 13: Representing software designs Viewpoints Structural.
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec21 1 Lecture 21: Process Improvement Basics of Process Modeling.
1 Software Quality CIS 375 Bruce R. Maxim UM-Dearborn.
Estimation Why estimate? What to estimate? When to estimate?
Chapter 6 : Software Metrics
Project Management Estimation. LOC and FP Estimation –Lines of code and function points were described as basic data from which productivity metrics can.
©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.
University of Toronto Department of Computer Science CSC444 Lec05- 1 Lecture 5: Decomposition and Abstraction Decomposition When to decompose Identifying.
CEN th Lecture CEN 4021 Software Engineering II Instructor: Masoud Sadjadi Effort estimation.
This chapter is extracted from Sommerville’s slides. Text book chapter
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.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Agenda Introduction Overview of White-box testing Basis path testing
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 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 23 Instructor Paulo Alencar.
Lecture 4 Software Metrics
Cost Estimation. Problem Our ability to realistically plan and schedule projects depends on our ability to estimate project costs and development efforts.
Cost Estimation What is estimated? –resources (humans, components, tools) –cost (person-months) –schedule (months) Why? –Personnel allocation –Contract.
SEG3300 A&B W2004R.L. Probert1 COCOMO Models Ognian Kabranov.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 26 Slide 1 Software cost estimation 2.
SOFTWARE METRICS. Software Process Revisited The Software Process has a common process framework containing: u framework activities - for all software.
Cmpe 589 Spring 2006 Lecture 2. Software Engineering Definition –A strategy for producing high quality software.
Software Project Estimation IMRAN ASHRAF
CSc 461/561 Information Systems Engineering Lecture 5 – Software Metrics.
Software cost estimation. Fundamental estimation questions How much effort is required to complete an activity? How much calendar time is needed to complete.
Function Points Synthetic measure of program size used to estimate size early in the project Easier (than lines of code) to calculate from requirements.
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.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
Advanced Software Engineering Lecture 4: Process & Project Metrics.
Theory and Practice of Software Testing
Agent program is the one part(class)of Othello program. How many test cases do you have to test? Reversi [Othello]
بشرا رجائی برآورد هزینه نرم افزار.
Software Metrics 1.
Software Testing.
White-Box Testing Pfleeger, S. Software Engineering Theory and Practice 2nd Edition. Prentice Hall, Ghezzi, C. et al., Fundamentals of Software Engineering.
Lecture 17 Software Metrics
Constructive Cost Model
Software Metrics “How do we measure the software?”
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.
COCOMO Models.
Cost Estimation Van Vliet, chapter 7 Glenn D. Blank.
Software metrics.
Chapter 19 Technical Metrics for Software
Software Development Cost Estimation Chapter 5 in Software Engineering by Ian Summerville (7th edition) 4/7/2019.
Software Cost Estimation
COCOMO MODEL.
Presentation transcript:

University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 1 Lecture 22: Software Measurement Basics of software measurement metrics predictive models validity Some example models COCOMO (for effort and time estimation) Function Points (for estimating software size) Reliability Models Cyclomatic Complexity

University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 2 Basics of Software Measurement Definitions Metric - a quantifiable characteristic of software Measurement - the process of mapping from real world attributes to a mathematical representation Model - a mathematical relationship between metrics e.g. between quality factors and available metrics Validity - Does the metric accurately measure what it purports to measure Prediction system - a set of metrics and a model that can be used to predict some attribute of a future entity. Deterministic predictions give the same result for the same inputs Stochastic predictions provide a window of error around the actual value Difficulties with software measurement We are not measuring repeatable, objective phenomena Software development is so complex that all models are weak approximations models that work for one project or team don’t work for others local contingency factors may be more important than the metrics in the model Source: Adapted from Pfleeger 1998, p

University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 3 COnstructive COst Model (COCOMO) Used to predict cost of a project from a measure of size (lines of code) Basic model is: E = aL b Modeling process Establish type of project (organic, semidetached, embedded) this gives sets of values for a and b Identify the component modules, and estimate L for each module Adjust L according to how much is reused COCOMO has a model for adjusting according to how much design, code and integration data is reused Compute effort for each module using E = aL b Adjust E according to difficulty of the project COCOMO identifies 15 effort multipliers to take into account Product attributes: eg required reliability, complexity, database size Computer attributes: eg execution time constraints, storage constraints, etc. Personnel attributes: eg capability & experience of analysts and programmers, Project attributes: eg use of CASE tools, programming language, schedule Compute time using T = cE d c and d provided for different project types like a and b were Example model: COCOMO effort lines of code project specific factors Source: Adapted from van Vliet, 1999, section 7.3.2

University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 4 Example model: Function Points Function Points used to caculate size of software from a statement of the problem tries to address variability in lines of code estimates used in models such as COCOMO e.g. because SLOC varies with different languages Originally for information systems, although other variants exist Basic model is: FP = a 1 I + a 2 O + a 3 E + a 4 L + a 5 F Example Sets of weightings (a i ) provided for different types of project Measure properties of the problem statement: I = number of user inputs (data entry) O = number of user outputs (reports, screens, error messages) E = number of user queries L = number of files F = number of external interfaces (to other devices, systems) Example calculation: FP = 4I + 5O + 4E + 10L + 7F weighting factor for this metric metric from problem statement Source: Adapted from van Vliet, 1999, section 7.3.5

University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 5 Motorola’s Zero-failure testing model Predicts how much more testing is needed to establish a given reliability goal basic model: failures = a e -b(t) Reliability estimation process Inputs needed: fd = target failure density (e.g failures per 1000 LOC) tf = total test failures observed so far th = total testing hours up to the last failure Calculate number of further test hours needed using: ln(fd/(0.5 + fd)) x th ln((0.5 + fd)/(tf + fd)) Result gives the number of further failure free hours of testing needed to establish the desired failure density if a failure is detected in this time, you stop the clock and recalculate Note: this model ignores operational profiles! Example model: Reliability growth empirical constants testing time Source: Adapted from Pfleeger 1998, p359 test time failures

University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 6 Example model: Cyclomatic Complexity McCabes’ complexity measure This is a measurement model, not a predictive model It measures complexity as a function of the number of paths through a program Basic model is: CV = e - n + p + 2 Application Draw each module as flowchart Convert each flowchart to a graph nodes show statements, edges show control paths branches (IF, WHILE, etc) have multiple edges coming out of them Count edges and nodes in each graph CV also corresponds to the number of linearly independent paths in the graph CV > 10 is usually taken as an indicator that a module is overly complex But the validity of this measure is hotly disputed! Source: Adapted from van Vliet, 1999, pp “cyclomatic complexity” number of nodes number of edges number of graphs (procedures)

University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 7 But software measurement is hard Key problems for software measurement: Most attributes of interest cannot be measured directly Most metrics are very hard to validate Most models are at best vague approximations The validity of each of the models described is disputed Models usually have to be adapted to a particular organization Need to collect data over a long period to validate and adapt the models The technology keeps changing parameters for these models are derived from past projects which might be unlike future projects Predictive models can be self-fulfilling Predictive model is used to generate effort and time estimates …which are used to generate a project plan …which is used by managers to manage the project to …so the project ends up having to conform to the estimate! But you cannot control it if you cannot measure it poor models may be better than no models at all predictions will need to be continuously revised as the project proceeds

University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 8 References van Vliet, H. “Software Engineering: Principles and Practice (2nd Edition)” Wiley, Chapter 6 has some introductory comments about measurement of various different things in software engineering, especially with respect to any attempt to measure software quality. Various metrics are introduced throughout the book, at appropriate places. For example, cost estimation (COCOMO, Function Point Analysis, etc) is in chapter 7; measurement of design complexity (Halstead, McCabe, …) is in chapter 11; measurement of testing (test coverage, test adequacy criteria) is in chapter 13; and reliability estimation is in chapter 18. This is of course appropriate – measurement should be an integrated part of software engineering, not something you bolt on afterwards! Pfleeger, S. L. “Software Engineering: Theory and Practice” Prentice Hall, Pfleeger’s research area is software measurement, so she gives it a very strong treatment throughout her book.