Software Development Methods and Tools—CSCI-3308

Lab 12—Code review

Objectives

Part 1 - Review code snippet

  1. Download the zip file associated with this lab.
  2. Each of the files are all written to accomplish the same task.
    • The files are python programs that monitor a directory of JSON files and prints to the console when JSON files are added, removed, or modified.
  3. For this portion we are interested in the first three snippets. Please log the issues you find in a plain text file!
  4. Review snippet1.py and record issues or problems you identify
  5. Review snippet2.py and record issues or problems you identify
  6. Review snippet3.py and record issues or problems you identify
  7. Make sure to save the log file so that your TA can view it.

Part 2 - Peer code review

A large number of defects are usually concentrated in a small amount of code.

Good candidates for selection:

Exercise

  1. Find a partner that is not in your project group and print with line numbers the code they have brought to the lab.
  2. Spend individual time reading and, if possible, executing the code.

    • Does the code do what its author intended it to?
    • Look for opportunities to improve quality:

      • Accuracy
      • Maintainability
      • Reliability
      • Robustness
      • Security
      • Scalability
      • Reusability
      • Efficiency
    • All reviewers mark up the hard copy
  3. You should attempt to locate at least three problem areas. When found, you should note the line number in your log and express the reason for a possible lack of quality.
  4. If you are struggling with interpreting the code, you should have the author explain it to you and see if it makes sense. If you cannot understand code quickly, it could be a good sign that the code was not written in a very readable way.
  5. Discuss with the author ways to make it more readable. Note these lines and the solutions discussed.

Credit

To get credit for this lab exercise, show the TA and sign the lab’s completion log.

Lab material by Liz Boese.