Download presentation
Presentation is loading. Please wait.
1
Software metrics Selected key concepts
2
Introduction Motivation: Management: Appraisal Assurance Control Improvement Research: Cause-effect models Terms: Metric Measurement
3
Classification Product metrics: Observable or computed properties of the product Examples: Lines of code, number of pages Process metrics: Properties of how you are developing the product Examples: Cycle time for a change request, number of parallel activities Resource metrics: Properties and volumes of the instruments you are using when developing the product Examples: Years of education, amount of memory in testing environment
4
Scales Nominal =, CategoriesType of software Ordinal RankingsSkill rating: high, medium, low Interval+, -DifferencesCyclomatic complexity Ratio/Absolute zero Lines of code
5
Theoretical validation of metrics Representational theory, based on the mapping between attributes of real-world entities – numerical values and units: For an attribute to be measurable, it must allow different entities to be distinguished from one another. A valid measure must obey the representational condition. Each unit of an attribute contributing to a valid measure is equivalent. Different entities can have the same attribute value. Property-based theory, based on graph-theoretic models of software: Examples: Nonnegativity, Null value, Additivity
6
Empirical validation of metrics Correlation between internal and external attributes Cause-effect models Handle bias Statistical analysis
7
Goal-Question-Metric (GQM) GoalQuestionMetrics Plan How much does the inspection Average effort per KLOC process cost?Percentage of the reinspections How much calendar time does Average effort per KLOC the inspection process take Total KLOC inspected Monitor and What is the quality of the Average faultes detected per KLOC controlinspected softwareAverage inspection rate Average preparation rate To what degree did the staff Average inspection rate conform to the procedures Average preparation rate Average lines of code inspected What is the status of the inspection process? Total KLOC inspected Improve How effective is the inspection process? Defect removal efficiency Average faults detected per KLOC Average inspection rate Average preparation rate Average lines of code inspected What is the productivity of the inspection process? Average effort per fault detected Average inspection rate Average preparation rate Average lines of code inspected
8
Halstead’s software science 1/2 The measurable and countable properties are : n 1 = number of unique or distinct operators appearing in that implementation n 2 = number of unique or distinct operands appearing in that implementation N 1 = total usage of all of the operators appearing in that implementation N 2 = total usage of all of the operands appearing in that implementation
9
Halstead’s software science 2/2 Equations: Vocabulary n = n 1 + n 2 implementation length N = N 1 + N 2 N ' = n 1 log 2 n 1 + n 2 log 2 n 2 Program Volume V = Nlog 2 n Potential Volume V ' = ( n* 1 + n* 2 ) log 2 ( n* 1 + n* 2 ) Program Level L = V ‘/ V L ' = n* 1 n 2 / n 1 N 2 Elementary mental discriminations E = V / L = V 2 / V ' Intelligence Content I = L ' x V = ( 2n 2 / n 1 N 2 ) x (N 1 + N 2 )log 2 (n 1 + n 2 ) Time T ' = ( n 1 N 2 ( n 1 log 2 n 1 + n 2 log 2 n 2 ) log 2 n) / 2n 2 S
10
Code metrics in Visual Studio Lines Of Code Cyclomatic Complexity Maintainability Index = 171–5.2*ln(aveV)–0.23*ave(g’)– 16.2*ln(aveLOC) Depth Of Inheritance Class Coupling
11
Discussion What is industry using of this? Why not more?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.