Assi gnmentKi tf or Pr ogr am 1 _________________________________________________________________________________ _________________________________________________________________________________ _________________________________________________________________________________ _________________________________________________________________________________ _________________________________________________________________________________
Per sonalSof t war ePr ocess( PSP)f orEngi neer s:Par tI
TheSof t wa r eEn gi neer i n gI ns t i t ut e( SEI ) i saf ed er al l yf u nd edr es ear c han dde v el o pmentc ent er s p o ns o r e db yt h eU. S.De pa r t me nto fDe f e n s ea nd o pe r at edb yCar negi eMel l onUni v er s i t y .
Program 1
October 2006
1
© 2006
by Carnegie Mellon University
Thi smat er i al i sappr ov edf orpubl i cr el eas e. Di s t r i but i onl i mi t edbyt heSof t war eEngi neer i ngI ns t i t ut et oat t endees .
Program 1
October 2006
2
© 2006
by Carnegie Mellon University
Pe r s ona lSof t wa r ePr oc es sf orEngi ne er s :Pa r tI Assi gnmentKi tf orPr ogr am 1 Over vi ew
Overview
This assignment kit covers the following topics. Section
Prerequisites
Program 1
See Page
Prerequisites
2
Program 1 requirements
3
Linked lists overview
4
Mean and standard deviation overview
5
Using mean and standard deviation in the PSP
5
Calculating mean and standard deviation
5
A mean and standard deviation example
6
Assignment instructions
8
Guidelines and evaluation criteria
12
Reading • Chapters 1 and 2
October 2006
3
© 2006
by Carnegie Mellon University
Pr ogr am 1r equi r ement s
Program 1 requirements
Using PSP0, write a program to calculate the mean and standard deviation of a set of n real numbers. Your program can read the n real numbers from the keyboard, a file, or some other source. Use a linked list to store the n numbers for the calculations. If necessary, a variable or static array(s), database, or other data structure(s) may be used to hold the data. Thoroughly test the program. At least two tests should use the data in the columns of Table 1. Expected results are provided in Table 2.
Column 1 Estimate Proxy Size
Column 2 Development Hours
160 591 114 229 230 270 128 1657 624 1503
15.0 69.9 6.5 22.4 28.4 65.9 19.4 198.7 38.8 138.2 Table 1
Test
Expected Value Mean Std. Dev 550.6 572.03 60.32 62.26
Table 1: Column 1 Table 1: Column 2
Actual Value Mean Std. Dev
Table 2
Program 1
October 2006
4
© 2006
by Carnegie Mellon University
Li nkedl i st s
Overview
Linked lists are a common abstract data type used to maintain collections of data. Linked lists are implemented with pointers. A linked list typically has two components. • list head • list node(s) Pointer to first node
Pointer to last node
HEAD
Pointers to next node NODE 1
NODE 2
Data
Data
...
NODE n-1
NODE n
Data
Data
null
Some of the options for linked list structure are • the list head can point to the first node, last node, or both • a list node can point to the next node, prior node, or both Null pointers are often used to indicate an empty list or the end of the list. Typical operations on a linked list include • add node • remove node • next node • prior node
Program 1
October 2006
5
© 2006
by Carnegie Mellon University
Meanandst andar ddevi at i on
The mean is the average of a set of data. The average is the most common measure of location for a set of numbers. The average locates the center of the data.
Overview
Standard deviation is a measure of the spread or dispersion of a set of data. The more widely the values are spread out, the larger the standard deviation. For example, say we have two separate lists of exam results from a class of 30 students; one ranges from 31% to 98%, the other from 82% to 93%. The standard deviation would be larger for the results of the first exam.
Using mean and standard deviation in the PSP
Mean and standard deviation are used to divide your historical size data into categories and size ranges. This will be discussed in more detail in Lecture 4 Estimating with PROBE II.
Calculating mean and standard deviation
The formula for calculating the mean is n
∑ x
i
i =1
xavg =
n
The formula for standard deviation, n
∑ ( x
i
σ
=
− xavg )
σ,
is
2
i =1
n −1
where • Σ is the symbol for summation • i is an index to the n numbers • x is the data in the set • n is the number of items in the set
Program 1
October 2006
6
© 2006
by Carnegie Mellon University
Ameanandst andar ddevi at i onexampl e
A mean and standard deviation example
In this example, we will calculate mean and standard deviation of the data in Table 3.
x
186 699 132 272 291 331 199 1890 788 1601 Table 3
1. In this example, there are 10 items in the data set. Therefore, we set n = 10. 2. We can now solve the summation items in the mean formula. n
∑ x
i
xavg =
i =1
n
n 1 2 3 4 5 6 7 8 9 10 Total
x 186 699 132 272 291 331 199 1890 788 1601 10
∑ x
i
= 6389
i =1
3. We can then substitute the intermediate value into the formula. xavg
xavg
Program 1
6389 =
=
October 2006
10 638.9
7
© 2006
by Carnegie Mellon University
Continued on next page
Program 1
October 2006
8
© 2006
by Carnegie Mellon University
Co nt i nu ed Ameanandst andar ddevi at i onexampl e,
A mean and standard deviation example, cont.
4. We can now substitute x avg to calculate the intermediate values for the standard deviation formula. n
∑ ( x σ
i
− xavg )
2
i =1
=
n −1
n
x
1 2 3 4 5 6 7 8 9 10 Total
186 699 132 272 291 331 199 1890 788 1601 10
∑ x
i
( x
i =1
x avg )
2
205,118.41 3,612.01 256,947.61 134,615.61 121,034.41 94,802.41 193,512.01 1,565,251.21 22,230.81 925,636.41 2
10
= 6389
i−
∑ ( x
i
−
xazvg )
=
3,522,761.90
i 1 =
5. We can then substitute the intermediate value into the formula. σ
Program 1
3,522,761 .00 =
9 391,417.878
σ
=
σ
= 625 .633981
October 2006
9
© 2006
by Carnegie Mellon University
As si gnme nti ns t r uc t i ons Before starting program 1, review the top-level PSP0 process script below to 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.
Assignment instructions
PSP0 Process Script Purpose Entry Criteria
To guide the development of module-level program - !ro"lem de#ription - !$!0 !ro%e#t !lan $ummar& form - Time and 'efe#t (e#ording log - 'efe#t T&pe tandard - $top)at#h *optional+
Step 1
Activities !lanning
2
'evelopment
3
!otmortem
Description - !rodu#e or o"tain a reuirement tatement. - timate the reuired development time. - nter the plan data in the !ro%e#t !lan $ummar& form. - omplete the Time (e#ording log. - 'eign the program. - /mplement the deign. - ompile the program, an d fi and log all defe#t found. - Tet the program, and fi and log all defe#t found. - omplete the Time (e#ording log. omplete the !ro%e#t !lan $ummar& form )ith a#tual time, defe#t, and ie data.
Exit Criteria
- thoroughl& teted program - ompleted !ro%e#t !lan $ummar& form )ith etimated and a#tual data - ompleted Time and 'efe#t (e#ording log
Continued on next page
Program 1
October 2006
10
© 2006
by Carnegie Mellon University
i nu ed As si gnme nti ns t r uct i ons ,Cont
Planning phase
Plan program 1 following the PSP0 planning phase script.
PSP0 Planning Script Purpose Entry Criteria
To guide the !$! planning pro#e - !ro"lem de#ription - !ro%e#t !lan $ummar& form - Time (e#ording log
Step 1
Activities !rogram (euirement
2
(eour#e timate
Description - !rodu#e or o"tain a reuirement tatement for the program. - nure that the reuirement tatement i #lear and unam"iguou. - (eolve an& uetion. - ae &our "et etimate of the time reuired to develop thi program. - nter the plan time data in the !ro%e#t !lan $ummar& form
Exit Criteria
- 'o#umented reuirement tatement - ompleted !ro%e#t !lan $ummar& form )ith etimated development time data - ompleted Time (e#ording log
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. Continued on next page
Program 1
October 2006
11
© 2006
by Carnegie Mellon University
i nu ed As si gnme nti ns t r uct i ons ,Cont
Develop the program following the PSP0 development phase script.
Development phase
PSP0 Development Script Purpose Entry Criteria
To guide the development of mall program - (euirement tatement - !ro%e#t !lan $ummar& form )ith etimated program development time - Time and 'efe#t (e#ording log - 'efe#t T&pe tandard
Step 1
Activities 'eign
2
ode
3
ompile
4
Tet
Description - (evie) the reuirement and produ#e a deign to meet them. - (e#ord in the 'efe#t (e#ording log an& reuirement defe#t found. - (e#ord time in the Time (e#ording log. - /mplement the deign. - (e#ord in the 'efe#t (e#ording log an& reuirement or deign defe#t found. - (e#ord time in the Time (e#ording log. - ompile the program until error-free. - 5i all defe#t found. - (e#ord defe#t in the 'efe#t (e#ording log. - (e#ord time in the Time (e#ording log. - Tet until all tet run )ithout error. - 5i all defe#t found. - (e#ord defe#t in the 'efe#t (e#ording log. - (e#ord time in the Time (e#ording log.
Exit Criteria
- thoroughl& teted program - ompleted Time and 'efe#t (e#ording log
Verify that you have met all of the exit criteria for the development phase, then proceed to the postmortem phase. Continued on next page
Program 1
October 2006
12
© 2006
by Carnegie Mellon University
i nu ed As si gnme nti ns t r uct i ons ,Cont
Postmortem phase
Conduct the postmortem following the PSP0 postmortem script.
PSP0 Postmortem Script Purpose Entry Criteria
To guide the !$! potmortem pro#e - !ro"lem de#ription and reuirement tatement - !ro%e#t !lan $ummar& form )ith development time data - ompleted Time and 'efe#t (e#ording log - teted and running program
Step 1
Activities 'efe#t (e#ording
2
'efe#t 'ata oniten#&
3
Time
Description - (evie) the !ro%e#t !lan $ummar& to verif& that all of the defe#t found in ea#h phae )ere re#orded. - 6ing &our "et re#olle#tion, re#ord an& omitted defe#t. - he# that the data on ever& defe#t in the 'efe#t (e#ording log are a##urate and #omplete. - 7erif& that the num"er of defe#t in%e#ted and removed per phae are reaona"le and #orre#t. - 6ing &our "et re#olle#tion, #orre#t an& miing or in#orre#t defe#t data. - (evie) the #ompleted Time (e#ording log for error or omiion. - 6ing &our "et re#olle#tion, #orre#t an& miing or in#omplete time data.
Exit Criteria
- thoroughl& teted program - ompleted !ro%e#t !lan $ummar& form - ompleted Time and 'efe#t (e#ording log
Verify that you have met all of the exit criteria for the PSP0 postmortem phase, then submit your assignment.
Submitting your assignment
When you’ve completed the postmortem phase, submit your assignment package, source code, and test results to the instructor. The order for the assignment package is • PSP0 Project Plan Summary form • Time Recording log • Defect Recording log • source program listing • test results
Program 1
October 2006
13
© 2006
by Carnegie Mellon University
Gui del i nesande val uat i oncr i t er i af orpr ogr am 1
Evaluation criteria
Your process report must be • complete • legible • in the specified order
Suggestions
Remember, you should complete this assignment today.
Your process data must be • accurate • precise • self-consistent
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. Software is not a solo business, so you do not have to work alone. You must, however, produce your own estimates, designs, code, and completed forms and reports. You may have others review your work, and you may change it as a result. You should note any help you receive from others in your process report. Log the review time that you and your associates spend, and log the defects found or any changes made.
Program 1
October 2006
14
© 2006
by Carnegie Mellon University