CS 350: Introduction to Software Engineering

52
CS 350: Introduction to Software Engineering Slide Set 2 Process Measurement C. M. Overstreet Old Dominion University Spring 2006

description

CS 350: Introduction to Software Engineering. Slide Set 2 Process Measurement C. M. Overstreet Old Dominion University Spring 2006. Reading assignment. Chapters 3 & 4, PSP text. Lecture Topics. Process measurement Planning overview Software size why measure size - PowerPoint PPT Presentation

Transcript of CS 350: Introduction to Software Engineering

Page 1: CS 350: Introduction to Software Engineering

CS 350: Introduction toSoftware Engineering

Slide Set 2Process MeasurementC. M. OverstreetOld Dominion UniversitySpring 2006

Page 2: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU 2

Reading assignment Chapters 3 & 4, PSP text

Page 3: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Lecture Topics

Process measurement Planning overview Software size

why measure size size measurement criteria the SEI size measurement framework

Counting program size size counters coding standards

Page 4: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Process Measurement Principles To be useful, measurements should be

gathered for a specific purpose explicitly defined properly managed properly used

Measuring your process will not improve it. You must make process changes to achieve lasting improvement.

Page 5: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Process Measurement Purposes We measure to:

understand and manage change predict or plan for the future compare one product, process, or organization with another

determine adherence to standards provide a basis for control

Page 6: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Measurement Objectives

Measurements only produce numbers. To be useful, they must:

relate to business objectives be properly interpreted lead to appropriate action

If the business purposes for the measurements are not understood

the wrong data may be gathered data may not be properly used

Page 7: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Types of Measurements We generally need objective and explicit measures.

To be useful, we need relationships that correlate. program size versus development hours cost distributions defect densities

We also seek a controlling or predictive capability. actions to reduce test defects steps to improve review quality means to improve productivity

Page 8: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

The PSP Measurements

The basic PSP data are program size time spent by phase defects found and injected by phase

Both actual and estimated data are gathered on every item. Measures derived from these data

support planning characterize process quality

Page 9: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

PSP Size Measures

The goals of the PSP size measures are to define a consistent size measure establish a basis for normalizing time and defect

data help make better size estimates

Some of the questions these data can help to answer are What size program did I plan to develop? How good was my size estimate? What was the completed size of the finished

program?

Page 10: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

PSP Time Measures The goals of the PSP time measures are to determine how much time you spend in

each PSP phase help you to make better time estimates

Typical questions these data can help answer are How much time did I spend by PSP phase? How much time did I plan to spend by PSP

phase?

Page 11: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

PSP Defect Measures

The goals of the PSP defect measures are to provide a historical baseline of defect data understand the numbers and types of defects

injected understand the relative costs of removing defects

in each PSP phase Some questions these data can help answer are How many defects did I make in each phase? How many defects did I remove in each phase? How much time did it take to find and fix each

defect?

Page 12: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

PSP Derived Measures Some PSP derived measures are

To Date and To Date % Product size developed or reviewed per

hour CPI % Reuse and % New Reusable A/FR PQI

You will learn about these measures in the rest of the PSP course.

Page 13: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Size Measurement Criteria

Size measurements must be related to development effort precise machine countable suitable for early planning

Page 14: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Size Versus Development Effort The principal requirement: If the size

measure is not directly related to development cost, it is not worth using.

There are many possible measures. database elements lines of code (LOC) function points pages, screens, scripts, reports

The size measure should be sensitive to language, design, and development practice.

Page 15: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Text Pages Versus Time

0

20

40

60

80

100

120

0 5 10 15 20 25 30 35 40 45

Tim

e (

ho

urs

)

Text Pages

Page 16: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Script Size Versus Time

0

10

20

30

40

50

60

0 100 200 300 400 500 600 700

Script Size

Tim

e (

ho

urs

)

Page 17: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Report Size Versus Time

0

10

20

30

40

50

60

70

0 1000 2000 3000 4000 5000 6000 7000 8000

