Software Engineering
- Prof. Dr. Bertrand Meyer
March 2007 – June 2007
Chair of Softw are Engineering
Lecture 28: Software metrics Measurement To measure is to know - - PowerPoint PPT Presentation
Chair of Softw are Engineering Software Engineering Prof. Dr. Bertrand Meyer March 2007 June 2007 Lecture 28: Software metrics Measurement To measure is to know When you can measure what you are speaking about and express it in
March 2007 – June 2007
Chair of Softw are Engineering
Software Engineering, lecture 11: CMMI 2
2
“To measure is to know” “When you can measure what you are speaking about and express it in numbers, you know something about it; but when you cannot measure it, when you cannot express it in numbers, your knowledge is of a meager and unsatisfactory kind; it may be the beginning of knowledge, but you have scarcely in your thoughts advanced to the state of Science, whatever the matter may be. ” "If you cannot measure it, you cannot improve it." Lord Kelvin “You can't control what you can't measure” Tom de Marco “Not everything that counts can be counted, and not everything that can be counted counts.” Albert Einstein
Software Engineering, lecture 11: CMMI 3
3
Software Engineering, lecture 11: CMMI 4
4
Software Engineering, lecture 11: CMMI 5
5
Correctness Robustness Ease of use Security …
“This program is much more correct than the previous
“There are 67 outstanding bugs, of which 3 are
Software Engineering, lecture 11: CMMI 6
6
0 % 140%
.. . . .
Without Historical Data With Historical Data
Variance between + 20% to - 145% Variance between - 20% to + 20% (Mostly Level 1 & 2) (Level 3)
Over/Under Percentage
(Based on 120 projects in Boeing Information Systems)
Reference: John D. Vu. “Software Process Improvement Journey:From Level 1 to Level 5.” 7th SEPG Conference, San Jose, March 1997.
Software Engineering, lecture 11: CMMI 7
7
Development time Team size Cost
Number of failures Number of faults Mean Time Between Failures
Software Engineering, lecture 11: CMMI 8
8
Find the appropriate parameters defining the project
Measure these parameters Deduce effort attributes through appropriate
Software Engineering, lecture 11: CMMI 9
9
Source: Standish report Source: van Genuchten (1991) Average overrun: 22%
Software Engineering, lecture 11: CMMI 10
10
(after Ghezzi/Jazayeri/Mandrioli)
Software professional: a few tens of lines of code per
Student doing project: much more!
Software Engineering, lecture 11: CMMI 11
11
Programmers don’t just program m persons x n months is not
Software Engineering, lecture 11: CMMI 12
12
Lines of code (LOC, KLOC, SLOC..) Function points Application points
Software Engineering, lecture 11: CMMI 13
13
Definition: count number of lines in program Conventions needed for: comments; multi-line instructions; control structures; reused code. Pros as a cost estimate parameter:
Appeals to programmers Fairly easy to measure on final product Correlates well with other effort measures
Cons:
Ambiguous (several instructions per line, count comments or not,
…)
Does not distinguish between programming languages of various
abstraction levels
Low-level, implementation-oriented Difficult to estimate in advance.
Software Engineering, lecture 11: CMMI 14
14
14
Software Engineering, lecture 11: CMMI 15
15
Definition: one end-user business function Five categories (and associated weights):
Inputs (4) Outputs (5) Inquiries (4) Files (10) Interfaces to other systems (7)
Pros as a cost estimate parameter:
Relates to functionality, not just implementation Experience of many years, ISO standard Can be estimated from design Correlates well with other effort measures
Cons:
Oriented towards business data processing Fixed weights
Software Engineering, lecture 11: CMMI 16
16
Relates to high-level functionality Can be estimated very early on
Remote from actual program
Software Engineering, lecture 11: CMMI 17
17
Cost driver estimation
Action points at stage 1 (requirements) Function points at stage 2 (early design) Function points and SLOC at stage 3 (post-
2.94 (early design) 0.91 to 1.23 (depending on novelty, risk, process…)
Software Engineering, lecture 11: CMMI 18
18
Product reliability &
Required reuse Platform difficulty Personnel capability Personnel experience Schedule Support facilities
Product reliability &
Database size Documentation needs Required reuse Execution time & storage
Platform volatility Personnel experience &
Use of software tools Schedule Multisite development
Software Engineering, lecture 11: CMMI 19
19
Software Engineering, lecture 11: CMMI 20
20
Lines of code Function points Halstead’s volume measure: N log η, where N is
McCabe’s cyclomatic number: C = e – n + 2 p, where n is
Software Engineering, lecture 11: CMMI 21
21
Software Engineering, lecture 11: CMMI 22
22
Do we stop execution to repair? Can repair introduce new faults?
Software Engineering, lecture 11: CMMI 23
23
# bugs Class STRING Testing time
Software Engineering, lecture 11: CMMI 24
24
Hours to last failure Test failures so far Desired number of failures
Software Engineering, lecture 11: CMMI 25
25
June 2007
Software Engineering, lecture 11: CMMI 26
26
Lines of Code Number of classes Cohesion & Coupling Conformance of code to OO principles
Man-month spent on software Number of bugs introduced per hour Ratio of debugging/developing time CMM, PSP
26
Software Engineering, lecture 11: CMMI 27
27
27
Software Engineering, lecture 11: CMMI 28
28
28
Software Engineering, lecture 11: CMMI 29
29
29
Software Engineering, lecture 11: CMMI 30
30
Blank lines Comment lines Automatically generated lines
Code used in examples given here and below are got from revision 68868 in Origo subversion server.
30
Software Engineering, lecture 11: CMMI 31
31
31
Software Engineering, lecture 11: CMMI 32
32
32
Software Engineering, lecture 11: CMMI 33
33
33
Software Engineering, lecture 11: CMMI 34
34
34
Software Engineering, lecture 11: CMMI 35
35
35
Software Engineering, lecture 11: CMMI 36
36
36
Software Engineering, lecture 11: CMMI 37
37
37
Software Engineering, lecture 11: CMMI 38
38
38
Software Engineering, lecture 11: CMMI 39
39
39
Software Engineering, lecture 11: CMMI 40
40
40
Software Engineering, lecture 11: CMMI 41
41
41
Software Engineering, lecture 11: CMMI 42
42
42
Software Engineering, lecture 11: CMMI 43
43
43
Software Engineering, lecture 11: CMMI 44
44
Software Engineering, lecture 11: CMMI 45
45
Software Engineering, lecture 11: CMMI 46
46
Software Engineering, lecture 11: CMMI 47
47
Software Engineering, lecture 11: CMMI 48
48
Software Engineering, lecture 11: CMMI 49
49
Software Engineering, lecture 11: CMMI 50
50
Software Engineering, lecture 11: CMMI 51
51
Do not focus on design and implementation (covered in other courses) In the course (less in the project) de-emphasize programming Emphasize software activities that are not usually covered in programming courses and are hard to convey in a standard university setting Emphasize group work Emphasize management and communication aspects Stay away from fuzzy science (e.g. Halstead’s “software science”) Try to keep course in sync with project; project is main thread