Topic 14: Software Characteristics and Metrics
Synopsis
- Successful software...
- ...provides the required functionality
- ...is usable by real (i.e. naive) users
- ...is predictable, reliable and dependable
- ...functions efficiently
- ...has a "life-time" (measured in years)
- ...provides an appropriate user interface¤
- ...is accompanied by complete documentation
- ...may have different configurations
- ...can be "easily" maintained
- Cheap to buy
- Easy to learn
- Easy to use
- Solves the problem
- Reliable
- Powerful
- Fast
- Flexible
- Available
- Cheap to produce
- Well-defined behaviour¤
- Easy to "sell"
- Easy to maintain
- Reliable
- Easy to use
- Flexible
- Available (quick to produce)
- The issue is...how to measure these things
- Why measure at all?
- Human subjective perception is notoriously inaccurate
(how many shark attacks in the last 200 years?)
- Numbers give us a way of comparing, controlling and
predicting
- Measurements give us a way of tracking progress
(and rescheduling if necessary)
- Also provide an assessment of product quality
- Measurement is the difference between "craft" and
"engineering"
- "A quantitative measure of the degree to which a system
component or process possesses a given attribute (IEEE)
- Hence, for each metric, we require...
- ...a measurable property
- ...a relationship between that property and what we wish
to know
- ...a consistent, formal, validated expression of that
relationship
- For example: who is the greatest actor of all time?
- Simple and computable
- Persuasive
- Consistent/objective
- Consistent in use of units/dimensions
- Programming language independent
- Gives useful feedback
- Measures of attributes of a process
- Attributes may relate to people (e.g. "person-hours")...
- ...or technology (e.g. "megaLOCs")...
- ...or the product (e.g. "total cost to date")
- Effort, time and capital spent on various related activities
- Number of functionalities implemented
- Number of errors remediated (of various severities)
- Number of errors not remediated (during development process)
- Conformance to delivery schedule
- Benchmarks (speed, throughput, error-rates, etc)
- Abstract desiderata...
- Usability
- Efficiency
- Reliability
- Maintainability
- Quality
- Lines of code (LOC)
- Cyclomatic complexity (McCabe)
- Function/feature points (Albrecht/Jones)
- A size-oriented metric
- Easy to measure
- Easy to compare
- Easy to differentiate wrt time, cost, etc.
- Programming language dependent
(e.g. 1 OO-LOC = 3 3GL-LOC = 9 assembler-LOC)
- Meaningless in isolation
- Penalize efficient design and coding
- "Measure what is easy to measure,
not what is important to measure"
- The number of independent paths through the code
- The number of separate test cases required to reach every
line of code at least once.
- Usually computed by representing program as a flow control
graph and counting the distinct regions
- A language-independent measure of testing difficulty,
and probable number of errors.
- Some evidence that the values produced correspond to the
intuitive notion of "software complexity"
- An empirical formula based on...
- ...the number of inputs to a (sub-)system
- ...the number of outputs it produces
- ...the number of files (data repositories) used
- ...the number of interfaces¤ to other systems
- ...the number of algorithms encapsulated
- Numerical measure the "functionality" or "utility" of
a system.
- But is empirically derived and does not correspond to
any directly perceivable quantity (i.e. just a number)
- Measures of...
- ...Classes¤
- ...Encapsulation¤
- ...Modularity¤
- ...Inheritance
- ...Abstraction¤
- Chidamber and Kemerer
- Lorenz and Kidd
- Class¤-oriented metrics (Proc. OOPSLA, 1991)...
- ...Weighted methods per class¤
(number of methods weighted by static complexity)
- ...Depth of inheritance tree
(number of ancestral classes¤)
- ...Number of children
(number of immediate subclasses¤)
- ...Degree of coupling
(how many other classes¤ rely on the class¤, and vice versa)
- ...Response
(number of public methods)
- ...Method cohesion
(degree to which data members¤¤ shared
by two or more methods)
- (OO SW Metrics: A Practical Guide, 1994)
- Class¤- and operation- oriented
- Class¤ size
(CS) (number of methods, number of attributes)
- Number of operations overridden (NOO) by a subclass¤
(number of virtuals subsequently redefined)
- Specialization¤ Index
(NOO x level / CS)
- Average size of operation
(number of messages sent by operation)
- Operation complexity
(number of parameters to operation)
- Pressman: Chapter 2, Chapter 17.4, Chapter 18.3.2, Chapter 19 (Optional),
Chapter 24
- An overview of object-oriented design metrics
Harrison, R.; Counsell, S.; Nithi, R.
Software Technology and Engineering Practice, 1997. Proceedings., Eighth
IEEE International Workshop on [incorporating Computer Aided Software Engineering]
, 1997, Pages: 230 -235 [Available on-line via the Monash library].
This material is part of the CSE2305 - Object-Oriented
Software Engineering course.
Copyright © Jon McCormack & Damian Conway, 1998–2005. All rights
reserved.