PSP - 人机交互与虚拟现实研究中心
Download
Report
Transcript PSP - 人机交互与虚拟现实研究中心
Chapter 5
Product planning
In the chapter
How to use time log data to
make product plan;
Job Number Log(作业编号日志
)
Track historical product data
山东大学齐鲁软件学院
2
The need for product
plans
Making plans had a dramatic
effect.
Planning is a critical part of a
software engineer’s job
To be an effective engineer,you
need to know how to make
plans
The key is practice!
Start making plan now!
山东大学齐鲁软件学院
3
Purpose of product
plan
Help you judge how much time the
work will take and when you will
finish. Plans also help you track
progress while doing the work.
When you’re among a team, you
need product plan to coordinate your
work on joint products.
Businesses use product plan to plan
and manage their work---to
estimate, to schedule.
A well-made plan includes a project
cost estimate.
山东大学齐鲁软件学院
4
Purpose of product
plan
Engineers use product plan to
understand project status.
Judge where a project stands against
the plan
When engineers make plans, they
can better organize their time and
avoid last time crises
山东大学齐鲁软件学院
5
What is a product
plan?
A properly produced product plan
includes three things:
The size and important features of the
product to be produced;
An estimate of the time required to do
the work;
A projection of the schedule.
Planning for large and small tasks
Three basic plan elements:
size estimates, projected hours,
and the schedule.(规模估计、项目时间
、项目日程)
山东大学齐鲁软件学院
6
Product planning in
this book
Product planning is a skill that can be
improved with practice.
Develop your planning skills.
The most basic product plan would
consist of only the estimate of time
needed to do a task or job.
By gathering data in the past,you
can predict how long similar tasks
will likely take in the future.
山东大学齐鲁软件学院
7
Some definitions
Product: is something you produce
for a co-worker, an employer or a
customer.
Project: typically produce a product.
Task: is a defined element of work.
Process: describe the way do the
project.
Plans: describe the way a specific
project is to be done. How, when and
at what cost
Job: is something you do, either a
product or a task.
山东大学齐鲁软件学院
8
Job number log
See Table 5.1 (p49) for the format of
Job number log.
See table 5.2 (p50)for an example of
Job number log which extract data
from table 5.3(p51) Time log.
Understanding meanings of each
item in table 5.1, see Table 5.4
(p52).
山东大学齐鲁软件学院
9
【作业编号日志】
作
业
号
日期
过程
估计数据
时间
单元
实际数据
时间
单元
累 计 数 据
平均
值
时间
单元
平均
值
最大
值
最小
值
描述:
描述:
描述:
描述:
描述:
山东大学齐鲁软件学院
10
作业编号日志
作业编号日志是一份产品计划文
档,是记录生产产品时估计的和实
际的时间数据的一种工具。
作业编号日志中用到的时间数据
来自于时间记录日志。
山东大学齐鲁软件学院
11
山东大学齐鲁软件学院
12
Job number log .vs.
time recording log
Job number log:designed to
record estimated and actual
time data, it deal with product
data.
time recording log and weekly
activity summary contain data
on weekly period, they are
period planning documents.
山东大学齐鲁软件学院
13
山东大学齐鲁软件学院
14
Some suggestions on
using the job number log
When to guess(猜测) and when
to estimate(估计)
The first jobs of a given
type, you have to guess
since there is no perior data.
In estimating the time for a
new job, you may use the To
Date Rate for the most
recent perior job of the same
type.
Add a column of Job # in the
Time Recording Log.
山东大学齐鲁软件学院
15
Using Job number log to
make a plan for next week
To estimate the times for the
next week product, look in Job
number Log and get most
recent product time and to date
rates data of the same type
work and then make an
estimate by that data.
Considering the new features of
the new job that different to old
jobs of the same type.
山东大学齐鲁软件学院
16
使用作业编号日志制定基本的
产品计划
假设现在要编写两个程序,其中一个程序比以
前做过的任何一个程序都复杂,另一个为中等难
度,试估计编写这两个程序所要用的时间。
查看作业编号日志,这里记录着编写前三个程
序的平均时间是113.7分钟,最长时间是158分
钟。
中等难度的程序大约会用2小时即120分钟;
比较复杂的程序至少要用158分钟甚至更长的时间
。为了保险起见,假定这个复杂的程序要用3.5个
小时即210分钟;
这两个程序的编程时间预计一共需要120+210=
330分钟。
山东大学齐鲁软件学院
17
Balanced estimate (均
衡估计)
A balanced set of estimates has about
as many overestimates as
underestimate.
The advantage of having balance
estimates is that on average your jobs
will take about as long as you
estimated.
The key to good estimating, however,
is to learn to make balanced estimates.
山东大学齐鲁软件学院
18
summary
When completed, the job number log
provides the average,maximum, and
minimum times taken to complete each
of your project so far.
You can use this information to plan
work for the next week.
山东大学齐鲁软件学院
19
Assignment 5
Record job number log for the work
you will do for this course. Using your
daily time logs to complete these
forms.
山东大学齐鲁软件学院
20
Chapter 6
Product size
This chapter
describe
How to:
Size measurement
Size estimate
More precise measure
山东大学齐鲁软件学院
22
The product
planning process
1. Making plan for each job you do
1. 审查相似项目数据
2. 原来花的时间
2. Compare the plan with actually did
3. Better understand the errors
4. Learn how to make better plans
Improper estimation is one of the
principle reasons for project failures.
山东大学齐鲁软件学院
23
山东大学齐鲁软件学院
24
Size measurement
平均阅读速率=337/77=4.38min/页
根据章的规模和以前的平均阅读速率(以分钟/页为
单位)来进行估计,就有可能作出比较准确的估计。
山东大学齐鲁软件学院
25
Some cautions on using
size measure
1. should consider the type of work ,not
just its size.
2. Depending on intent
read .vs. quick skim
3. Productivities for different kinds of
work will be quite different.
Reuse,modify…
4. Keep separate size and time records
for the different kinds of work.
山东大学齐鲁软件学院
26
Program Size
measurement
LOC (Lines of code)
JCL—Job Control Language (可交付的作业
控制语言)
Include: Statements, data define,
data declaration, input/output
formats define etc.
Exclude: Comments, empty lines.
The following C program has 3 LOC.
if(a>b) max=a;
else max=b;
printf(“The max number is%d\n”,max);
山东大学齐鲁软件学院
27
LOC用于公司统计
一代码行(1LOC)的价值和人月均代码行数可以
体现一个软件生产组织的生产能力
例如,某软件公司统计发现该公司每一万行C语言
源代码形成的源文件(.c和.h文件)约为250K。
某项目的源文件大小为3.75M,则可估计该项目
源代码大约为15万行,该项目累计投入工作量为
240人月,每人月费用为10000元(包括人均工资
、福利、办公费用公滩等),则:
该项目中1LOC的价值为:
(240×10000)/150000=16元/LOC
该项目的人月均代码行数为:
150000/240=625LOC/人月
山东大学齐鲁软件学院
28
Program Size
measurement
Consistent in the way you write
program.
风格一致
Adopt a standard format.
Track the minutes/LOC rate and base
estimates on the rate achieved with
your most recent 5~10 programs.
能力不断提高
山东大学齐鲁软件学院
29
Program Size
measurement
山东大学齐鲁软件学院
30
Size categories(1)
Base When an existing product is
enhanced, base LOC is the size of
the original product version before
any modifications are made.
Added The code written for a new
program or added to an existing
base program.
Modified The modified LOC is that
base code in an existing program
that is changed.
山东大学齐鲁软件学院
31
Size categories(2)
Deleted The deleted LOC is that
base code in an existing program
that is deleted.
New and Changed When
engineers develop software, it takes
them much more time to add or
modify a LOC than it does to delete
or reuse one. Thus, in the PSP,
engineers use only the added or
modified code to make size and
resource estimates. This code is
called the New and Changed LOC.
山东大学齐鲁软件学院
32
Size categories(3)
Reused The code that is taken from a
reuse library and used without
modification in a new program or
program version. Reuse does not
count the unmodified base code
retained from a prior program version
and it does not count any code that is
reused with modifications.
New reuse The new reuse measure
counts the LOC that an engineer
develops and contributes to the reuse
library.
Total The total LOC is the total size of
a program, regardless of the source of
the code. 山东大学齐鲁软件学院
33
重用代码的估算问题
估计可重用代码量的最好办法就是由程序员或系统
分析员详细地考查已存在的代码,估算出新项目可
重用的代码中需重新设计的代码百分比、需重新编
码或修改的代码百分比以及需重新测试的代码百分
比。根据这三个百分比,可用下面的计算公式计算
等价新代码行:
等价代码行 = [(重新设计% +重新编码% +重新
测试%)/3]× 已有代码行
比如:有10,000行代码,假定30%需要重新设计
,50%需要重新编码,70%需要重新测试,那么
其等价的代码行可以计算为:
[ (30% + 50% + 70%)/3 ]× 10,000 =
5,000 等价代码行。
意即:重用这10000代码相当于编写5000代码行
的工作量。
山东大学齐鲁软件学院
34
Size accounting
N&C LOC = Added + Modified
Total LOC = Base – Deleted + Added
+ Reused
Note that neither the modified nor
the “new reuse” LOC are included in
the total.
A modified LOC can be
represented by a deleted and an
added LOC;
The “new reuse” LOC are already
accounted for in the added LOC.
山东大学齐鲁软件学院
35
Size accountingExample
A product of 100,000 LOC were used
to develop a new version
12,000 LOC of deleted code;
23,000 LOC of added code;
5,000 LOC of modified code;
3,000 LOC of reused code
N&C LOC = Added + Modified =
23,000 + 5,000 = 28,000 LOC
Total = 100,000 – 12,000 + 23,000
+ 3,000 = 114,000 LOC
山东大学齐鲁软件学院
36
LOC calculation
Formatted source code
LOC calculation
LOC/K
KLOC= 1000 LOC
山东大学齐鲁软件学院
37
LOC’s limits
LOC’s limits
It is defined on code. For example it
cannot measure the size of specification,
development documents, program
resources (Menu, Dialog, String table)
etc.
It characterize only one specific view of
size, namely length, it takes no account
of functionality or complexity.
Bad software design may cause
excessive line of code.
It is language dependent.
Users cannot easily understand it.
山东大学齐鲁软件学院
38
Other size measures
Industrial software development
involves documentation
count only the LOC you develop and
not the LOC generated by the
programming aids
The principal objective is to estimate
development work
山东大学齐鲁软件学院
39
Size estimate
Notice two different meanings of size
estimate
Just size estimate
Time estimate or effort estimate
Historical data about size
measurement
Size measurement based on
classification of program structures
Consideration of the difficulties of the
estimating program for time estimate
Algorithm, code reuse, technology
etc.
Not like pages for reading
山东大学齐鲁软件学院
40
Size estimating based on
classification of program
structures
See table 6.3 for small program size
measurement records
山东大学齐鲁软件学院
41
Estimating program
size
First, examine the requirements for
the program to be developed.
Then , rank the new program’s
relative size among the programs
you have already written.
Finally, based on your opinion of
where the new program will likely fall
in this historical size range,estimate
its likely LOC.
山东大学齐鲁软件学院
42
Table 6.4, 6.5 for large
program
山东大学齐鲁软件学院
43
较大程序规模的估计
首先查看新程序的需求;
建立起构造此程序的策略,此程序由一个repeat-
until循环、一个简单的选择语句和一个简单的计算组
成;分别估计
在作估计时,不能完全肯定各个程序的规模,所以对
每个功能都估计出一个最小规模、一个最大规模和一
个平均规模。假定该程序的最大规模值是这些典型功
能的规模值之和,即11+14+20=45LOC;取最大
规模值的一半作为该程序的最小规模值;最后取最大
规模值和最小规模值的中点作为该程序的平均规模值
没有任何方法可以保证估计的结果一定准确。规模
估计是一种技能。作出好的规模估计的关键是要有大
量的历史数据(组织成库),要进行多次规模估计,
并且要定期的将实际结果与估计值作比较。
山东大学齐鲁软件学院
44
Using size measurement
and estimate in Job
Number log
Record size measurement data in
time recording log and job number
log
Using historical statistic data to
estimate
对照前面表格学习,P69
山东大学齐鲁软件学院
45
山东大学齐鲁软件学院
46
山东大学齐鲁软件学院
47
Conclusion
Concept of size measurement
and size estimate
LOC and size accounting
Size estimate method based on
the classification of program
functions/structures.
山东大学齐鲁软件学院
48
Assignment 6
Taking account of unit in Time
Recording Log and Job Number
Log in later programming or
reading text job, and make an
estimation before doing a home
work.
山东大学齐鲁软件学院
49