1 / 42

Software metric

Software metric. By Deepika Chaudhary. Software Metric. A software metric is a measure of some property of a piece of software or its specifications.

jeannep
Download Presentation

Software metric

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Software metric By Deepika Chaudhary

  2. 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]

  3. 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."

  4. 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.

  5. 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.

  6. 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.

  7. 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.

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

  9. 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 ?

  10. Types of Metric • Size Metrics • Code Complexity Metric

  11. Size Metric • LOC • TOKEN Metric • Function Point or extended function point • Bang

  12. 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.

  13. 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.

  14. 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.

  15. 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

  16. 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

  17. 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.

  18. 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*.

  19. 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.

  20. Comparison

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

  22. 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

  23. 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.

  24. 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.

  25. 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.

  26. 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

  27. 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.

  28. 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)

  29. UFP (Calculation of unadjusted fp on the basis of this table

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

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

  32. 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

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

  34. 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.

  35. 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.

  36. 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.

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

  38. 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

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

  40. 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

  41. 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.

More Related