Lab 11

Program 4 Evaluation

April 7, 2005

Lab Partners

Everyone should work with one lab partner on this assignment.

Purpose

The purpose of this lab is to give you experience evaluating code. Often, by carefully looking at someone else's code, you gain new ideas and can consequently improve your own programming abilities.

Preliminaries

At the start of the lab, Mike will e-mail you another team's solution to Program 4. Each team's solution will be evaluated by one other team.

Please provide answers to the questions below in an MS-Word document. You may supplement these answers by referring to the code directly and writing on the printout. (For example, you might mention that you have found redundant code in method A and method B of the Queue class. You can then circle the redundant code in these two methods and label the circle with the word "redundant" to help Mike easily see what you are talking about.)

Run Analysis - 3 points

Answer these questions by running the program.

  1. Provide step-by-step instructions of how to run the program with 3 shuffles in normal mode.
  2. How can the format of the output that the program produces be improved?
  3. Run the program with 0 shuffles in normal mode. Is the output correct?
  4. Run the program with 0 shuffles in random mode. Is the output correct?
  5. Run the program with 1 shuffle in normal mode. Is the output correct?
  6. Run the program with 1 shuffle in random mode. Is the output correct?
  7. Run the program with 2 shuffles in normal mode. Is the output correct?
  8. Run the program with 100 shuffles in normal mode. Is the output correct?

Code Analysis - 6 points

Answer these questions by looking at the code.

  1. How can the Javadoc comments be improved?
  2. How can the commenting in general be improved?
  3. How can the indentation be improved?
  4. How can the meaningfulness of the names be improved?
  5. Point out any redundant code.
  6. Point out any code that is not clearly written.
  7. How can the class design be improved?
  8. Look at the code that performs the shuffling. Are there any flaws with this code?
  9. Explain in detail the underlying data structure of the queue ADT.
  10. Was the specified QueueInterface used exactly? If not, explain any differences.
  11. Identify any space inefficiencies in the solution.
  12. Identify any time inefficiencies in the solution.
  13. Describe three other weaknesses of the code.
  14. Describe three other strengths of the code.

Conclusion - 1 point

  1. What single thing most impresses you about the solution that you evaluated?
  2. What is the one biggest piece of advice that you would give to the authors to improve the quality of their programs in the future?

What to Submit

Before the end of the lab period, hand in the following to Mike:

Also, please print out a second copy of the word processed document that you created. Give this copy to the authors of the program that you evaluated.

Before Lab Ends

Delete any BlueJ projects that you created and empty the recycle bin. Thanks.