Software Process
Software Process
Theory
Empirical
World Hypothesis An proposed explanation of a phenomenon.
Data Analysis Carry out studies, analyse data from past projects,…
Verify or disprove the theory
Definitions (1/2)
Entity: Program
Attributes
- Time to Develop
- Lines of code
- Number of Defects
Levels of Measurement
Catholic
Example: A religion nominal scale
Joe Michelle
Rachel Christine
Clyde Wendy
Other Jewish
The Nominal Scale (2/2)
1st Class
Example: A degree-classification ordinal scale
Joe Michelle
Rachel Christine
Clyde Wendy
lower ones
A higher-level of Ordinal
measurement can be
reduced to a lower one
Least Powerful
but not vice-versa Nominal
Analysis Possible
Measures, Metrics and Indicators
Measure – An appraisal or ascertainment by
comparing to a standard. E.g. Joe’s body
temperature is 99° fahrenheit
Metric – A quantitative measure of the degree to
which an element (e.g. software system) given
attribute.
E.g. 2 errors were discovered by customers in 18 months
(more meaningful than saying that 2 errors were found)
Indicator – A device, variable or metric can indicate
whether a particular state or goal has been
achieved. Usually used to draw someone’s
attention to something.
E.g. A half-mast flag indicates that someone has died
Example of a Measure
100
80
Temp.
60
40
20
0
0 2 4 6 8 10 12 14
Time (Hours)
Example of a Metric
50
40
Bugs .
30
20
10
0
0 2 6 9 12 15 18
Months since release
Example of a Indicator
Indicator of maximum safe temperature
90
80
70
60
Temp.
50
40
30
20
10
0
0 2 6 9 12 15 18
Time (Hours)
Some basic measures (1/2)
Ratio
E.g. The ratio of testers to developers in
our company is 1:5
Proportion
Similar to ratio but the numerator is part
of the denominator as well
E.g. Number of satisfied customers
Total number of customers
Some basic measures (2/2)
Percentage
A proportion or ration express in terms of per hundred
units
E.g. 75% of our customers are satisfied with our product
Rate
Ratios, proportions and percentages are static measures
Rate provides a dynamic view of a system
Rate shows how one variable changes in relation to
another (one of the variables is usually time)
E.g. Lines of Code per day, Bugs per Month, etc
Reliability and Validity of Measurements
Reliable but not valid Valid but not reliable Reliable and Valid
Measuring Software
What makes quality software?
Cheap?
Reliable?
Testable?
Secure?
Maintainable?
…
What makes quality software?
Measurement
Programme
Non-intrusive
Modifications
Data Collection
Products
Results, Trends,
Reports, etc
Processes
People
Collecting Software Engineering Data
Motorola
7 Goals
Improve Project Planning
Increase defect containment
Increase software reliability
Decrease defect density
Improve customer service
Reduce the cost of non-conformance
Increase software productivity
Various Measurement Areas
Delivered defects, process effectiveness, software
reliability, adherance to schedule, time that problems
remain open, and more…
Examples of Metrics Programmes (2/3)
IBM
IBM have a Software Measurement Council
A set of metrics called 5-Up are defined and
deal with:
Customer Satisfaction
Postrelease Defect Rates
Customer problem calls
Fix response time
Number of defective fixes
Examples of Metrics Programmes (3/3)
Hewlett-Packard
Heavily influenced by defect metrics
Average fixed defects/working day
Average engineering hours / fixed defect
Average reported defects/working day
Defects / testing time
…
Product Metrics
What can we measure about a product?
Size metrics
Defects-based metrics
Cost-metrics
Time metrics
Quality Attribute metrics
Size Metrics
Video Rental
System
Video Rental
System
External Inputs: 1
External Outputs: 2
Logical Internal Files: 1
External Interface Files: 0
External Enquiries: 1
Total Functionality is (1x4) + (2x5) +
(1x10) + (0x7) +(1x4) = 28
Function Point Extensions
FP = FC x VAF
GSC Example (1/2)
Consider the bug-reporting system for which we already looked at and
suppose the analyst involved answers the GSC questions as follows…
1. Data communications 5 8. On-line update 3
# defects
system _ size
Failure Rate
R(t1 ) R(t 2 )
(t 2 t1 ) R(t1 )
0.85 0.2
60 0.85
0.65
51
0.013 Failures per day
Mean Time Between Failure (MTBF)
MTBF is useful in safety-critical applications
(e.g. avionics, air traffic control, weapons,
etc)
The US government mandates that new air
traffic control systems must not be
unavailable for more than 30 seconds per
year
1
MTBF
MTBF Example
e = 7, n=6, p=1
Input n
M = 7 - 6 + (2x1) = 3
n<num
Output n? Output
“Too Big” n>num “Too Big”
n=num
Output
“Right”
McCabe’s Cyclomatic Complexity
Where:
V* = 2 + n2 x log2(2 + n2)
M* = average number of decisions between errors (3000 according to
Halstead)
Other useful product metrics
No Yes
You need to
Quality Prospect
perform more
is positive
testing
Defect Density During Machine Testing
Yes No
Quality prospect
Quality Prospect negative. Perform
is positive more testing.
Defect Arrival Pattern During Testing
Defect Defect
Arrival Arrival
Rate Rate
WEEK WEEK
Defect Defect
Arrival Arrival
Cumulative Cumulative
Rate Rate
WEEK
WEEK
Interpretting Defect Arrival Patterns
60
Project B
50
40 Most defects found
30 during testing
20
10
More expensive to
0
fix
Design Design Code Unit System
Review 1 Review 2 Inspection Testing Testing Should be corrected
Other useful process metrics
Requirements
Design
Coding
Phase
Testing Min
Max
Acceptance Test
Operation
Inheritance
Objects may acquire characteristics of one or
more other objects
The way inheritance is used will affect the
overall quality of a system
Localisation
Placing related items in close physical proximity
to each other
In the case of OO, we group related items into
objects, packages, ets
Measurable Structures in OO (1/5)
Class
Template from which objects are created
Class design affects overall:
Understandability
Maintainability
Testability
Reusability is also affected by class design
E.g. Classes with a large number of methods tend to
be more application specific and less reusable
Measurable Structures in OO (2/5)
Message
A request made by one object to another object
Receiving object executes a method
It is important to study message flow in an OO
system
Understandability
Maintainability
Testability
The more complex message flows between
objects are, the less understandable a system is
Measurable Structures in OO (3/5)
Coupling
A measure of the Class A
strength of association
established by
connections between
different entities Class B Class C
Occurs through:
Use of an object’s
methods
Inheritance Class D
Measurable Structures in OO (4/5)
Cohesion
The degree to which Class A
methods in a class are int Method1(a, b);
related to each other
Effective OO designs int Method2(a, b);
maximise cohesion because
they promote encapsulation String Method3();
A high degree of cohesion
void Method4(a, b);
indicates:
Classes are self contained
Fewer messages need to be
passed (more efficiency)
Measurable Structures in OO (5/5)
Inheritance
A mechanism which allows an object to
acquire the characteristics of one or more
other objects
Inheritance can reduce complexity by
reducing the number of methods and
attributes in child classes
Too much inheritance can make the
system difficult to maintain
Weighted Methods Per Class (WMC)
DIT = 0 Animal
A simple metric
Counts the number of immediate
subclasses of a particular class
It is a measure of how many
subclasses are going to inherit
attributes and methods of a particular
class
Number of Children (NOC)
Generally it is better to have depth than
breadth in the class hierarchy
Promotes reuse of methods through inheritance
Classes higher up in the hierarch should
have more subclasses
Classes lower down should have less
The NOC metric gives an indication of the
potential influence of a class on the overall
design
Attributes: Efficiency, Reusability, Testability
Number of Children (NOC)
Coupling Between Objects (CBO)
RFC = |RS|
where RS is the response set of a class
RS = {Mi} {Ri}
Mi = All the methods in a class
Ri = All methods called by that class
Response for a Class (RFC)
Thresholds:
We can provide guidelines
However, each project may have different needs