Report Size

Tim

e (

ho

urs

)

Page 18: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Screen Elements Versus Time

0

10

20

30

40

50

60

70

80

90

100

0 500 1000 1500 2000 2500 3000 3500 4000

Screen Elements

Tim

e (

ho

urs

)

Page 19: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

C++ LOC Versus Time

0

1000

2000

3000

4000

5000

6000

0 100 200 300 400 500 600 700 800

C++ LOC

Tim

e (

min

.)

Page 20: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Pascal LOC Versus Time

0

2000

4000

6000

8000

10000

12000

14000

0 200 400 600 800 1000 1200 1400 1600 1800 2000

Pascal LOC

Tim

e (

min

.)

Page 21: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Relationship to Development

Pages are often an acceptable measure for document development.

LOC is usually a good measure for developing source programs like Pascal and C++.

Other possible measures are function points, screens, modules, database elements, and maintenance fixes.

Page 22: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Precision and Accuracy Imprecise and inaccurate Precise and inaccurate

Imprecise and accurate Precise and accurate

x x

x

x

x

xx xx

x x

xx

x

x

x

x

x

xx

x x xx x

x xx

Page 23: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Measurement Precision When two people measure the same thing,

will they get the same result? To do so requires a precise measurement

definition. The measure must also be properly applied.

Different people will likely have different definitions of database elements.

Pascal LOC do not equate to assembler LOC. New LOC are not the same as modified LOC. Logical LOC do not equate to physical LOC. One person’s C++ LOC may not relate to

someone else’s C++ LOC.

Page 24: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Machine Countable

Manual size counting is time-consuming and inaccurate.

Automated counters will only work for defined product characteristics.

Counters can be complex, depending on the size definition selected counting method used

Page 25: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Suitable for Early Planning - 1

For making initial project plans, measures are needed that you can visualize at the beginning of the job. For a house, square feet predicts cost. Few people can visualize a house in terms

of square feet of living space. Numbers of rooms is more intuitive.

Intuitive size measures are usually needed for initial plans.

Page 26: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Suitable for Early Planning - 2

Unfortunately, popular intuitive measures are not often measurable, and popular measurable measures are often not intuitive.

Function points intuitive not directly measurable

LOC not intuitive directly measurable

Page 27: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Selecting a Size Measure - 1 Start with product development data.

resources required product characteristic measures any special development conditions

Rank products by resources required. See what characteristics distinguish

those products that took the greatest effort from those that took the least.

Page 28: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Selecting a Size Measure - 2 See if these differences are

measurable. Correlate a selected measure for the

product set. If there is no correlation, try again.

There may be no single best measure. A combination of measures could be

needed. Methods for handling multiple measures

are discussed later.

Page 29: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Selecting a Size Measure - 3 If you are better at estimating

resources than program size, size estimation will not improve your planning.

If you estimate resources directly, you must keep accurate records build a large database use an estimating guru

Page 30: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Counting Program Size

Logical lines invariant to editing changes correlate with development effort uniquely definable complex to count manually

Physical lines are easy to count are not invariant must be precisely defined for each case

Page 31: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

CS 350 LOC Measurement The CS 350 LOC measure uses logical

(versus physical) lines of code. Key advantage: it’s easy to apply What matters is consistent measures Count the number of lines containing

at least one semi-colon Can use UNIX command:

grep “;” *.h *.cpp | wc –l Assumes all source code for a module is in

a single directory

Page 32: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU 32

PSP encourages reuse So final produce likely to contain

Newly written code Reused code

But the effort that goes into reused code should be significantly less than goes into new code No (well, less) testing, etc.

So our effort measure (for budgets) only counts new and modified code

We need to track how good our estimates are.

Page 33: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Size Accounting For small products, size tracking

can be done manually, but it requires care.

For larger products, size tracking requires an accounting system.

Size accounting provides an orderly and precise way of tracking size changes through multiple product versions.

Page 34: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Example of Size Accounting - 1

Version 0350 LOC

