Software metric By Deepika Chaudhary.

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

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Process and Project Metrics
Metrics for Process and Projects
Metrics for Process and Projects
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 Metrics.
Software Engineering II - Topic: Software Process Metrics and Project Metrics Instructor: Dr. Jerry Gao San Jose State University
Software Metrics II Speaker: Jerry Gao Ph.D. San Jose State University URL: Sept., 2001.
Testing an individual module
Software Process and Product Metrics
Project Metrics Infsy 570 Dr. R. Ocker.
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 1 Lecture 22: Software Measurement Basics of software measurement.
Lecture 17 Software Metrics
Cmpe 589 Spring Software Quality Metrics Product  product attributes –Size, complexity, design features, performance, quality level Process  Used.
Software Engineering Software Process and Project Metrics.
Chapter 6 : Software Metrics
Software Measurement & Metrics
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.
Software Project Management Lecture # 3. Outline Chapter 22- “Metrics for Process & Projects”  Measurement  Measures  Metrics  Software Metrics Process.
Software Metrics (Part II). Product Metrics  Product metrics are generally concerned with the structure of the source code (example LOC).  Product metrics.
Software Quality Metrics
Software Metrics – part 2 Mehran Rezaei. Software Metrics Objectives – Provide State-of-art measurement of software products, processes and projects Why.
Lecture 4 Software Metrics
Introduction to Software Project Estimation I (Condensed) Barry Schrag Software Engineering Consultant MCSD, MCAD, MCDBA Bellevue.
SOFTWARE PROCESS AND PROJECT METRICS. Topic Covered  Metrics in the process and project domains  Process, project and measurement  Process Metrics.
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.
Hussein Alhashimi. “If you can’t measure it, you can’t manage it” Tom DeMarco,
Advanced Software Engineering Lecture 4: Process & Project Metrics.
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Chapter 22 Metrics for Process and Projects Software Engineering: A Practitioner’s Approach 6 th Edition Roger S. Pressman.
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.
CS223: Software Engineering Lecture 21: Unit Testing Metric.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
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 Test Metrics When you can measure what you are speaking about and express it in numbers, you know something about it; but when you cannot measure,
Metrics of Software Quality
Software Metrics 1.
Chapter 22 Process and Project Metrics
Software Testing.
Software Engineering (CSI 321)
Software Engineering (CSI 321)
Software Project Sizing and Cost Estimation
Why Do We Measure? assess the status of an ongoing project
Software Planning
Lecture 17 Software Metrics
Function Point.
Halstead software science measures and other metrics for source code
Chapter 5: Software effort estimation- part 2
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.
Why Do We Measure? assess the status of an ongoing project
Chapter 25 Process and Project Metrics
COCOMO Models.
Software metrics.
Why Do We Measure? assess the status of an ongoing project
Process and Project Metrics
Metrics for process and Projects
Chapter 32 Process and Project Metrics
Software Testing “If you can’t test it, you can’t design it”
Chapter 22 Process and Project Metrics
Metrics for Process and Projects
Software Effort Estimation
Coupling Interaction: It occurs due to methods of a class invoking methods of other classes. Component Coupling: refers to interaction between two classes.
Chapter 26 Estimation for Software Projects.
COCOMO MODEL.
Presentation transcript:

Software metric By Deepika Chaudhary

Software Metric A software metric is a measure of some property of a piece of software or its specifications. Since quantitative methods have proved so powerful in the other sciences, computer science practitioners and theoreticians have worked hard to bring similar approaches to software development. Tom DeMarco stated, “You can’t control what you can't measure.”[1]

Defintion Goodman defines software metrics as, "The continuous application of measurement-based techniques to the software development process and its products to supply meaningful and timely management information, together with the use of those techniques to improve that process and its products."

Software Metrics Software process and product metrics are quantitative measures that enable software people to gain insight into the efficacy of the software process and the projects that are conducted using the process as a framework. Basic quality and productivity data are collected. These data are then analyzed, compared against past averages, and assessed to determine whether quality and productivity improvements have occurred. Metrics are also used to pinpoint problem areas so that remedies can be developed and the software process can be improved.

Contd A software engineer collects measures and develops metrics so that indicators will be obtained. An indicator is a metric or a combination of metrics, which provides insight into the software process, project or the product. Insight leads to informed decision making. It helps software engineers to adjust the process, project or product to improve the general quality.

Types of Metrics Process indicators enable a software engineering organization to gain insight into the effectiveness of an existing process. They enable the managers to assess what works and what doesn.t. Process metrics are collected across all projects and over long periods of time. Their intent is to provide indicators that lead to long-term software process improvement. Project indicators enable a software project manager to do the following: i) Assess the status of an ongoing project ii) Track potential risks iii) Uncover problem areas before they turn critical iv) Adjust work flow or tasks v) Evaluate the team.s ability to control quality of software work products.

Process metrics The only rational way to improve a process is to: i) Measure specific attributes of the process ii) Develop a set of meaningful metrics based on these attributes iii) Use the metrics to provide indicators that will lead to a strategy for improvement. It is important to note that a process is only one of a number of controllable factors in improvingsoftware quality and organizational performance. The efficiency of a software process is measured indirectly. A set of metrics is derived based on the on the results obtained from the process. These results include measure of errors uncovered before release of the software, defects reported by end-users, work products delivered, human effort expended, calendar time spent, conformance to the schedule and such other measures.

Contd… Process data may be classified into the following two categories: i) Private process data ii) Public process data

