25
Code Inspections CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 22, 2007

Code Inspections CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 22, 2007

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

Code Inspections

CSSE 376, Software Quality Assurance

Rose-Hulman Institute of Technology

March 22, 2007

2

Outline

Inspections in generalThat is, for any type of artifact

Fagan's original work on code inspections

Benefits and Costs of Inspections

Inspections in General

4

Inspection Fundamentals

Preparation Led by a moderator Recorded results

5

Inspection Roles

Moderator schedules the inspection meeting leads the meeting

Recorder records results publishes results

Reviewer(s) prepares for inspection meeting participates during meeting

Producer one of the authors; distributes artifact attends inspection meeting, but does not talk (except to

answer questions)

6

Inspection Process

1. Planning

2. Preparation

3. Meeting

4. Reporting results

5. Rework

7

1. Planning

Schedule inspection meeting (time and place) [Moderator]

Invite Reviewers [Producer] Prepare materials [Producer] Distribute materials to Reviewers

[Producer]

8

2. Preparation

Reviewers read artifact Reviewers annotate listing with

comments Reviewers keep track of time spent in

preparation

9

3. Inspection Meeting

A square or octagonal table is recommended

Moderator runs the meeting Recorder keeps minutes:

preparation time of Reviewers comments and commenters

Reviewers contribute comments Producer attends, but remains silent unless

asked a question

10

Dilbert on Moderating

11

Moderating the Session

Don't go too fast -- may miss things Don't go too slow

may not cover all of artifact reviewers may lose concentration

Keep group on task Record important events Keep session to 1-2 hours in length

12

Wrapping Up

Ask for final comments Review action items

Recorder: send minutes to Moderator

Reviewers: send annotated listings to authors

Recorder or Moderator: send reports to participants and to management

13

4. Reporting Results

Summary data is sent to management how many people participated when the meeting took place, and for how

long how many issues were found (may be

categorized) Detailed results are sent to participants

all issues with annotations action items

14

5. Rework

Authors review comments Artifact is modified by Producers Reviewers are notified of changes Another inspection may be needed,

depending on the number and severity of the original comments

Fagan’s Work on Code Inspections

16

Overview of Fagan's Work

Proposed use of code inspections Demonstrated evidence that

inspections were cost effective23% improvement in coding efficiencycareful to avoid the "Hawthorne effect"

17

Code Inspection Checklist Examples

Mistakesimproper use of programming

languageerrors in algorithm or declarations

Poor styleviolations of standard coding styleconfusing or misleading expressions

18

Categorizing Defects

Some errors are more serious than others

Some errors are more common than others

Objective is not perfect classification, but separation of major types

19

Sample Categories

Major -- require investigation Minor -- may not need immediate

attention Cosmetic -- optional improvements

20

21

How many LOC per inspection?

Remember, 1-2 hours is desired length of inspection meeting

Generally 100-200 lines of code per hour is the proper pace

Thus, many inspection meetings are likely needed for the entire source code

Benefits and Costs

23

Why Do Inspections Work?

Preparationreviewers find things that authors miss

Peer pressureforces developers to work harder

Formal processforces developers and reviewers to do

a thorough job

24

Costs of Inspection

Time spent in preparation Time spent in meeting Overhead of scheduling meeting

25

How Could We Improve Inspections? (Some Ideas)

Reduce number of reviewers Reduce time spent in meeting Hold meeting asynchronously Hold meeting via the web

What are the pros and cons to each of these?