Software Testing and Maintenance 1 Code Review  Introduction  How to Conduct Code Review  Practical Tips  Tool Support  Summary.

Slides:



Advertisements
Similar presentations
Verification and Validation
Advertisements

Damian Gordon.  Static Testing is the testing of a component or system at a specification or implementation level without execution of the software.
More CMM Part Two : Details.
Software Project Management Lecture # 11. Outline Quality Management ( chapter 26 - Pressman )  Software reviews  Formal Inspections & Technical Reviews.
Formal Technical Reviews
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 1 1 Disciplined Software Engineering Lecture #7 Software Engineering.
Static Technique. Static Technique - Review  A way of testing software work products  Program code, requirement spec., design spec.  Test plan, test.
Testing Without Executing the Code Pavlina Koleva Junior QA Engineer WinCore Telerik QA Academy Telerik QA Academy.
Cole Cecil. Peer Code Review 2 Why do a peer code review? Find defects earlier Find different kinds of defects Share knowledge among peers Maintainability.
 Every stage from phase DESIGN in Software Development Process will have “design document” especially in analysis and design phases.  “Design document”
SOFTWARE QUALITY ASSURANCE Maltepe University Faculty of Engineering SE 410.
Week 7: Requirements validation Structured walkthroughs Why have walkthroughs When to have walkthroughs Who participates What procedures are helpful Thoughtless.
OHT 8.1 Galin, SQA from theory to implementation © Pearson Education Limited Review objectives Formal design reviews (FDRs) Participants Preparations.
OHT 8.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Review objectives Formal design reviews (FDRs) Participants Preparations.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
CSC 395 – Software Engineering Lecture 9: Testing -or- How I Stopped Worrying and Learned to Love the Bug.
1 Software Inspections and Walkthroughs Author: A. Frank Ackerman Presented by Cynthia Johnson EEL6883.
Design Reviews Peer Reviews. Agenda Peer Reviews Participants of Peer Review Preparation for a Peer Review Session The Peer Review Session Post-peer Review.
OHT 4.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Software Quality assurance (SQA) SWE 333 Dr Khalid Alnafjan
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
Software Engineering Process I
Software Inspections and Walkthroughs By. Adnan khan.
ZEIT2301- Design Studios and Design Critiques School of Engineering and Information Technology Dr Kathryn Merrick Bldg 16, Rm 212 (Thursdays.
Slide 6.1 CHAPTER 6 TESTING. Slide 6.2 Overview l Quality issues l Nonexecution-based testing l Execution-based testing l What should be tested? l Testing.
Software Testing Lifecycle Practice
Galin, SQA from theory to implementation © Pearson Education Limited 2004 Review objectives Formal design reviews (FDRs) Participants Preparations The.
Software Reviews. Introduction/Motivation When creating written documents, it is a good idea to have someone else proof read your work. Oftentimes an.
S oftware Q uality A ssurance Part One Reviews and Inspections.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 10: Testing and Inspecting to Ensure High Quality Part 4:
Software Inspections. Defect Removal Efficiency The number of defects found prior to releasing a product divided by The number of defects found prior.
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.
CSCE 548 Code Review. CSCE Farkas2 Reading This lecture: – McGraw: Chapter 4 – Recommended: Best Practices for Peer Code Review,
Benefiting from Code Inspections Kevin W. Wall Copyright © – Kevin W. Wall – Some Rights Reserved. This work is made available and licensed.
Formal Technical Reviews Matt Graham 18 November 2004 EECS 814 University of Kansas.
... there is no particular reason why your friend and colleague cannot also be your sternest critic. --Jerry Weinberg --Jerry Weinberg.
Reviews and Inspections. Types of Evaluations Formal Design Reviews conducted by senior personnel or outside experts uncover potential problems Inspections.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
Chapter 12: Software Inspection Omar Meqdadi SE 3860 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Code Reviews James Walden Northern Kentucky University.
Inspection and Review The main objective of an Inspection or a Review is to Detect Defects. (Today -there may be some other goals or broader definition.
Unit III Static Testing. static testing Testing of a component or system at requirements or implementation level without execution of any software, e.g.,
MNP1163 (Software Construction).  SDLC and Construction Models  Construction Planning  Construction Measurement.
Software Quality Assurance SOFTWARE DEFECT. Defect Repair Defect Repair is a process of repairing the defective part or replacing it, as needed. For example,
Inspection and Review The main objective of an Inspection or a Review is to detect defects. This activity and procedure was first formalized by Mike Fagan.
© Michael Crosby and Charles Sacker, 2001 Systematic Software Reviews Software reviews are a “quality improvement process for written material”.
Agenda: Overview of Agile testing Difference between Agile and traditional Methodology Agile Development Methodologies Extreme Programming Test Driven.
Reviews Chapter 5 Applied Software Project Management, Stellman & Greene See also:
Management of Software Project CSM Review By:Nafas.
Peer Review Presented by : Basker George. Peer ( 同等的人 ) Review( 回顾 ) During the development of software, defects are inevitably ( 不可避免 ) injected. Defect.
More SQA Reviews and Inspections. Types of Evaluations  Verification Unit Test, Integration Test, Usability Test, etc  Formal Reviews  aka "formal.
Software Project Management Lecture # 12. Outline Quality Management ( chapter 26 - Pressman )  SQA  Who does it?  SQA Activities  Software reviews.
SQA COMPONENTS IN THE PROJECT LIFE CYCLE C HAPTER 8 Dr. Ahmad F. Shubita.
Software Reviews Ashima Wadhwa.
SOFTWARE TESTING Date: 29-Dec-2016 By: Ram Karthick.
Software Quality Control and Quality Assurance: Introduction
Formal Inspection Scenes
Software Configuration Management (SCM)
Code Reviews.
Inspection and Review The main objective of an Inspection or a Review is to detect defects. (Not for Giving Alternative Solutions) This activity and procedure.
Applied Software Project Management
Dr. Rob Hasker SE 3800 Note 9 Reviews.
QA Reviews Lecture # 6.
WALKTHROUGH and INSPECTION
Software Testing Lifecycle Practice
Code Reviews Assignment Each team should perform a code review
Software Reviews.
Testing, Inspection, Walkthrough
Review & Inspection Process
Presentation transcript:

Software Testing and Maintenance 1 Code Review  Introduction  How to Conduct Code Review  Practical Tips  Tool Support  Summary

What is it?  A systematic examination of source code to ensure sufficient code quality  Correctness: Try to detect faults that may exist in the code  Maintainability: Try to make the code easier to understand and maintain Software Testing and Maintenance 2

Why?  Help to find and fix bugs early  Two brains are better than one brain!  Help to improve code structure  Enforce coding standards  Spread knowledge among team members  Good training opportunities for new hires  What if the original author leaves?  Developers know their code will be reviewed, so they will work harder. Software Testing and Maintenance 3

When and how often  Not too soon, not too late  Typically after unit testing has been done, and after basic features have been tested  Weekly, or after each major feature Software Testing and Maintenance 4

Philosophy  A forum to discuss and learn from everyone  Not an opportunity to criticize people  Not to demonstrate who is a better programmer Software Testing and Maintenance 5

Potential Misuses  A waste of time and effort, if not performed effectively  Harsh reviews may destroy a less experienced developer  May create social problems if ego and/or politics are involved Software Testing and Maintenance 6

Lightweight vs Formal Review  Lightweight review: over-the-shoulder, pass- around, and tool-assisted review  Formal review: a well-defined process, physical meetings, prepared participants, documented results Software Testing and Maintenance 7

Fagan Inspection (1)  Planning  Preparation of materials  Arranging of participants  Arranging of meeting place  Overview  Group education of participants on the materials  Assignment of roles  Preparation  The participants review the item to be inspected and supporting materials  The participants prepare their roles Software Testing and Maintenance 8

Fagan Inspection (2)  Inspection meeting  Actual finding of defects and opportunities for refactoring  Rework  Resolve the comments made the review  Follow-up  Verification that all the comments are addressed Software Testing and Maintenance 9

A Simplified Process  Preparation  Establish the review group (the programmer, two reviewers, a recorder, and a leader)  Make the materials available  Come prepared  Review  The leader opens with a short discussion (goals and rules)  The programmer explains the code (what it is supposed to accomplish, what requirements it contributes to, and what documentation it affects)  Each participants raises questions, comments, and suggests  The programmer responds (explain the logic, and problems, and choices  Follow up Software Testing and Maintenance 10

Who  Leader: technical authority, experienced, supportive and warm personality  Recorder: keep a written record  Reader: summarize the code segments, could be the author  In general, participants should have a balanced mix  An architect, a peer of the contributor, someone in the middle, new hires  People should not be there: non-technical people, system testers, and managers Software Testing and Maintenance 11

What to look for (1)  Logic errors: programming mistakes, incorrect assumptions, misunderstanding of requirements  Adherence to coding standards  Use of common code modules  Robustness – adequate error handling Software Testing and Maintenance 12

What to look for (2)  Readability: meaningful names, easy-to-understand code structure  Bad smells: opportunities for refactoring  Tests: make sure unit tests are provided, and sufficient coverage is achieved  Comments: adequate comments must be provided, especially for logic that is more involved Software Testing and Maintenance 13

Tips - Statistics  Size: 200 ~ 400 lines of uncommented code  Review time <= 1 hour  Inspection rate <= 300 LOC/hour  Expected defect rates around 15 per hour  # of reviewers: 3 to 7 Software Testing and Maintenance 14

Tips - Management  Code reviews cannot be optional  But it can be selective  Critical and/or complex code, code that is written by less experienced people, e.g., new hires  Require separate code reviews for different aspects  Security, memory management, and performance Software Testing and Maintenance 15

Tips - Reviewers  Critique the code, not the person  Ask questions rather than make statements  Point out good things, not only weaknesses  Remember that there is often more than one way to approach a solution  Respect, be constructive Software Testing and Maintenance 16

Tips - Developers  Remember that the code isn’t you  Try to maintain coding standards  Create a checklist of the things that the code reviews tend to focus  Respect, and be receptive Software Testing and Maintenance 17

Dont  Should not use it for performance measurement  Avoid emotions, personal attacks, and defensiveness  Avoid ego and politics  No code changes after the review copy is distributed Software Testing and Maintenance 18

The Seven Deadly Sins  Participants don’t understand the review process  Reviewers critique the producer, not the product  Reviews are not planned, and reviewers are not prepared  Review meetings drift into problem-solving.  The wrong people participate.  Reviewers focus on style, not substance. Software Testing and Maintenance 19

Tool Support  Tools that try to automate the workflow  Rietveld (Google), Review Board (reviewboard.org), Code Striker (Sourceforge), Java Code Reviewer (Sourceforge), Code Collaborator (SmartBear), and many others  Tools that try to automate the actual inspection  Checkstyle: check compliance with coding standards  Splint: check C programs for security vulnerabilities  BLAST: a software model checker for C programs  And many others Software Testing and Maintenance 20

Summary  One of the most effective ways to improve code quality  It is the code that is being reviewed, not the developer.  A good opportunity for knowledge sharing and team building.  Code review should be an integral part of the development process. Software Testing and Maintenance 21