Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 1 Design and Code Reviews - Overview What are design and code.

Slides:



Advertisements
Similar presentations
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
Advertisements

Damian Gordon.  Static Testing is the testing of a component or system at a specification or implementation level without execution of the software.
Chapter 4 Quality Assurance in Context
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 1 1 Disciplined Software Engineering Lecture #7 Software Engineering.
Personal Software Process
© 2010 John Dalbey Ch 9: Reviews Humphrey proposes that personal reviews will result in improved quality. Now that we have a defined process and some real.
CS 350: Introduction to Software Engineering Slide Set 5 Software Quality C. M. Overstreet Old Dominion University Spring 2006.
SE 555 Software Requirements & Specification Requirements Validation.
 QUALITY ASSURANCE:  QA is defined as a procedure or set of procedures intended to ensure that a product or service under development (before work is.
Using A Defined and Measured Personal Software Process Watts S. Humphrey CS 5391 Article 8.
Personal Software Process Overview CIS 376 Bruce R. Maxim UM-Dearborn.
1 Software Inspections and Walkthroughs Author: A. Frank Ackerman Presented by Cynthia Johnson EEL6883.
1CMSC 345, Version 4/04 Verification and Validation Reference: Software Engineering, Ian Sommerville, 6th edition, Chapter 19.
OHT 4.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Software Quality assurance (SQA) SWE 333 Dr Khalid Alnafjan
Prof. Mohamed Batouche Quality Control.
Personal Software Process Software Quality CIS 376 Bruce R. Maxim UM-Dearborn.
Chapter 24 - Quality Management Lecture 1 1Chapter 24 Quality management.
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 1 1 Disciplined Software Engineering Lecture #14 Software Engineering.
Software Quality Chapter Software Quality  How can you tell if software has high quality?  How can we measure the quality of software?  How.
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Chapter 15 Projecting Defects( 缺陷预测 ). 山东大学齐鲁软件学院 2 outline  Analyze and use your defect data to help improve both planning accuracy and product quality.
N By: Md Rezaul Huda Reza n
S oftware Q uality A ssurance Part One Reviews and Inspections.
Disciplined Software Engineering Lecture #8 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department.
Software Inspection A basic tool for defect removal A basic tool for defect removal Urgent need for QA and removal can be supported by inspection Urgent.
1 Chapter 2 The Process. 2 Process  What is it?  Who does it?  Why is it important?  What are the steps?  What is the work product?  How to ensure.
Phil Cronin Anne Hill Allen Schones CIS841 Summer on Campus 1998 IN-PROCESS INSPECTIONS FOR OBJECT ORIENTED DESIGNS.
Disciplined Software Engineering Lecture #6 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department.
CS 350, slide set 6 M. Overstreet Old Dominion University Spring 2005.
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
Lecture: The Personal Software Process. 2 Overview  Personal Software Process assumptions process stages measures and quality strategy results.
Disciplined Software Engineering Lecture #7 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Product Design Finalization; Inspections.
© 1998 Carnegie Mellon UniversityTutorial The Personal Software Process (PSP) The overview of the PSP that follows has been built from material made.
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 1 1 Disciplined Software Engineering Lecture #8 Software Engineering.
Software Engineering Prof. Dr. Bertrand Meyer March–June 2007 Chair of Software Engineering Lecture 2: The Personal Software Process.
CS 350, slide set 5 M. Overstreet Old Dominion University Spring 2005.
CHAPTER 9 INSPECTIONS AS AN UP-FRONT QUALITY TECHNIQUE
INFO 636 Software Engineering Process I Prof. Glenn Booker Week 9 – Quality Management 1INFO636 Week 9.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 3 1 Software Size Estimation I Material adapted from: Disciplined.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 1 1 Disciplined Software Engineering Lecture #4 Software Engineering.
INFO 636 Software Engineering Process I Prof. Glenn Booker Week 8 – Reviews 1INFO636 Week 8.
PSP Quality Strategy [SE-280 Dr. Mark L. Hornick 1.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Chapter 19 Verification and Validation.
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
Disciplined Software Engineering Lecture #3 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department.
Disciplined Software Engineering Lecture #2 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 1 1 Disciplined Software Engineering Lecture #2 Software Engineering.
SE-280 Dr. Mark L. Hornick 1 Design and Code Reviews Review Checklists.
Chapter 12: Software Inspection Omar Meqdadi SE 3860 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
CS 350: Introduction to Software Engineering Slide Set 2 Process Measurement C. M. Overstreet Old Dominion University Fall 2005.
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
Disciplined Software Engineering Lecture #12 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 1 1 Disciplined Software Engineering Lecture #12 Software Engineering.
INFO 637Lecture #71 Software Engineering Process II Product Implementation INFO 637 Glenn Booker.
PRODUCT IMPLEMENTATION Chapter 8 Tawatchai Iempairote September 23, 2041.
Focus on design principles and on a process for doing design = To produce a precise, complete, high- quality foundation for product implementation.
Software Quality Assurance and Testing Fazal Rehman Shamil.
Mahindra Satyam Confidential Quality Management System Software Defect Prevention.
More SQA Reviews and Inspections. Types of Evaluations  Verification Unit Test, Integration Test, Usability Test, etc  Formal Reviews  aka "formal.
Software Quality Control and Quality Assurance: Introduction
Disciplined Software Engineering Lecture #6
Verification and Validation
Verification and Validation
QA Reviews Lecture # 6.
Presentation transcript:

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 1 Design and Code Reviews - Overview What are design and code reviews? Why should you do them? The PSP review strategy review principles review measures Review considerations

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 2 What are Reviews? A review is a way to personally examine your own work. It is one of a family of methods inspections walkthroughs reviews They all have the objective of finding and fixing product defects early in the development process.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 3 Inspections Inspections were introduced by Fagan at IBM in Inspections follow a structured process done by peers managers do not attend each participant has a defined role preparation is required objective is to find problems Inspections are useful for requirements, designs, code, test cases, plans, etc.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 4 Walkthroughs Walkthroughs typically follow a meeting format developer leads the audience through the product audience may include peers, managers, or other interested parties objective is to communicate or obtain approval no preparation is required Walkthroughs are most useful for requirements and system design issues.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 5 Reviews In a personal review professional privately reviews his/her product objective is to find defects before the first compile and test reviews are most effective when structured and measured Reviews can be used for requirements, designs, and code.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 6 Why Do Reviews? - 1 Data show that it is much more efficient to find defects in reviews than in testing in unit test, typically only about 2 to 4 defects are found per hour code reviews typically find about 10 defects per hour experienced reviewers can find 70% or more of the defects in a product unit test rarely exceeds a 50% yield PSP data show that reviews find 2 to 5 times as many defects per hour as unit test

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 7 Compile Code Review Unit Test

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 8 Why Do Reviews? - 2 After unit test, defect removal becomes much more expensive in integration and system test it takes 10 to 40 programmer hours to find and fix each defect inspections typically take less than an hour per defect Some inspection data O ’ Neil: 80-90% yield at 25 minutes/defect Philips: 15 minutes/defect versus 8 hours in test

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 9 Why Do Reviews? - 3 The reason to eliminate defects as early as possible is because every review, inspection, compile, and test finds only a fraction of the defects thus, the cleaner the code entering a phase, the cleaner it will be on exit. Early defect removal saves time and money defects cost more to find and fix later in the development process defects cost much more to find and fix after development completion

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 10 Why Reviews are Efficient - 1 In testing you start with a problem then you must find the bug next, you devise a fix finally, you implement and test the fix With reviews and inspections you see the defect then you devise a fix finally, you implement and review the fix

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 11 Why Reviews are Efficient - 2 In testing, if the system produces an unusual result, then you must detect that it was unusual figure out what the test program was doing find where it was in your program figure out what defect could cause such behavior You are searching for the unplanned and unexpected. This can take a lot of time

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 12 Why Reviews are Efficient - 3 With reviews and inspections you follow your own logic when you find a defect, you know exactly where you are you know what the program should do and did not do you thus know why this is a defect you are therefore in a better position to devise a complete and effective fix

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 13 The PSP Review Strategy The PSP objective is to produce the highest possible program quality at every process phase The review strategy to achieve this is to gather data on your reviews study these data decide what works best for you adjust your process accordingly This is a continuous learning process using data on your own work.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 14 Review Principles PSP reviews follow a disciplined process with entry and exit criteria a review structure guidelines, checklists, and standards The suggested PSP review goal is to find every defect before the first compile or test. To address this goal, you should use coding standards use design completeness criteria measure and improve your review process

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 15 Design Review Principles Produce designs that can be reviewed. Follow an explicit review strategy. Review the design in stages. Verify that the logic correctly implements the requirements.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 16 Produce Designs that can be Reviewed A reviewable design has a defined context a precise representation a consistent and clear structure This suggests that the design ’ s purpose and function be explicitly stated you have criteria for design completeness the design is structured in logical elements

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 17 Follow a Review Strategy The review strategy specifies the order in which you review the design elements. this depends on the product structure the review strategy should thus be considered during design The objective should be to produce a design that can be reviewed in stages tested in stages integrated in stages

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 18 Review the Design in Stages By reviewing in stages, you ensure that all selected topics are carefully checked. Suggested review stages are 1. check that all elements have been designed 2. verify overall program structure and flow 3. check the logical constructs for correctness 4. check for robustness 5. check the function, method, and procedure calls to ensure proper use 6. check special variables, parameters, types, and files for proper use

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 19 Verify that the Logic Correctly Implements the Requirements Review the requirements to ensure that each required function is addressed by the design. Check carefully for oversights and omissions.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 20 Review Measures Explicit measures the size of the program being reviewed the review time the numbers of defects found the numbers of defects not found: the escapes Derived measures review yield: %found LOC reviewed per hour defects found per KLOC defects found per review hour review leverage

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 21 Review Yield - 1 Yield a measure of process quality the percent of defects in the product at review time that were found by the review measures the effectiveness of a process step - design and code reviews - the overall process - prior to test - the development process - including test yield(for a phase or the entire process) = 100*(defects found)/(defects found + not found)

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 22 Review Yield - 2 Yield cannot be calculated until all defects have been found through test and product use. Yield can be useful early in the process if all or most defects are counted. design and code review defects compile defects unit test defects Using process data, control parameters can help to ensure high yield reviews.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 23 Defect Removal Leverage: DRL DRL measures the relative effectiveness of a process step at removing defects. DRL is the number of defects removed per hour by a process step relative to a base process the usual base is unit test DRL(X/UT) is the DRL for phase X with respect to unit test DRL is calculated as follows: DRL(X/UT) = (defects/hour phase X)/(defects/hour unit test)

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 24 Process Control To control your process, you need measures that are available while you are enacting the process. While yield and DRL are very helpful, they are not available until after process completion. The need is for measures that correlate with yield are available at development time

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 25 Potential Control Parameters The potential control parameters for yield are LOC reviewed per hour defects found per hour defects found per KLOC The PSP research has found the following correlations with yield LOC/Hour: -0.63, with significance > Defects/Hour: 0.14, with significance of 0.25 Defects/KLOC: 0.47, with significance of 0.01 While none are good, LOC/Hour is best.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 26

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 27

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 28 LOC Reviewed per Hour Student data has considerable variation. These examples show that structured reviews can be effective if they follow a defined procedure they use checklists they are tailored to each engineer ’ s defect experience For the PSP, a suggested control target is to review no more than about 200 LOC per hour.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 29 Review Considerations Checklists Reviewing before or after compile The relationship of reviews and inspections

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 30 Checklists When performing precise tasks, it is difficult to do more than one thing well at a time. The checklist defines the review steps in the order suggested for performing them. By checking off each item, you are more likely to perform it properly. Establish a personal checklist that is customized to your defect experience.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 31 Reviewing Before Compile - 1 The PSP calls for code reviews before the first compile. The reasons are review time is about the same whether done before or after compile code reviews will find syntax defects that the compiler misses code reviews of compiled code tend to be much less effective the compiler is equally effective before or after reviews

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 32

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 33

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 34 Reviewing Before Compile - 2 The PSP uses compile as a check on the quality of the reviews. if too many defects are found in compile, another review is called for if the compile is clean, it is likely that most of the defects have been found After you have completed the PSP exercises, you may wish to gather data on your reviews both before and after compile and see which are most effective for you.

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 35 Reviews and Inspections The principal focus of inspections should be to find those requirements and design problems that you have missed. When programs have many simple defects, inspectors are distracted and often miss more important problems. Reviewing the code first provides a quality product for the inspection shows respect for the inspectors ’ time produces higher quality inspections

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 36 Assignment #7 Read chapter 8 of the text and produce report R4. Check Appendix D for the report requirements. This assignment calls for you to design a process for producing the R4 report include a planning and postmortem phase in this process plan the R4 report task produce the report submit the report, the process, and the process data

Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 37 Messages to Remember from Lecture 7 Design and code reviews effectively improve the quality of your programs save development time To do effective reviews, you must establish review goals follow a disciplined review process measure and improve your review quality