CSCE 315 Lecture 23

From Notes
Jump to navigation Jump to search

« previous | Wednesday, March 21, 2012 | next »


Code Inspection

  1. Prepare stuff (line numbers are helpful)
  2. Overview: Author gives brief explanation if necessary
  3. Preparation: Reviewers work alone to scrutinize for errors (can play different roles such as user or designer; read code from top-down or bottom-up)
  4. Inspection Meeting: reviewer explains what happens, moderator keeps things focused, scribe records problems, their type, and severity, don't discuss solutions
  5. Sometimes hold a third-hour meeting to discuss solutions
  6. Report: Moderator orders list of errors recorded by scribe and updates checklist for future inspections
  7. Keep data on time spent and number of errors
  8. Follow-up: Moderator verifies that work assigned was carried out

Evaluate whether code reviews are actually useful.

Inspections and Egos

The point of inspection is to improve code; NOT to

  • Debate alternative implementations
  • Discuss who is right or wrong

Moderator needs to keep control of discussion

Author needs to be able to take criticism of code without debating. Some things may not "really" be errors.

Reviewer needs to realize that code is not theirs.

Walkthroughs and Code Reading

Author walks through code and accepts any criticism

Similar to code review, only geared toward informal

Code reading is where author gives code to someone else to review; also very informal.

Pair Programming

  • Standardize coding style
  • Don't force pairs for easy tasks
  • Rotate pairs and assignments frequently
  • Use good matches (avoid personality conflicts and major differences in speed/experience)
  • Set up good work environment
  • At least one member should be experienced

Evaluation

  • achieves same quality as formal inspection (more errors caught)
  • decreases development time without distractions
  • traditional collaborative benefits (bouncing ideas)

Portability

Aim toward designing code that runs on multiple machines, but that's a C++ issue.

Abstraction (Strategy and Abstract Factory patterns help)

I18n

  • Don't assume ASCII
  • Use unicode
  • Careful about date/time, text field lengths, idioms and slang, icons