Software Metrics
Software Engineering
Definitions
Measure - Quantitative indication of extent,
amount, dimension, capacity, or size of some
attribute of a product or process.
– E.g., Number of errors.
Metric –A software metrics relates the individual
measures in some way (the average number of
errors found per review or per unit test).
– E.g., Number of errors found per person hours
expended.
Motivation for Metrics
Estimate the cost & schedule of future projects.
Evaluate the productivity impacts of new tools and
techniques.
Establish productivity trends over time.
Improve software quality.
Forecast future staffing needs.
Anticipate and reduce future maintenance needs.
Example Metrics
Defect rates
Error rates
Measured by:
– individual
– module
– during development
Errors should be categorized by origin, type, cost.
Metric Classification
Products
– Explicit results of software development activities
– Deliverables, documentation, by products
Processes
– Activities related to production of software
Resources
– Inputs into the software development activities
– hardware, knowledge, people
Product vs. Process
Process Metrics
– Insights of process paradigm, software engineering
tasks, work product, or milestones
– Lead to long term process improvement
Product Metrics
– Assesses the state of the project
– Track potential risks
– Uncover problem areas
– Adjust workflow or tasks
– Evaluate teams ability to control quality
Types of Measures
Direct Measures (internal attributes)
– Cost, effort, LOC, speed, memory
Indirect Measures (external attributes)
– Functionality, quality, complexity, efficiency,
reliability, maintainability
Function-Based Metrics
password test sensor Sensors
zone inquiry SafeHome
SafeHome zone settings
sensor inquiry User
User
User messages
Interaction
Interaction
panic button User
Function
Function sensor status
activate/deactivate
activate/deactivate
Monitoring
alarm
password, sensors... & Response
alert
Subsystem
System configuration data
Figure 1.14. Sort of the analysis model for SafeHome software
Function-Based Metrics
The data flow diagram is evaluated to determine the key
measure required for computation of the function point
metric:
• number of user inputs
• number of user outputs
• number of user inquiries
• number of files
• number of external interfaces
Function-Based Metrics
Weighting Factor
Inquirement parameter count simple average complex
number of user inputs 3 x 3 4 6 = 9
number of user outputs 2 x 4 5 7 = 8
number of user inquiries 2 x 3 4 6 = 6
number of files 1 x 7 10 15 = 7
number of external interfaces 4 x 5 7 10 = 20
total 50
Figure 1.15. Computing function-points: SafeHome user interaction function
In-process metrics: Quality
Reliability growth pattern
Failures during system testing plotted vs. time
– Expected: spikes during each release, decrease over time
– Magnitude of spike related to significance, volume of changes
Pattern of defects found (arrivals) during testing
– Test defects found plotted vs. time during testing
– Should decrease significantly close to release
Defect density (can be tracked during development as well)
– Defects per KLOC (can be classified by type, module)
– Post-release defect density (product metric)
Conclusion
There do exist a number of metrics that can give a meaningful picture
of what is going on in a project
By designing a metrics program that uses multiple metrics in
conjunction with each other, we can get a balanced picture
Most of the metrics come from relatively little raw data: size, effort,
defects / failures, timeline data
There are metrics that can help to identify problems and areas of
improvement, as well as metrics that evaluate results