The Relationship between Review and Inspections
In a review, you personally review your own program. An inspection is a team review of a program. After personal reviews, inspections are the most valuable quality technique a software team can use (Fagan 1976; Gilb and Graham 1993; Humphrey 2000). If you objective is to achieve 100% process yield, incorporate inspection into your personal process. You could even use them for the exercises in this book. To do that, either change the process to include inspections or record your and your inspections’ times in your respective times log. Than record all of the defects you and everyone else find in your defect log. Also note in the comments section of the time and defect logs that these data were for inspections. Then, record your and your inspections’ inspection data on your Process Improvement Proposal (PIP) form, both to have a personal record and to tell your PSP instructor what you did.
When using inspections, you must decide where in the process to put them. The principal question are whether to review the code before the inspection and whether to compile and test the code before inspection. The central issue here is one of personal standards. Would you ask someone to review the rough draft of a technical report? You would presumably read it first to eliminate the obvious mistake. Program are much the same. Most first-draft program have obvious defects that are quickly found in even cursory review. Do you want each of your reviewers to separately wade through these obvious defects just because you were too lazy to find and correct them first?
The people who inspect your code are taking their precious time to help you improve the quality of your product. To show your appreciation, treat their time as important and carefully review your code before the inspection. This is not just a question of courtesy; obvious defects are distracting. When there are many simple problems in the code, the reviewers are less likely to see the important issues. Because you can easily find most of the simple problems yourself, thoroughly review your designs and code and make them as clean as you can before having them inspected.
Whether or not you compile before the inspection is more debatable. The issue here concerns where you need help. While you are gaining fluency with a language, it might help to have associates inspect the code before you compile. Your objective, however, is to improve your reviewing skills so that you can later find most of the syntax mistakes yourself. Once you become more fluent with the language, it will be more effective to review and compile first and have the inspection focus on the more subtle requirements, design and coding issues.
If the quality of the code entering an inspection is so important, why not also unit-test it first? This is a question of inspection psychology. When the inspectors know that the code has been tested, they are not as likely to do a thorough analysis. It would seem pointless, for example, to struggle through a complex while loop verification when you know that it has already been tested Even though most programmers understand that an initial unit test will not find all of the defects in a complex program, the fact that the program is known to run can be demotivating. I recommend that you not test your programs before the first code inspection. The inspection objective should be to have no defects found in testing. Your personal review goal, of course, is to have no defects found in compiling, inspections, or testing