Program 1 Assignment Kit

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Assignment Kit for

Program 1
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________

PSP Fundamentals

The Software Engineering Institute (SEI)


is a federally funded research and development center
sponsored by the U.S. Department of Defense and
operated by Carnegie Mellon University.

This material is approved for public release.


Distribution limited by the Software Engineering Institute to attendees.

Program 1

June 2010

2010 by Carnegie Mellon University

PSP Fundamentals
Assignment Kit for Program 1
Overview
This assignment kit covers the following topics.

Topics

Section

Prerequisites

Program 1

June 2010

See Page

Prerequisites

Program 1 requirements

Linked lists overview

Mean and standard deviation overview

Using mean and standard deviation in the PSP

Calculating mean and standard deviation

A mean and standard deviation example

Assignment instructions

Guidelines and evaluation criteria

12

PSP0 Grading Checklist

13

Reading
Chapters 1 and 2

2010 by Carnegie Mellon University

Program 1 requirements
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 a file. If necessary, you can
read the n real numbers from the keyboard, or some other source, but this is not
recommended.
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
Estimated Proxy
Size
160
591
114
229
230
270
128
1657
624
1503

Column 2
Development
Hours
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

June 2010

2010 by Carnegie Mellon University

Linked lists
Linked lists are a common abstract data type used to maintain collections of data.

Overview

Linked lists are implemented with pointers.


A linked list typically has two components.
list head
list node(s)
Pointer
to first node

HEAD

Pointer
to last node

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

June 2010

2010 by Carnegie Mellon University

Mean and standard deviation


The mean is the arithmetic average of a set of data. The mean is typically used to
locate an unbiased center (expectation value) for a data set. Other averages
include the middle value (median), and the most common value (mode). With
skewed distributions, the mean is especially useful because the more intuitive
median and mode can be misleading. In this exercise, average will be computed
as the mean. 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

xavg =

i =1

The formula for standard deviation, , is

(x x )
n

avg

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

June 2010

2010 by Carnegie Mellon University

A mean and standard deviation example


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

xavg =

i =1

n
1
2
3
4
5
6
7
8
9
10
Total

x
186
699
132
272
291
331
199
1890
788
1601
10

= 6389

i =1

3. We can then substitute the intermediate value into the formula.


6389
xavg =
10
xavg = 638.9
Continued on next page

Program 1

June 2010

2010 by Carnegie Mellon University

A mean and standard deviation example, Continued


A mean and
standard deviation
example, cont.

4. We can now substitute x avg to calculate the intermediate values for the
standard deviation formula.

(x x )
n

avg

i =1

n 1

1
2
3
4
5
6
7
8
9
10
Total

186
699
132
272
291
331
199
1890
788
1601
10

= 6389

i =1

(x x )

avg

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

(x

xavg ) = 3,522,760.90

i =1

5. We can then substitute the intermediate value into the formula.


3,522,760.00
=
9

= 391,417.878
= 625.633981

Program 1

June 2010

2010 by Carnegie Mellon University

Assignment instructions
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 programs


- Problem description
- PSP0 Project Plan Summary form
- Time and Defect Recording logs
- Defect Type standard
- Stopwatch (optional)

Step
1

Activities
Planning

Development

Postmortem

Description
- Produce or obtain a requirements statement.
- Estimate the required development time.
- Enter the plan data in the Project Plan Summary form.
- Complete the Time Recording log.
- Design the program.
- Implement the design.
- Compile the program, and fix and log all defects found.
- Test the program, and fix and log all defects found.
- Complete the Time Recording log.
Complete the Project Plan Summary form with actual time, defect, and size
data.

Exit Criteria

- A thoroughly tested program


- Completed Project Plan Summary form with estimated and actual data
- Completed Time and Defect Recording logs

Continued on next page

Program 1

June 2010

2010 by Carnegie Mellon University

Assignment instructions, Continued


Planning phase

Plan Program 1 following the PSP0 planning phase script.

PSP0 Planning Script


Purpose
Entry Criteria

To guide the PSP planning process


- Problem description
- Project Plan Summary form
- Time Recording log

Step
1

Activities
Program
Requirements

Resource
Estimate

Description
- Produce or obtain a requirements statement for the program.
- Ensure that the requirements statement is clear and unambiguous.
- Resolve any questions.
- Make your best estimate of the time required to develop this program.
- Enter the plan time data in the Project Plan Summary form.

