Assignment Kit For Program 3: Personal Software Process (PSP) For Engineers: Part I
Assignment Kit For Program 3: Personal Software Process (PSP) For Engineers: Part I
Assignment Kit For Program 3: Personal Software Process (PSP) For Engineers: Part I
Program 3
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
Prerequisites Reading
• Chapters 5 and 6
Expected
results
Overview Linear regression is a way of optimally fitting a line to a set of data. The linear
regression line is the line where the distance from all points to that line is
minimized. The equation of a line can be written as
y = b 0 + b1 x
In Figure 1, the best fit regression line has parameters of b 0 = -4.0389 and b1 =
0.1681.
250
200
y = -4.0389 +0.1681x
150
100
50
0
0 200 400 600 800 1000 1200
Estimated Proxy Size
Figure 1
Using regression in Looking at Figure 1, how many hours do you think it would take to develop a
the PSP program with an estimated proxy size of 500?
The PSP PROBE method uses regression parameters to make better predictions
of size and time based on your historical data.
PROBE methods A and B differ only in the historical data (x values) used to
calculate the regression parameters. In PROBE method A, estimated proxy size
are used as the x values. In PROBE method B, plan added and modified size
are used as the x values.
PROBE methods for size and time differ only in the historical data (y values)
used to calculate the regression parameters. To predict improved size estimates,
actual added and modified LOC are used as the y values. To predict time
estimates, actual development times are used as the y values.
Overview The correlation calculation determines the relationship between two sets of
numerical data.
Using correlation Correlation is used in the PSP to judge the quality of the linear relation in various
in the PSP historical process data that are used for planning. For example, the relationships
between estimated proxy size and actual time or plan added and modified size
and actual time.
For this purpose, we examine the value of the relation rxy squared, or r 2 .
If r 2 is the relationship is
.9 £ r 2 predictive; use it with high confidence
.7 £ r 2 < .9 strong and can be used for planning
.5 £ r 2 < .7 adequate for planning but use with caution
r 2 < .5 not reliable for planning purposes
Calculating The formulas for calculating the regression parameters b 0 and b1 are
regression and
æ n ö
correlation ç å xi yi ÷ - (nxavg yavg )
b1 = è i =1 n ø
æ ö
ç å xi2 ÷ - nxavg
2
( )
è i =1 ø
b 0 = yavg - b1 xavg
æ n ö æ n öæ n ö
nç å xi yi ÷ - ç å xi ÷ç å yi ÷
rx , y = è i =1 ø è i =1 øè i =1 ø
é æ n 2 ö æ n ö2 ù é æ n 2 ö æ n ö2 ù
ênç å xi ÷ - ç å xi ÷ ú ênç å yi ÷ - ç å yi ÷ ú
ëê è i =1 ø è i =1 ø ûú ëê è i =1 ø è i =1 ø ûú
r2 = r *r
where
• S is the symbol for summation
• i is an index to the n numbers
• x and y are the two paired sets of data
• n is the number of items in each set x and y
• x avg is the average of the x values
• yavg is the average of the y values
An example In this example, we will calculate the regression parameters ( b 0 and b1 values)
and correlation coefficients rx , y and r 2 of the data in the Table 3.
n x y
1 130 186
2 650 699
3 99 132
4 150 272
5 128 291
6 302 331
7 95 199
8 945 1890
9 368 788
10 961 1601
Table 3
æ n ö
ç å xi yi ÷ - (nxavg yavg )
b1 = è i =1 n ø
æ ö
(
ç å xi2 ÷ - nxavg
2
)
è i =1 ø
1. In this example there are 10 items in each dataset and therefore we set n =
10.
2. We can now solve the summation items in the formulas.
n x y x2 x*y y2
1 130 186 16900 24180 34596
2 650 699 422500 454350 488601
3 99 132 9801 13068 17424
4 150 272 22500 40800 73984
5 128 291 16384 37248 84681
6 302 331 91204 99962 109561
7 95 199 9025 18905 39601
8 945 1890 893025 1786050 3572100
9 368 788 135424 289984 620944
10 961 1601 923521 1538561 2563201
Total 10 10 10 10 10
å xi = 3828
i =1
å yi = 6389
i =1
å xi2 = 2540284
i =1
å xi yi = 4303108
i =1
åy
i =1
2
i = 7604693
3828 6389
xavg = = 382.8 yavg = = 638.9
10 10
An example, cont. 3. We can then substitute the values into the formulas
b1 =
(4303108) - (10 * 382.8 * 638.9)
(2540284) - (10 * 382.82 )
1857399
b1 = = 1.727932
1074926
10(4303108) - (3828)(6389 )
rx , y =
[10(2540284) - (3828) ][10(7604693) - (6389) ]
2 2
18573988 18573988
rx , y = rx , y =
[10749256][35227609] 19459460.1
rx , y = 0.9545
r 2 = 0.9111
Assignment Before starting program 3, review the top-level PSP1 process script below to
instructions ensure that you understand the “big picture” before you begin. Also, ensure that
you have all of the required inputs before you begin the planning phase.
Planning phase Plan program 3 following the PSP1 planning phase and the PROBE estimating
scripts.
PSP1 Planning Script
Verify that you have met all of the exit criteria for the planning phase, then have
an instructor review your plan. After your plan has been reviewed, proceed to
the development phase.
Purpose To guide the size and time estimating process using the PROBE method
Entry Criteria - Requirements statement
- Size Estimating template and instructions
- Size per item data for part types
- Time Recording log
- Historical size and time data
General - This script assumes that you are using added and modified size data as
the size-accounting types for making size and time estimates.
- If you choose some other size-accounting types, replace every “added
and modified” in this script with the size-accounting types of your choice.
Step Activities Description
1 Conceptual Design Review the requirements and produce a conceptual design.
2 Parts Additions Follow the Size Estimating Template instructions to estimate the parts
additions and the new reusable parts sizes.
3 Base Parts and - For the base program, estimate the size of the base, deleted, modified,
Reused Parts and added code.
- Measure and/or estimate the size of the parts to be reused.
4 Size Estimating - If you have sufficient estimated proxy size and actual added and modified
Procedure size data (three or more points that correlate), use procedure 4A.
- If you do not have sufficient estimated data but have sufficient plan
added and modified and actual added and modified size data (three or
more points that correlate), use procedure 4B.
- If you have insufficient data or they do not correlate, use procedure 4C.
- If you have no historical data, use procedure 4D.
4A Size Estimating - Using the linear-regression method, calculate the b 0 and b 1 parameters
Procedure 4A
from the estimated proxy size and actual added and modified size data.
- If the absolute value of b 0 is not near 0 (less than about 25% of the
expected size of the new program), or b 1 is not near 1.0 (between about
0.5 and 2.0), use procedure 4B.
4B Size Estimating - Using the linear-regression method, calculate the b 0 and b 1 parameters
Procedure 4B
from the plan added and modified size and actual added and modified
size data.
- If the absolute value of b 0 is not near 0 (less than about 25% of the
expected size of the new program), or b 1 is not near 1.0 (between about
0.5 and 2.0), use procedure 4C.
4C Size Estimating If you have any data on plan added and modified size and actual added and
Procedure 4C modified size, set b 0 = 0 and b 1 = (actual total added and modified size to
date/plan total added and modified size to date).
4D Size Estimating If you have no historical data, use your judgment to estimate added and
Procedure 4D modified size.
(continued)
Development Develop the program following the PSP1 development phase script.
phase
PSP1 Development Script
Verify that you have met all of the exit criteria for the development phase, then
proceed to the postmortem phase.
Postmortem
phase Conduct the postmortem following the PSP1 postmortem script.
Exit Criteria - A thoroughly tested program that conforms to the coding and size
counting standards
- Completed Test Report template
- Completed Project Plan Summary form
- Completed PIP forms describing process problems, improvement
suggestions, and lessons learned
- Completed Time and Defect Recording logs
Verify that you have met all of the exit criteria for the PSP1 postmortem phase, then
submit your assignment.
Submitting your When you’ve completed the postmortem phase, submit your assignment
assignment package, source code, and test results to the instructor.
Keep your programs simple. You will learn as much from developing small
programs as from large ones.
If you are not sure about something, ask your instructor for clarification.