PSP exercise - identify conformance to script
Each problem below presents a sequence of developer activities.
Assess whether the programmer was conforming to the PSP0 process script.
If not, explain why, referring to the lettered sequence steps.
(Don't consider omissions; only consider actions performed out of
order.)
Write your answers on your own paper.
Sample:
- Read the requirements for the BogoSort problem.
- Write the code for the main method.
- Design the sorting algorithm.
- Implement the sorting algorithm.
- Compile all the code.
- Test all the code.
Answer: No the programmer did not
follow the PSP0 script because he or she wrote code then in step (c)
returned to the design phase. All design must be completed before
any coding begins.
1.
- Write an algorithm to compute length of words in a sentence.
- Write the code for the method.
- Compile the code. Fix one compile error.
- Write a JUnit test for the method.
- Compile the JUnit test for the method.
- Execute the JUnit test. Repair one logic error
(uninitialized total).
- Printout the source code, unit test, and execution output.
2.
- Guess how long it will take to write pig latin converter.
- Write a sample test input sentence in English.
- Determine what the corresponding pig latin result would be.
- Open a text editor.
- Write the code for the converter program.
- Save the file.
- Run javac at the command line to compile the file.
- Note two compile errors.
- Open the file in a text editor and correct the errors.
- Compile the file again - no errors.
- Execute the program at the command line.
- Enter the sample test input sentence.
- Observe a formatting error.
- Correct the code.
- Execute the program with different sentences.
3.
- Read the requirements for the Morse Code converter.
- Write the code for the hashmap of letters and codes.
- Write the method to retrieve the code for a letter.
- Compile the retrieve method.
- Write a JUnit test for the retrieve method.
- Execute the JUnit test.
- Write the code to lookup a letter given the code.
- Compile the lookup method.
- Write a driver for the entire application.
- Compile the driver.
- Correct compile errors.
- Execute the driver, providing an English sentence as input.
- Verify the correct results.
4.
- Study the requirements for the rock-scissors-paper tournament
software.
- Design the core logic of determining who wins a
rock-scissors-paper match.
- Translate the logic into written Java statements for a method
that returns -1, 0, or 1.
- Design the tournament logic.
- Translate the tournament logic into written Java statements for a
main method.
- Review the written code for correctness.
- Type the code into a source file.
- Compile the code.
- Correct compile errors.
- Execute the program.
- Correct logic errors.
- Run the tournament for three rounds of play.
5.
- Study the requirements for the Traffic Jam interactive puzzle.
- Design the core logic of determining a valid puzzle move.
- Write the method signatures for the methods in the Puzzle class.
- Write the code for the isValidMove() method.
- Write the code for the remainder of the Puzzle class.
- Printout the code and inspect for errors.
- Use a Paint program to draw the images for the puzzle pieces.
- Save the images to .png files.
- Compile the code for the Puzzle class.
- Correct compile errors in the Puzzle class.
- Write the code for the user interface class.
- Compile the code for the UI.
- Correct compile errors in the UI.
- Execute the program.
- Correct logic errors.
- Execute the program and verify that the puzzle can be solved.