程建群 博士 (Dr. Jason Cheng) [email protected] 13522913536 2008 年 03 月 Software...

54
程程程 程程 (Dr. Jason Cheng) [email protected] 13522913536 2008 程 03 程 Software Engineering Part 04

Transcript of 程建群 博士 (Dr. Jason Cheng) [email protected] 13522913536 2008 年 03 月 Software...

Page 1: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

程建群 博士 (Dr. Jason Cheng)[email protected]

13522913536

2008 年 03 月

Software EngineeringPart 04

Page 2: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Software Project Planning

Page 3: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Software Project Planning

Planning is essential and software development is no exception.

Achieving success in software development requires planning.

Software project planning involves deciding what tasks need to be

done, in what order to do the tasks, and what resources are needed

to accomplish the tasks.

Page 4: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

WBS-Work Breakdown Structure

The work breakdown structure (WBS) should be a tree structure. The

top-level breakdown usually matches the life cycle model (LCM)

used in the organization. The next-level breakdown can match the

processes in the organization’s process model (PM). Further levels

are used to partition the task into smaller, more manageable tasks.

Page 5: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Rules for constructing a proper work breakdown structure:

The WBS must be a tree structure

Every task and deliverable description must be understandable

Every task must have a completion criterion (often a deliverable)

All deliverables (artifacts) must be identified.

Positive completion of the tasks must imply completion of the whole task.

WBS-Work Breakdown Structure

Page 6: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.1

In making a loaf of bread, the life cycle model for cooking:

WBS-Work Breakdown Structure

Page 7: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.1

The process model for cooking might be:

WBS-Work Breakdown Structure

Page 8: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.1

The subtasks might be as follows:

1. Choose ingredients

2. Check on ingredients

3. Assemble ingredients

4. Add liquids

5. Add yeast

6. Add small amount of flour

7. Make sponge (yeast and liquids)

WBS-Work Breakdown Structure

Page 9: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.1

8. Let rise first time

9. Add remaining flour

10. Knead

11. Let rise second time

12. Form into loaves

13. Let rise third time

14. Bake

15. Slice

WBS-Work Breakdown Structure

Page 10: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.1

16. Butter

17. Eat,

18. And Clean up

WBS-Work Breakdown Structure

Page 11: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.1

WBS-Work Breakdown Structure

These can be divided into the phases of the life cycle model and pr

ocesses of the process model (the leftmost are LCMs, those with on

e indent are PMs, those with two indents are tasks, and the delivera

ble are on the right):

Select food

Choose ingredients List of ingredients

Check on ingredients Shopping list

Assemble ingredientsAssemble ingredients Assembled ingredients

Page 12: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.1

WBS-Work Breakdown Structure

Cook food

Mix

Add liquids Liquid in bowl

Add yeast Liquids with yeast

Add small amount of flour Liquids and flour

Make sponge (yeast and liquids) Sponge

Let rise first time Risen sponge

Add remaining flour and knead Kneaded dough

Let rise second time Risen dough

Form into loaves Loaves

Let rise third time Risen loaves

Page 13: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.2

WBS-Work Breakdown Structure

Team XYZ wants to develop a face recognition system for use on

the robot. The system is intended to greet visitors to the robotics

laboratory. It should recognize faces it has seen before with a

reasonable reliability. The first pass on the work breakdown might

recognize the following subtasks:

Page 14: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.2

WBS-Work Breakdown Structure

Feasibility

Determine feasibility of vision

Determine camera and software availability

Schedule camera and vision software acquisition

Risk Analysis

Determine vision risks

Requirements

Specify requirements

Page 15: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.2

WBS-Work Breakdown Structure

Design

Design prototypes

Prototype vision

Page 16: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Software Cost Estimation

The task of software cost estimation is to determine how many

resources are needed to complete the project. Usually this estimate

is in programmer-months (PM).

Page 17: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Two different approaches to cost estimation

Software Cost Estimation

The older approach is called LOC estimation. The newer approach is based on counting function points in the

project description.

Page 18: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Estimation of Lines of Code (LOC)

Software Cost Estimation

The first step in LOC-based estimation is to estimate the number of

lines of code in the finished project.

This can be done based on experience, size of previous projects,

size of a competitor’s solution, or by breaking down the project into

smaller pieces and then estimating the size of each of the smaller

pieces.

Page 19: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Estimation of Lines of Code (LOC)

Software Cost Estimation

A standard approach is, for each piece, to estimate the maximum

possible size, max, the minimum possible size, min, and the best

size, best.

The estimate for the whole project is 1/6 of the sum of the