Exit Criteria

- Documented requirements statement


- Completed Project Plan Summary form with estimated development time
data
- Completed 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 on next page

Program 1

June 2010

2010 by Carnegie Mellon University

Assignment instructions, Continued


Develop the program following the PSP0 development phase script.

Development
phase

PSP0 Development Script


Purpose
Entry Criteria

To guide the development of small programs


- Requirements statement
- Project Plan Summary form with estimated program development time
- Time and Defect Recording logs
- Defect Type standard

Step
1

Activities
Design

Code

Compile

Test

Description
- Review the requirements and produce a design to meet them.
- Record in the Defect Recording log any requirements defects found.
- Record time in the Time Recording log.
- Implement the design.
- Record in the Defect Recording log any requirements or design defects
found.
- Record time in the Time Recording log.
- Compile the program until error-free.
- Fix all defects found.
- Record defects in the Defect Recording log.
- Record time in the Time Recording log.
- Test until all tests run without error.
- Fix all defects found.
- Record defects in the Defect Recording log.
- Record time in the Time Recording log.

Exit Criteria

- A thoroughly tested program


- 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.
Continued on next page

Program 1

June 2010

10

2010 by Carnegie Mellon University

Assignment instructions, Continued


Conduct the postmortem following the PSP0 postmortem script.

Postmortem
phase

PSP0 Postmortem Script


Purpose
Entry Criteria

To guide the PSP postmortem process


- Problem description and requirements statement
- Project Plan Summary form with development time data
- Completed Time and Defect Recording logs
- A tested and running program

Step
1

Activities
Defect Recording

Defect Data
Consistency

Time

Description
- Review the Project Plan Summary to verify that all of the defects found in
each phase were recorded.
- Using your best recollection, record any omitted defects.
- Check that the data on every defect in the Defect Recording log are
accurate and complete.
- Verify that the numbers of defects injected and removed per phase are
reasonable and correct.
- Using your best recollection, correct any missing or incorrect defect data.
- Review the completed Time Recording log for errors or omissions.
- Using your best recollection, correct any missing or incomplete time data.

Exit Criteria

- A thoroughly tested program


- Completed Project Plan Summary form
- Completed Time and Defect Recording logs

Verify that you have met all of the exit criteria for the PSP0 postmortem phase, and then
review your assignment.

Program 1

June 2010

11

2010 by Carnegie Mellon University

Guidelines and evaluation criteria for Program 1


Reviewing your
assignment

Submitting your
assignment

Suggestions

Use the attached grading checklist to check your assignment. Ensure that your
assignment is correct before you submit it.
Your process data must be
complete
accurate
precise
self-consistent
When youve completed your review, submit your assignment.
.mdb export file from your student workbook
source program listing
test results
Remember, you should complete this assignment today.
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

June 2010

12

2010 by Carnegie Mellon University

Grading Checklist - PSP0


Student
Instructor

Program

Accepted or Resubmit

Comments

Accepted
Resubmit

Legend

- O.K.

X - resubmit

Assignment Package
All files are included
Export from the student workbook (*.mdb file)
Source program listing
Test results

Comments

Program and Test Results


The program appears to be workable.
All required tests have been run.
The actual output is correct for each test.

Comments

Time Log
Time data are entered for all process steps.
Process steps are sequenced appropriately.
Time data are entered against the appropriate process
step.
Interrupt time is tracked appropriately.
Time data are complete and reasonable.
Times were recorded as the work was done.

Comments

Defect Log
Every defect has all required data.
Every defect, injection phase precedes removal phase.
Every defect has a fix time.
Defects injected in compile and test have fix numbers.
Defect descriptions describe what was changed.
Defect types are consistent with description.
Defect types are consistent with phase injected.
Defect types are assigned consistently.

Comments

Planning Summary
Planned total time has been entered correctly.

Comments

Consistency Checks
Defects removed are consistent with compile and test
phase time and program size.

Comments

PSP0 GC

June 2010

13

2010 by Carnegie Mellon University

Grading Checklist - PSP0


Comments
Consistency Checks
Total compile defect fix times are close to and no
greater than compile time.
Total test defect fix times are close to and no greater
than test time.
Defect dates & phases are consistent with the time log.
General
Followed the defined process.
Complete, consistent, and accurate process data were
collected.
The student did his or her own work.

PSP0 GC

June 2010

14

Comments

2010 by Carnegie Mellon University

You might also like