code inspection
play

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


  1. Code Inspection SENG 426, Summer 2009

  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.

  3. CODE INSPECTION

  4. Code Inspection � refers to peer review of 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.

  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 ones who raise questions, suggest problems, and criticize the document . � Recorder: The person that documents the defects that are found during the inspection.

  6. Inspection Process Overview

  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.

  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.

  9. Inspection Metrics (continue…) � T otal 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 other measure)

  10. Inspection Metrics (continue…) � Estimated T otal 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

  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

  12. Inspection Forms � We will use two types of forms ◦ Individual Reviewer Form: used during Preparation Stage ◦ Log Form: used during Meeting Stage

  13. Individual Reviewer Log Form used during Preparation Stage

  14. Log Form used during Meeting Stage

  15. SAMPLE CODE INSPECTION

  16. Sample Code Inspection � JWP class: OfficeHelp � Code Inspection Checklist � Java Code Conventions � Individual Log Form � Overall Log Form

  17. OfficeHelp

  18. Sample Code Inspection � Java Program: LinkedTwoEndedList � Inspection Checklist � Individual Log Form � Overall Log Form

  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.

  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.

  21. PROJECT PART ONE

  22. Use Cases Diagrams � Document Handling. � Document Editing. � Format Document. � Application Customization.

  23. Use Cases Diagram

  24. Use Case Description

  25. Sequence Diagram

  26. Comments on 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

  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.

  28. QUESTIONS??

Recommend


More recommend