Program 3 Assignment Kit
Program 3 Assignment Kit
Program 3
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
PSP Fundamentals
Prerequisites Reading
• Chapters 8 and 9
Expected
results
Overview Linear regression is a way of optimally fitting to a set of data. We will use a
straight line. The regression selects the slope and intercept so that the sum total
of the distance squared, of each point to that line along the y axis, is smallest.
The equation to that line is
y = β 0 + β1 x
In Figure 1, the best fit regression line has parameters of β 0 = -4.0389 and β1 =
0.1681.
250
Actual Development Hours
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
sizes are used as the x values. In PROBE method B, plan added and modified
sizes 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, such as 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 .
2
If r 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 β 0 and β1 are
regression and
n
correlation ∑ xi yi − (nxavg yavg )
β1 = i =1 n
(
∑ xi2 − nxavg
2
)
i =1
β 0 = yavg − β1 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
• Σ 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 ( β 0 and β1 values)
and correlation coefficients rx , y and r 2 of the data in 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 )
β1 = 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
∑x
i =1
i = 3828 ∑y
i =1
i = 6389 ∑x
i =1
2
i = 2540284 ∑x y
i =1
i i = 4303108 ∑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.
β1 =
(4303108) − (10 * 382.8 * 638.9 )
(2540284) − (10 * 382.82 )
1857399
β1 = = 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 PSP2 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 PSP2 planning phase and the PROBE estimating
scripts.
PSP2 Planning Script
Purpose To guide the PSP planning process
Entry Criteria - Problem description
- PSP2 Project Plan Summary form
- Size Estimating, Task Planning, and Schedule Planning templates
- Historical size and time data (estimated and actual)
- Time Recording log
Verify that you have met all of the exit criteria for the planning phase, and then
have an instructor review your plan. After your plan has been reviewed,
proceed to the development phase.
(continued)
Exit Criteria - Completed estimated and actual entries for all pertinent size categories
- Completed PROBE Calculation Worksheet with size and time entries
- Plan and actual values entered on the Project Plan Summary
Development Develop the program following the PSP2 development phase script.
phase
PSP2 Development Script
Purpose To guide the development of small programs
Entry Criteria - Requirements statement
- Project Plan Summary form with estimated program size and
development time
- For projects lasting several days or more, completed Task Planning and
Schedule Planning templates
- Time and Defect Recording logs
- Defect Type standard and Coding standard
Exit Criteria - A thoroughly tested program that conforms to the Coding standard
- Completed Design Review and Code Review checklists
- Completed Test Report template
- Completed Time and Defect Recording logs
Verify that you have met all of the exit criteria for the development phase, and then
proceed to the postmortem phase.
Design Review your designs following the PSP2 design review script.
review
PSP2 Design Review Script
Purpose To guide you in reviewing detailed designs
Entry Criteria - Completed program design
- Design Review checklist
- Design standard
- Defect Type standard
- Time and Defect Recording logs
General Where the design was previously verified, check that the analyses
- covered all of the design
- were updated for all design changes
- are correct
- are clear and complete
Exit Criteria - A thoroughly tested program that conforms to the coding and size
counting standards
- Completed Design Review and Code Review checklists
- 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 PSP2 postmortem phase,
and then review your assignment.
Reviewing your Use the attached grading checklist to check your assignment. Ensure that your
assignment assignment is correct before you submit it.
Your process data must be
• complete
• accurate
• precise
• self-consistent
Submitting your When you’ve completed your review, submit your assignment.
assignment • .mdb export file from your student workbook
• PSP2 design review checklist
• code review checklist
• source program listing
• test results
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.
Student Program
Instructor
Accepted
Resubmit
General Comments
Followed the defined process.
Complete, consistent, and accurate process data was
collected.
The student did his or her own work.
Historical data are used in planning the work.