maximums, the minimums, and 4 times the best guess:

Page 20: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.3

Software Cost Estimation

Team WRT had identified s

even subpieces as following

table with their estimates of

the size of each subpiece.

Page 21: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.3

Software Cost Estimation

The estimates for each section are as follows:

Page 22: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.3

Software Cost Estimation

The estimates for the whole project is the sum of the estimates for

each section:

Whole = 31.6 + 15.8 + 31.6 + 36.7 + 20 + 12 + 22.17 = 170.07 LOC

Page 23: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.3

Software Cost Estimation

The estimate for the standard deviation of the estimate is as

follows:

Page 24: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Constructive Cost Model (COCOMO)

Software Cost Estimation

COCOMO is the classic LOC cost-estimation formula. It was

created by Barry Boehm in the 1970s. He used thousand delivered

source instructions (KDSI) as his unit of size. KLOC is equivalent.

His unit of effort is the programmer-month (PM).

Page 25: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Constructive Cost Model (COCOMO)

Software Cost Estimation

Boehm divided the historical project data into three types of

projects:

1. Application

2. Utility programs

3. System programs

Page 26: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Constructive Cost Model (COCOMO)

Software Cost Estimation

Boehm determined the values of the parameters for the

cost model for determining effort:

Page 27: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Example 4.5

Software Cost Estimation

Calculate the

programmer effort

for projects from 5

to 50 KDSI.

The COCOMO

Effort:

Page 28: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

The idea of function points is to identify and quantify the

functionality required for the project. The idea is to count

things in the external behavior that will require

processing. The classic items to count are as follows: Inputs Outputs Inquiries Internal files External interfaces

Page 29: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

Inputs

Inputs are items of application data that is supplied to the

program. The logical input is usually considered one item

and individual fields are not usually counted separately.

For example, the input of personal data for an employee

might be considered one input.

Page 30: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

Outputs

Outputs are displays of application data. This could be a

report, a screen display, or an error message. Again,

individual fields are usually not considered separate

outputs. If the report has multiple lines, for instance, a line

for each employee in the department, these lines would all

be counted as one output. However, some authorities

would count summary lines as separate outputs.

Page 31: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

Inquiries

Inquiries are request-response pairs that do not change

the internal data. For example, a request for the address of

a specified employee is an inquiry. The whole sequence of

asking, supplying the name, and getting the address would

count as one inquiry.

Page 32: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

Internal files

Internal files are the logical files that the customer

understands must be maintained by the system. If an

actual file contained 1000 entries of personnel data, it

would probably be counted as one file. However, if the file

contained personnel data, department summary data, and

other department data, it would probably be counted as

three separate files for the purposes of counting function

points.

Page 33: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

Counting Unadjusted Function Points

The individual function point items are identified and then

classified as simple, average, or complex. The weights

from following table are then assigned to each item and

the total is summed. This total is called the unadjusted

function points.

Function points are trying to measure the amount of effort

that will be needed to develop the software.

Page 34: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

Counting Unadjusted Function Points

The individual function point items are identified and then

classified as simple, average, or complex. The weights

from following table are then assigned to each item and

the total is summed. This total is called the unadjusted

function points.

Function points are trying to measure the amount of effort

that will be needed to develop the software.

Page 35: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

Function Points Weight

Page 36: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

Example 4.7

The department wants a program that assigns times and

rooms for each section and creates a line schedule for the

courses. The department has a list of sections with the

name of the assigned professor and the anticipated size.

The department also has a list of rooms with the maximum

number of students each room will hold. There are also

sets of classes that cannot be taught at the same time.

Additionally, professors cannot teach two courses at the

same time.

Page 37: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

Example 4.7

The program is much more difficult than the complexity of

the inputs and outputs. It has two main inputs: the file with

the list of section, assigned professor, and anticipated size,

and the file with the list of rooms with the maximum size.

These two files, although simple to read, will be difficult to

process, so they will be rated complex. There will be an

additional file with the sets of classes that cannot be

taught at the same time. Again, this file is simple in

structure but will be difficult to process. The last line has a

restriction that is not an input or output.

Page 38: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Function Point Analysis

Software Cost Estimation

Example 4.7

There is an output, the line schedule. This is a complex

output. There are no inquires or interfaces mentioned, nor

any mention about files being maintained.

Page 39: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Productivity

Software Cost Estimation

One of the important measures is the productivity of the

software developers. This is determined by dividing the

total size of the finished product by the total effort of all

the programmers. This has units of LOC/programmer-day.

