Page 32 - The Art of Designing Embedded Systems
P. 32
Disciplined Development 19
vides enough background to team members to facilitate their understand-
ing of the code.
Preparation-Inspectors individually examine the code and related
materials. They use a checklist to ensure that they check all potential prob-
lem areas. Each inspector marks up his or her copy of the code listing with
suspected problem areas.
Inspection Meeting-The entire team meets to review the code. The
Moderator runs the meeting tightly. The only subject for discussion is the
code under review; any other subject is simply not appropriate and is not
allowed.
The person designated as Reader presents the code by paraphrasing
the meaning of small sections of code in a context higher than that of the
code itself. In other words, the Reader is translating short code snippets
from computer-lingo to English to ensure that the code’s implementation
has the correct meaning.
The Reader continuously decides how many lines of code to para-
phrase, picking a number that allows reasonable extraction of meaning.
Typically he’s paraphrasing two or three lines at a time. He paraphrases
every decision point, every branch, case, etc. One study concluded that
only 50% of the code gets executed during typical tests, so be sure the in-
spection looks at everything.
Use a checklist to be sure you’re looking at all important items. See
the “Code Inspection Checklist” for details. Avoid ad hoc nitpicking;
follow the firmware standard to guide all stylistic issues. Reject code that
does not conform to the letter of the standard.
Log and classify defects as Major or Minor. A Major bug is one that
could result in a problem visible to the customer. Minor bugs are those that
include spelling errors, noncompliance with the firmware standards, and
poor workmanship that does not lead to a major error.
Why the classification? Because when the pressure is on, when the
deadline looms near, management will demand that you drop inspections
as they don’t seem like “real work.” A list of classified bugs gives you the
ammunition needed to make it clear that dropping inspections will yield
more errors and slower delivery.
Fill out two forms. The “Code Inspection Checklist” is a summary of
the number of errors of each type that are found. Use this data to under-
stand the inspection process’s effectiveness. The “Inspection Error List”
contains the details of each defect requiring rework.
The code itself is the only thing under review; the author may not be
criticized. One way to defuse the tension in starting up new inspection

