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:
  1. Read the requirements for the BogoSort problem.
  2. Write the code for the main method.
  3. Design the sorting algorithm.
  4. Implement the sorting algorithm.
  5. Compile all the code.
  6. 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.
  1. Write an algorithm to compute length of words in a sentence.
  2. Write the code for the method.
  3. Compile the code.   Fix one compile error.
  4. Write a JUnit test for the method.
  5. Compile the JUnit test for the method.
  6. Execute the JUnit test.  Repair one logic error (uninitialized total).
  7. Printout the source code, unit test, and execution output.

2.
  1. Guess how long it will take to write pig latin converter.
  2. Write a sample test input sentence in English.
  3. Determine what the corresponding pig latin result would be.
  4. Open a text editor.
  5. Write the code for the converter program.
  6. Save the file.
  7. Run javac at the command line to compile the file.
  8. Note two compile errors.
  9. Open the file in a text editor and correct the errors.
  10. Compile the file again - no errors.
  11. Execute the program at the command line.
  12. Enter the sample test input sentence.
  13. Observe a formatting error.
  14. Correct the code.
  15. Execute the program with different sentences.

3.
  1. Read the requirements for the Morse Code converter.
  2. Write the code for the hashmap of letters and codes.
  3. Write the method to retrieve the code for a letter.
  4. Compile the retrieve method.
  5. Write a JUnit test for the retrieve method.
  6. Execute the JUnit test.
  7. Write the code to lookup a letter given the code.
  8. Compile the lookup method.
  9. Write a driver for the entire application.
  10. Compile the driver.
  11. Correct compile errors.
  12. Execute the driver, providing an English sentence as input.
  13. Verify the correct results.

4.
  1. Study the requirements for the rock-scissors-paper tournament software.
  2. Design the core logic of determining who wins a rock-scissors-paper match.
  3. Translate the logic into written Java statements for a method that returns -1, 0, or 1.
  4. Design the tournament logic.
  5. Translate the tournament logic into written Java statements for a main method.
  6. Review the written code for correctness.
  7. Type the code into a source file.
  8. Compile the code.
  9. Correct compile errors.
  10. Execute the program.  
  11. Correct logic errors.
  12. Run the tournament for three rounds of play.

5.
  1. Study the requirements for the Traffic Jam interactive puzzle.
  2. Design the core logic of determining a valid puzzle move.
  3. Write the method signatures for the methods in the Puzzle class.
  4. Write the code for the isValidMove() method.
  5. Write the code for the remainder of the Puzzle class.
  6. Printout the code and inspect for errors.
  7. Use a Paint program to draw the images for the puzzle pieces.
  8. Save the images to .png files.
  9. Compile the code for the Puzzle class.
  10. Correct compile errors in the Puzzle class.
  11. Write the code for the user interface class.
  12. Compile the code for the UI.
  13. Correct compile errors in the UI.
  14. Execute the program.
  15. Correct logic errors.
  16. Execute the program and verify that the puzzle can be solved.