Size-oriented Metrics- Lines of Codes LOC Function-Oriented Metrics: Function Points FP

J.E.D.I

7.6 Software Metrics

Software Metrics refers to a variety of measure used in computer software. Measurements can be applied to the software process with the intent of continuing the improvement of the process. It can be used throughout a software project to assist in estimation, quality control, productivity assessment and project control. It can be used by software engineers to help assess the quality of work products and to assist in the tactical decision-making as project proceeds. Software Metrics are used as indicators to provide insight into the software process, project or the software product. It allows software engineers to make decisions on how to progress within the development effort. Categories of Measurement There are roughly two categories of measurements: 1. Direct Measures. In software process, it can be the cost and effort applied. In software, it can be the lines of codes LOC produced, number of classes, execution speed, memory size and defects reported over a period of time 2. Indirect Measures. It can be product measures such as functionality, quality, complexity, efficiency, reliability, maintainability etc. Examples of metrics that are applied to software projects are briefly enumerated below. 1. Productivity Metrics. It refers to the measure on the output of software process. 2. Quality Metrics. It refers to the measure that provides indication of how closely software conforms to the requirements. It is also known as the software’s fitness for use. 3. Technical Metrics. It refers to the measure on the characteristics of the product such as complexity, degree of collaboration and modularity etc. 4. Size-Oriented Metrics. It is used to collect direct measures of software output and quality based on the line of codes LOC produced. 5. Function-Oriented Metrics. It is used to collect direct measures of software output and quality based on the program’s functionality or utility. 6. Human-Oriented Metrics. It provides measures collected about the manner in which people develop computer software and human perception about the effectiveness of tools and methods. Different phases or activities of the development projects required different metrics. Each chapter provides the metrics that are normally used to help software engineers the quality of the software and the process.

7.6.1 Size-oriented Metrics- Lines of Codes LOC

A common direct measure used for software metrics is the Lines of Code LOC. It is a size-oriented metrics used to estimate effort and cost. It is important that the metrics of other projects are placed within a table to serve as reference during estimation. Table 37 shows an example of this. Software Engineering 318 J.E.D.I Project Effort in perso n- month s Cost in P KLOC thous and lines of code Pages of Doc. Error s Peopl e Project One 24 120 12.1 365 29 3 Project Two 62 450 27.2 1224 86 5 Project Three 43 213 20.2 1050 64 6 Project Four 36 30 15 17 10 5 … … … … … … … … … … … … … … … … … … … … … Table 37: Software Metrics History In this table, effort in person-month specifies the number of months the project was developed, cost is the money spent producing the software, KLOC is the lines of codes produced, pages is the number of pages of documentation, errors is the number of errors reported after the software was delivered to the customer, and people is the number of people who developed the software. One can derive metrics from this table. Example computations are shown below. Productivity = KLOC person-month Quality = errors KLOC Cost = Cost KLOC Documentation = Pages KLOC Software Engineering 319 J.E.D.I

7.6.2 Function-Oriented Metrics: Function Points FP

Another metric that is commonly used is the Function Point FP Metrics. It focuses on the program functionality or utility. It uses an empirical relationship based on countable measures of software’s information domain and assessments of software complexity. Computing the Function Point STEP 1. Determine the value of the information domain by using the table shown in Table 38 . Fill-up the count column and multiply the value with the chosen weight factor. As an example, if the number of input is 3 and the input data are simple, chose the weight factor of 3, i.e., 3 x 3 = 9. Information Domain Weighting Factor Measurement Parameter Count Simple Average Complex Number of User Inputs x 3 4 6 = Number of User Outputs x 4 5 7 = Number of User Inquiries x 3 4 6 = Number of Files x 7 10 15 = Number of External Interfaces x 5 7 10 = Count-Total Table 38: Computation of Information Domain Find the sum Count-Total. Software Engineering 320 J.E.D.I STEP 2. Determine the complexity adjustment value. To determine the complexity adjustment value, use the scale in Table 39 in answering the questions specified below. No Influence 1 Incidental 2 Moderate 3 Average 4 Significant 5 Essential Table 39: Complexity Adjustment Scale 1. Does the system require reliable backup and recovery? 2. Are data communications required? 3. Are there distributed processing functions? 4. Is performance critical? 5. Will the system run in an existing, heavily utilized operational environment? 6. Does the system require on-line data entry? 7. Does the on-line data entry require the input transaction to be built over multiple screens or operations? 8. Are the master files updated on-line? 9. Are the inputs, outputs, files, or inquiries complex? 10. Is the internal processing complex? 11. Is the code designed to be reusable 12. Are conversion and installation included in the design? 13. Is the system designed for multiple installations in different organizations? 14. Is the application designed to facilitate change and ease of use by the user? Software Engineering 321 J.E.D.I STEP 3. Compute for the function point. Use the formula indicated below. FuntionPoint = Count-Total X [0.65 + 0.01 x sum F i ] One can also derive metrics similar to size-oriented metrics. Examples of that are listed below. Productivity = FP person-month Quality = Defects FP Cost = Cost FP Documentation = Pages of Documentation FP Software Engineering 322 J.E.D.I

7.6.3 Reconciling LOC and FP Metrics