An alternative is to measure the productivity in terms of

function points per programmer-day.

Productivity includes all the effort spent in all phases of the

software life cycle.

Page 40: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Productivity

Software Cost Estimation

Company XYZ spent the following effort for each life cycle

phase of the latest project (see the next table). Calculate the

effort in terms of LOC/programmer-day and in terms of

function points/programmer day. The function point

estimate was 50 unadjusted function points. The finished

project included 950 lines of code.

Example 4.8

Page 41: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Productivity

Software Cost Estimation

Example 4.8

Effort during Phrases

Page 42: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Productivity

Software Cost Estimation

Example 4.8

The total effort was 65 programmer-days. This gives a productivity of 950/65 = 14.6 lines of code/programmer-days. Using unadjusted function points (fp), the productivity is 50 fp/65 days = 0.77 fp/programmer-days.

Page 43: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Evaluating Estimations

Software Cost Estimation

To evaluate estimations, a measure needs to be calculated. Tom DeMarco proposed the estimate quality factor (EQF). DeMarco defines the EQF as the area under the actual curve divided by area between the estimate and the actual value. This is the inverse of the percentage error or the mean relative error. Thus, the higher the EQF, the better was the series of estimates. DeMarco said that values over 8 are reasonable.

Page 44: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Evaluating Estimations

Software Cost Estimation

Example 4.8

The following estimates were given for a project that cost

3.5 million dollars when it was completed after 11.5

months:

Page 45: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Evaluating Estimations

Software Cost Estimation

Example 4.8

The total area is 11.5 months times 3.5 million = 40.25

million month-dollars. The difference between the actual

curve and the estimate is |2.3 – 3.5| * 1.5 + |3.1 – 3.5| * 4 +

|3.9 – 3.5| * 2.5 + |3.4 – 3.5| * 3.5 = 4.75 million month-

dollars. The ratio is 40.25/4.75 = 8.7.

Page 46: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Automated Estimation Tools

Software Cost Estimation

Numerous tools are available on the internet that will

calculate COCOMO or COCOMO2. Most have very simple

interfaces. Search for COCOMO using any browser, and it

should find multiple sites.

Page 47: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Review Questions

Software Cost Estimation

What is the distinction between a WBS and a process model? Why should a WBS be a tree? It is very common to use the default version of estimation. Consider the last time someone asked you to give an estimate of anything. Was the estimate you gave the default definition of an estimate or DeMarco’s proposed definition of an estimate?

Page 48: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Review Questions

Software Cost Estimation

What is the distinction between a WBS and a process

model?A process model describes the software activities in a generic

sense, that is, for many different projects. It describes the process,

the artifacts produced and used, and the actor responsible for the

activities. A process model is a graph; it can have cycles and so on.

A work breakdown structure is a tree that expands the process

model’s activities with details and necessary subtasks that are

specific for a particular project. A WBS task that appears in every

project should also be in the process model.

Page 49: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Review Questions

Software Cost Estimation

Why should a WBS be a tree?

If there are loops in a WBS, it means that some task

recursively depends on itself, which is impossible. A loop will

normally happen when some task is not defined properly. If

there are two paths to a task, it normally means that two

different higher-level tasks depend on that common subtask.

It only needs to be shown once.

Page 50: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Review Questions

Software Cost Estimation

It is very common to use the default version of estimation. Consider the last time someone asked you to give an estimate of anything. Was the estimate you gave the default definition of an estimate or DeMarco’s proposed definition of an estimate?

Page 51: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Problems

Software Cost Estimation

Create a WBS for the task of painting a room. Assume that

the process model is for home work projects with activities:

plan work, but supplies, do work, clean up.

Page 52: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Problems

Software Cost Estimation

Create a WBS for the task of painting a room. Assume that

the process model is for home work projects with activities:

plan work, but supplies, do work, clean up.

Page 53: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Problems

Software Cost Estimation

Create a WBS for the task of painting a room.

Assume that the process model is for home work projects

with activities: plan work, but supplies, do work, clean up.

Page 54: 程建群 博士 (Dr. Jason Cheng) Jason_beihang@yahoo.cn 13522913536 2008 年 03 月 Software Engineering Part 04.

Software Engineering 2007 - 2008

Software Project Planning

Software Cost Estimation

Create a WBS for the task of painting a room.A, Select color for room Color decidedB, Buy paint Cans of paintC, Buy brushes BrushesD, Prepare walls Clean wallsE, Open paint cans Opened cansF, Stir paint Stirred paintG, Paint walls Painted wallsH, Clean up Cleaned and painted walls