Need for software metric How long it will take to complete ? How much will it cost to complete ? What would be the likely maintenance cost ? When can the s/w be released ? How much effort would be required to complete ?

Types of Metric Size Metrics Code Complexity Metric

Size Metric LOC TOKEN Metric Function Point or extended function point Bang

LOC Loc is one of the simplest metric for estimating the effort and size of computer program. Although this may seem to be simple metric that can be counted algorithmically but there is no general agreement about what constitutes a line of code.

LOC Early users of line of code does not include data declaration comments or any other any other lines that do not result in object code. Later users decides to include declarations and other unexecutable statements but still excluded comments and blank lines.

LOC Loc is often used during testing and maintenance It is not only used to specify size of software products but with other metrics it can be used to analyze other aspects of quality and cost.

Token Metrics In this we count the basic symbol used in line instead of lines themselves. These basic symbols are called tokens which are classified as either operators and operands. For example while ,for, eof . M.H.Halstead proposed one of the token metric where the size of a program which consist of number of unique tokens can be defined in terms of

The Size n= vocabulary of program n1=count of unique operators n2 = count of unique operands Where n=n1 + n2 N is the length of the program in terms of token used. N1= total occurrences of operators N2=total occurrences of operands

Token count N is closely related to the lines of codes measure program length N=2*loc Another measure of the size of program is volume V = N * log 2 n Where volume is the actual size of program if uniform binary encoding of the vocabulary is used.

steps Since an algorithm can be implemented by many different but equivalent programs a program that in minimal size us said to have the potential volume v*.

Ad & Disadvantages Simple to measure Disadvantages It is programming language dependent Does not accommodate non procedural language Poor software design may lead to excessive unnecessary loc.

Comparison LOC Effort $(000) Doc pg Errors Defects people 24 168 365 Project LOC Effort $(000) Doc pg Errors Defects people Alpha 12100 24 168 365 134 29 3 Beta 27200 62 440 1224 321 86 5 Gamma 20200 43 314 1050 256 64 6

Con.. The errors , defects, cost everything in the project is measured per KLOC (Thousand line of code)

Usage of size oriented metric Individuals on two different project teams record and categorize all errors that they find during the software process individuals measures are then combined to develop team measures . Team A found 342 errors during the software process prior to release . Team B found 184 errors prior to release

Contd Which team is more effective in uncovering errors throughout the process ? Because we do not know the size or complexity of the projects we cannot answer this question So here the usage of metric comes into picture.

Function count Alan Albrecht while working with IBM recognized the problem in size measurement in the 1970’s and developed a technique called function point analysis which appeared to be a solution to the size measurement problem.

It measure functionality from user point of view that is on the basis of what user request and receives in return. Therefore it deals with the functionality being delivered and not with the lines of code.

The principle behind FPA is that a system is decomposed into Inputs Outputs Enquiries Request for instance access to information Internal logic files Info held within system External interface files Info held by other system

i) Number of user inputs Each user input that provides distinct application-oriented data to the software is counted. Inputs should be distinguished from enquiries, which are counted separately. ii) Number of user outputs Each user output that provides application-oriented data to the user is counted. In this context output refers to reports, screens, error messages, etc. Individual data items within a report are not counted separately. iii) Number of user enquiries An enquiry is defined as an on-line input that results in the generation of some immediate software response in the form of an on-line output. Each distinct enquiry is counted. iv) Number of files Each logical master file is counted.

v) Number of external interfaces All machine-readable interfaces (e.g. data files on storage media) that are used to transmit information to another system are counted. Once this data is collected, a complexity value is associated with each count. Criteria are developed to determine whether a particular entry is simple, average or complex. To compute function points (FP)

UFP (Calculation of unadjusted fp on the basis of this table S/w components Simple Average Complex No. of user Inputs 3 4 6 Outputs 5 7 Inquiries Files 10 15 External Interfaces

Calculation of ufp Once the counts of input , outputs have been obtained the total of each count are multiplied by appropriate weight .

Calculation of CAF Complexity adjustment factor CAF=[0.65+0.01*€F i] I can range from 1 to 14

Code complexity metrics Many a times one has to test and maintain some software codes written by some another employee . In such a situation one has to understand the code and style of programming . Code complexity derives directly out of this aspect. It can be defined as a metric that is directly proportional to the

Amount of effort required to understand the code and modify it correctly. Code complexity is related to testability and maintainability of the code.

Mc cabe Cyclomatic complexity Mccabe Cyclomatic complexity metric is introduced by Thomas McCabe in 1976 is the most useful logical metric . It is used to measure the complexity of a program . It directly measure the number of linearly independent paths through a source code.

For eg if the source code contained no conditional such as if or for loop the complexity will be one. Since there is only a single path. If a program has a single if there would be two paths one path for true and another for false.

Cyclomatic complexity is calculated by created a connected graph of the source code. Each line of code is considered a node on the graph and the arrows between the nodes shows the execution path.

The Mccabe complexity is defined as CC=E-N+P CC Cyclomatic complrxity E Edges N Nodes P predicates (the number of connected compnents.

Once the cyclomatic complexity has been considered it can be compared to the std range 1-10 Simple 11-20 Moderate 21-50 complex >50 Very high risk

Another way to determine the CC is to count the decision point and increment it by 1 Cc=D+1

Advantages It can be used as a ease of maintenance metric Used as a quality metric Measures the best areas for concentrating for testing It is easy to apply

Disadvantages It measure the control complexity and not the data complexity The same weight is placed to nested and non nested loop. The fan-in fan-out method is more useful as it can keep the data track.