Enhance to version 1+ 125 added and

modified LOC

Expected size350+125=475 LOC

What happened?

Measured size 450 LOC

Page 35: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Example of Size Accounting - 2

Added Subtracted Base

Base V0 0

Deleted 0

Modified 0 0

Added 350

Base V1 350 -0 350

Deleted 0

Modified 25 25

Added 100

V1 Product 125 -25 450

Total Added and Modified LOC 475

Page 36: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Messages to Remember To effectively plan and manage your

work, you must measure product size. For different types of work, use

different size measures. For each measure, size must correlate

with development time. If the size measure does not correlate

or is not automatically countable, it will not be very useful.

Every size measure should be precisely defined and automatically countable.

Page 37: CS 350: Introduction to Software Engineering

Personal Software Process

Using PSP0.1

Page 38: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Tutorial Objectives After this tutorial, you will

understand the PSP0.1 process know how to use the PSP0.1 process

scripts and forms be prepared to use PSP0.1 for program

2

Page 39: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

PSP0.1 Objectives The objectives of PSP0.1 are to help

you to measure the size of the programs that

you produce perform size accounting for the

programs that you produce make accurate and precise size

measurements

Page 40: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

New Process Elements There are two new process elements.

process improvement proposal (PIP) form size counting and coding standards

The project plan summary has been expanded. a Program Size Summary section has been

added planned time in phase is calculated based on

historical time in phase percentage

Page 41: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

PSP0.1 Process Script Additions The additions to the PSP0.1 process

scripts include new steps for distributing development time over

planned project phases using a size counting and coding

standard recording process problems and

improvement ideas

Page 42: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Process Improvement Proposal - 1 To improve your process, you will need to

capture process problems and propose improvements for future reference.

You will need to know any problems you have encountered in using

the process any suggestions you have for process

improvements your observations and findings from doing the

assignments

Page 43: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Process Improvement Proposal - 2 You should complete a PIP form for

each assignment. The PIP holds process improvement

information. date problem description proposed solution notes and comments

Page 44: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Coding and Counting Standards Coding and size counting standards are

needed to write the PSP programs. These standards are

tailored to your language and needs designed to make size counting easier

The coding standard defines quality-oriented exit criteria for the code phase.

Page 45: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

PSP Software Size Measures In the PSP, software size measures are used

to relate the amount of product produced with

effort expended to project total effort calculate productivity normalize defects project the total defects

Software size is measured in LOC. To accurately relate size to effort, the

different types of LOC in your program are counted separately.

Page 46: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

PSP0.1 Project Plan Summary PSP0.1 adds the Program Size Summary

for estimated and actual size data. The types of size include

base [B] deleted [D] modified [M] added [A] reused [R] added and modified [A+M] new reusable

Page 47: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU 47

Program Size Type Relationships

Added & Modified

Base program New program

Deleted

Added

Untouched

Modified

New Reusable

Reused

Page 48: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Estimating Size During planning1. If this is an enhancement, measure the

size of the base program and enter this in the Base (B) space under Actual.

2. Estimate the added and modified size and enter this in the Total Added and Modified (A+M) space under Plan.

Page 49: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Estimating Development Time During planning 1. Enter estimated development time2. Planned time in phase is then calculated

based on the percentage of time in phase for all completed projects

Page 50: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Recording Size - 1 During postmortem1. Measure total program size and enter this

in the Total Size (T) space under Actual. 2. Count the deleted size and enter this in

the Deleted (D) space under Actual. 3. Count the modified size and enter this in

the Modified (M) space under Actual.

Page 51: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Recording Size - 2 During postmortem1. Count the reused size and enter this in

the Reused (R) space under Actual. 2. Count or estimate the number of new

and changed size that will be added to the reuse library and in the New Reusable space und Actual

Page 52: CS 350: Introduction to Software Engineering

Fall 2005 CS 350/ODU

Message to Remember Your principal objective is to

measure and estimate the size of the programs that you produce so that you can effectively plan and manage your work.