Code Inspection SENG 426, Summer 2009 Overview Code Inspection - - PowerPoint PPT Presentation

code inspection
SMART_READER_LITE
LIVE PREVIEW

Code Inspection SENG 426, Summer 2009 Overview Code Inspection - - PowerPoint PPT Presentation

Code Inspection SENG 426, Summer 2009 Overview Code Inspection Process Participants Process Steps Inspection Metrics Forms Sample Code Inspection Project Part One: Use cases & Sequence Diagrams, Application


slide-1
SLIDE 1

Code Inspection

SENG 426, Summer 2009

slide-2
SLIDE 2

Overview

Code Inspection Process

  • Participants
  • Process Steps
  • Inspection Metrics
  • Forms

Sample Code Inspection Project Part One:

  • Use cases & Sequence Diagrams, Application

Design, and Report Outlines.

slide-3
SLIDE 3

CODE INSPECTION

slide-4
SLIDE 4

Code Inspection

refers

to peer review

  • f

any work product by trained individuals who look for defects using a well defined process.

The goal of inspection is to identify

defects.

A defect is any part of the work product

that will keep an inspector from approving it.

slide-5
SLIDE 5

Participants

Author: The person who created the work

product being inspected.

Moderator: This is the leader of the inspection.

The moderator plans the inspection and coordinates it.

Inspector: The

  • nes

who raise questions, suggest problems, and criticize the document .

Recorder: The person that documents the

defects that are found during the inspection.

slide-6
SLIDE 6

Inspection Process Overview

slide-7
SLIDE 7

Process Description

Planning: The inspection is planned by the moderator. Overview meeting: The author describes the background of

the work product.

Preparation: Each inspector examines the work product to

identify possible defects.

Inspection meeting: During this meeting the reader reads

through the work product, part by part and the inspectors point out the defects for every part.

Rework: The author makes changes to the work product

according to the action plans from the inspection meeting.

Follow-up: The changes by the author are checked to make

sure everything is correct.

slide-8
SLIDE 8

Inspection Metrics

Many different metrics can be calculated during an

inspection process:

The number of major and minor defects found The number of major defects found to total found. (If the

proportion of minor defects to major defects is too large a moderator may request the reviewer repeat the review, focusing on major defects, prior to commencing the logging meeting)

The size of the artifact (pages, LOC, ...) The rate of review - the size of the reviewed artifact

divided by time (normally expressed in hours) (e.g., 15 pages /hour).

The defect detection rate - the number of major defects

found per review hour.

slide-9
SLIDE 9

Inspection Metrics (continue…)

T

  • tal Defects Found:

A + B – C ( A=defects found by inspector 1, B=defects found by inspector 2, C=common defects found by 1 & 2)

Defect Density:

Total Defects Found / Size (size=total no of pages or lines of code or some

  • ther measure)
slide-10
SLIDE 10

Inspection Metrics (continue…)

Estimated T

  • tal Defects:

(A x B) / C ( A=defects found by inspector 1, B=defects found by inspector 2, C=common defects found by 1 & 2)

Yield (Defect Removal Efficiency):

(Total Defects Found / Estimated Total Defects) x 100

slide-11
SLIDE 11

Inspection Metrics (continue…)

Inspection Rate:

Size / Total Inspection Time Total Inspection Time = the sum of each reviewers review time plus the total person time spent in each meeting

Defect Detection Rate:

Total Defects Found / Total Inspection Time

slide-12
SLIDE 12

Inspection Forms

We will use two types of forms

  • Individual Reviewer Form: used during

Preparation Stage

  • Log Form: used during Meeting Stage
slide-13
SLIDE 13

Individual Reviewer Log Form used during Preparation Stage

slide-14
SLIDE 14

Log Form used during Meeting Stage

slide-15
SLIDE 15

SAMPLE CODE INSPECTION

slide-16
SLIDE 16

Sample Code Inspection

JWP class: OfficeHelp Code Inspection Checklist Java Code Conventions Individual Log Form Overall Log Form

slide-17
SLIDE 17

OfficeHelp

slide-18
SLIDE 18

Sample Code Inspection

Java Program: LinkedTwoEndedList Inspection Checklist Individual Log Form Overall Log Form

slide-19
SLIDE 19

Minor/Major Defects

Missing class, function and variable

comments.

Line 32: (OfficeHelp Constructor):

  • Literal string should be made constant

Lines 32: (OfficeHelp Constructor):

  • Variables are not checked

Lines 62: (iceMethodCall):

  • Variables are not checked.
slide-20
SLIDE 20

Minor/Major Defects

Lines 21: start_loc

  • Variable should be local to constructor.
  • Name does not follow convention.

Lines 44-49:

  • Execution of code after exception

Lines 87 – 99 redirectOutput:

  • FileStream is not closed.

Line 87 redirectOutput():

  • Unused Function.
slide-21
SLIDE 21

PROJECT PART ONE

slide-22
SLIDE 22

Use Cases Diagrams

Document Handling. Document Editing. Format Document. Application Customization.

slide-23
SLIDE 23

Use Cases Diagram

slide-24
SLIDE 24

Use Case Description

slide-25
SLIDE 25

Sequence Diagram

slide-26
SLIDE 26

Comments

  • n

the Application Design & Architecture

What is the proper design pattern for

JWP?

Is JWP follows a specific design pattern? Package Structure and Dependency? Comments on the JWP usability

slide-27
SLIDE 27

Report Outlines

Introduction. Informal Description Class Diagram Use Cases

  • Diagrams
  • Descriptions

Sequence Diagrams Package Diagram and Class Table. Package and Class Descriptions. Application Design Comments.

slide-28
SLIDE 28

QUESTIONS??