PSP Exercise
Completing the PSP
Forms
Objective
To be able to use the PSP forms to track your work.
Instructions
1. Review the Instructions for the Time Recording Log and Defect Tally.
2. Obtain blank copies of the form you need.
3. Read the attached Scenario that describes the work of Jim, a student
completing a class programming assignment. As you read and interpret
the
scenario, record the data in the appropriate places in the forms. If
you
are uncertain how to fill in the forms, refer to the form instructions
or
consult the instructor.
4. Print a copy of the Project Summary Form.
5. Complete the Project Summary From using the data from the Time Log
and
Defect Tally.
PSP Scenario
Jim begins work on Assignment 1 [8:00] by gathering all the resources
he needs to begin. He finds the problem statement in the textbook and
makes photocopies of the blank PSP forms he needs. He studies the
requirements in the assignment package, including the test
requirements, to be sure he understands them.
He guesses the project will take him 90 minutes. [8:16]
After taking a break for some coffee, Jim starts to design the program
[8:20]. He sketches out a diagram of the data structures, identifies
the major routines to carry out the functionality. He writes some
pseudocode for the central routine. Jim moves on to coding [8:41].
While working on coding, Jim is interrupted by a classmate who doesn't
understand how to get started. Jim spends 10 minutes explaining which
problem in the textbook to use and which forms are needed, then gets
back to coding. Jim finishes coding all the routines and double checks
to make sure he hasn't missed anything. [9:44]. Jim then takes a break
to stretch and breathe.
Jim turns on his computer [9:51] and begins entering his source code.
He spends some time typing his program and then makes a printout.
He finds one typo on the printout and fixes it
in the code. At
10:10 Jim compiles the program and gets an error message, missing
semicolon. Looking at the compiler output, Jim sees where the semicolon
belongs and corrects the source code [10:11]. Jim recompiles the
program and gets another error message, undeclared identifier [10:12].
Surprised, since he thought he declared this identifier, Jim searches
through the source code and discovers that the identifier he declared
had an underscore in it and this one didn't. He corrects the source
code, then quickly scans the source code and finds two more places
where he made the same mistake and also fixes them [10:15]. Jim again
recompiles the program and gets another error message, incorrect
parameter type [10:16]. Jim studies the code for a minute, sees the
error and fixes the source code [10:17]. Jim again recompiles the
program and gets an error message at the end of the program, unmatched
brace [10:18]. After reviewing the program logic for a few minutes, Jim
spots where the missing brace belongs and fixes the source code
[10:21]. Jim recompiles the program and this time there are no compile
errors reported [10:22]. Satisfied, he takes a break.
Jim checks his e-mail and replies to several messages [10:43]. Jim
loads the program and begins executing
the first test case [11:10]. The program prompts Jim for the input data
file name and Jim types it in, but nothing happens [11:11]. Jim invokes
the debugger, traces the program execution, and discovers it is in an
infinite loop. He studies the source code for the loop and spots a design
problem - a counter was not incremented within the loop. Jim corrects
the source code, recompiles the program and begins executing the first
test case again [11:22]. This time, the program outputs some results,
but the print format is wrong, so Jim can't tell if they're correct
[11:23]. Jim fixes the print format [11:25] and retries the first test
case. The format is OK now, but the answers are wrong [11:26]. Jim
reviews the program logic and looks at some variables with the
debugger. After studying the code and the results, Jim realizes his
initial design was flawed and it needs to be rewritten [11:43]. Jim
rewrites the routine and recompiles it [11:51]. There is one compile
error - Jim left out another semicolon, so he quickly corrects the
defect and recompiles the program [11:52]. This time there were no
errors. Jim re-executes the first test case and this time, the results
are correct [11:54]. Jim executes the next two test cases and both give
the correct results [11:57].
Jim then reviews his source code and adds a
few lines of documentation. He then recompiles the program to be sure
he didn't introduce a syntax error and the program compiles cleanly
[12:03]. Jim begins computing the Delta times on his Time Recording
Log. Then he totals the time in each phase and records it on his
Project Summary form. He runs the Lines of Code counter and finds
his program contains 74 lines. He finishes completing the Project Summary Form
at 12:15.
4/13/11 JD Added LOC guess, clarify design defect.