Collaborative Code Construction: Code Reviews and Pair Programming CPSC 315 – Programming Studio Spring 2009.

Slides:



Advertisements
Similar presentations
COMP8130 and 4130Adrian Marshall Verification & Validation INSPECTIONS Adrian Marshall.
Advertisements

Verification and Validation
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
1IT Project Management, Third Edition Chapter 4 Chapter 4: Project Integration Management.
Static Technique. Static Technique - Review  A way of testing software work products  Program code, requirement spec., design spec.  Test plan, test.
SE382 Software Engineering Lecture 21b
Software Quality Assurance Inspection by Ross Simmerman Software developers follow a method of software quality assurance and try to eliminate bugs prior.
Testing Without Executing the Code Pavlina Koleva Junior QA Engineer WinCore Telerik QA Academy Telerik QA Academy.
 Every stage from phase DESIGN in Software Development Process will have “design document” especially in analysis and design phases.  “Design document”
SE 555 Software Requirements & Specification Requirements Validation.
Course Technology Chapter 3: Project Integration Management.
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
Software Development Overview CPSC 315 – Programming Studio Spring 2008.
Developing the Marketing Plan
Verification and Validation
Design Reviews Peer Reviews. Agenda Peer Reviews Participants of Peer Review Preparation for a Peer Review Session The Peer Review Session Post-peer Review.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
Copyright Course Technology 1999
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.
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.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 10: Testing and Inspecting to Ensure High Quality Part 4:
Lecture 16 Formal Technical Reviews (FTRs) (also know as inspections) FOR0383 Software Quality Assurance 9/19/20151Dr Andy Brooks Don´t review in your.
Phil Cronin Anne Hill Allen Schones CIS841 Summer on Campus 1998 IN-PROCESS INSPECTIONS FOR OBJECT ORIENTED DESIGNS.
Writing Quality Requirements Karl E. Wiegers Presented by: Ricardo Carlos.
Teaching material for a course in Software Project Management & Software Engineering – part II.
1.  Describe an overall framework for project integration management ◦ RelatIion to the other project management knowledge areas and the project life.
Moving into Implementation SYSTEMS ANALYSIS AND DESIGN, 6 TH EDITION DENNIS, WIXOM, AND ROTH © 2015 JOHN WILEY & SONS. ALL RIGHTS RESERVED.Roberta M. Roth.
Formal Technical Reviews Matt Graham 18 November 2004 EECS 814 University of Kansas.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Chapter 22 Developer testing Peter J. Lane. Testing can be difficult for developers to follow  Testing’s goal runs counter to the goals of the other.
CHAPTER 9 INSPECTIONS AS AN UP-FRONT QUALITY TECHNIQUE
Applied Software Project Management
University of Palestine software engineering department Testing of Software Systems Program Inspections, Walkthroughs, and Reviews instructor: Tasneem.
Software Testing and Maintenance 1 Code Review  Introduction  How to Conduct Code Review  Practical Tips  Tool Support  Summary.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Chapter 19 Verification and Validation.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 other methodologies 1 Method/Process = step-by-step description of the steps involved.
Requirements Collection By Dr. Gabriel. Requirements A requirement is any function, constraint, or property that the system must provide, meet, or satisfy.
Reviews and Inspections. Types of Evaluations Formal Design Reviews conducted by senior personnel or outside experts uncover potential problems Inspections.
1 TenStep Project Management Process ™ PM00.9 PM00.9 Project Management Preparation for Success * Manage Quality *
Chapter 12: Software Inspection Omar Meqdadi SE 3860 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Project quality management. Introduction Project quality management includes the process required to ensure that the project satisfies the needs for which.
W 3 L 1 sh 1 TCTI-V2CCPP1-10 C en C++ Programmeren Week 3, les 1 : Inspection (Fagan style)
INFO 637Lecture #71 Software Engineering Process II Product Implementation INFO 637 Glenn Booker.
By Godwin Alemoh. What is usability testing Usability testing: is the process of carrying out experiments to find out specific information about a design.
© Michael Crosby and Charles Sacker, 2001 Systematic Software Reviews Software reviews are a “quality improvement process for written material”.
Working and Writing in Teams Module Eighteen Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin.
Testing and Debugging. Testing Fundamentals  Test as you develop Easier to find bugs early rather than later Prototyping helps identify problems early.
Reviews Chapter 5 Applied Software Project Management, Stellman & Greene See also:
Management of Software Project CSM Review By:Nafas.
SQA COMPONENTS IN THE PROJECT LIFE CYCLE C HAPTER 8 Dr. Ahmad F. Shubita.
21. Collaborative Construction
Verification and Validation
Lecture 09:Software Testing
Software life cycle models
Collaborative Code Construction: Code Reviews and Pair Programming
COLLABORATIVE CODE CONSTRUCTION: CODE REVIEWS AND PAIR PROGRAMMING
Applied Software Project Management
Collaborative Code Construction: Code Reviews and Pair Programming
QA Reviews Lecture # 6.
WALKTHROUGH and INSPECTION
Collaborative Code Construction: Code Reviews and Pair Programming
Code Reviews Assignment Each team should perform a code review
Review & Inspection Process
Collaborative Code Construction: Code Reviews and Pair Programming
3. Software Quality Management
Collaborative Code Construction: Code Reviews and Pair Programming
Presentation transcript:

Collaborative Code Construction: Code Reviews and Pair Programming CPSC 315 – Programming Studio Spring 2009

Communication is King The mythical man month argument –Communication takes time/effort –The larger the team the more time is spent communicating/coordinating Expect miscommunication –There are multiple interpretations to almost any communicative act –Teams need to be resilient Plan on fixing problems due to miscommunication at integration time Avoid the blame game and work together to fix the problem Dont jump immediately into the I will do it all response

Types of Collaboration Coordinating Effort –Prioritizing and sequencing –Assigning tasks Collaboration can occur: –Asynchronously Working on same code serially –Synchronously Working on different code simultaneously Working on same code simultaneously

Collaborative Construction Working on code development in close cooperation with others Idea –Developers dont notice their own errors very easily –Others wont have the same blind spots –Thus, errors caught more easily by other people Takes place during construction process

Benefits to Collaborative Construction Can be much more effective at finding errors than testing alone –35% errors found through testing through low-volume Beta level –55-60% errors found by design/code inspection Finds errors earlier in process –Reduces time and cost of fixing them Provides mentoring opportunity –Junior programmers learn from more senior programmers

More Benefits Creates collaborative ownership –No single owner of code –People can leave team more easily, since others have seen code –Wider pool of people to draw from when fixing later errors in code

Some Types of Collaborative Construction Formal inspections Walkthroughs Code reading Pair programming

Code Reviews Method shown to be extremely effective in finding errors –ratio of time spent in review vs. later testing and error correction ranges from 1:20 to 1:100 –Reduced defect correction from 40% of budget to 20% –Maintenance costs of inspected code is 10% of non- inspected code –Changes done with review: 95% correct vs. 20% without –Reviews cut errors by anywhere from 20% to 80% –Several others (examples from Code Complete)

Reviews vs. Testing Finds different types of problems than testing –Unclear error messages –Bad commenting –Hard-coded variable names –Repeated code patterns Only high-volume beta testing (and prototyping) find more errors than formal inspections Inspections typically take 10-15% of budget, but usually reduce overall project cost

Formal Inspection Characteristics Focus on detection, not correction Reviewers prepare ahead of time and arrive with a list of what theyve discovered –Dont meet unless everyone is prepared Distinct roles assigned to participants –Hold to these roles during review Data is collected and fed into future reviews –Checklists focus reviewers attention on common past problems

Roles during Inspection Moderator Author Reviewer(s) Scribe Management 3 people min ~6 people max

Roles during Inspection Moderator Author Reviewer(s) Scribe Management 3 people min ~6 people max Keeps review moving –Not too fast or slow Technically competent Handles all meeting details –distributing design/code –distributing checklist –Setting up room –Report and followup

Roles during Inspection Moderator Author Reviewer(s) Scribe Management 3 people min ~6 people max Plays minor role –Design/Code should speak for itself Should explain parts that arent clear –But this alone can be a problem –Explain why things that seem to be errors arent Might present overview

Roles during Inspection Moderator Author Reviewer(s) Scribe Management 3 people min ~6 people max Interest in code but not author Find errors during preparation Find more errors during meeting

Roles during Inspection Moderator Author Reviewer(s) Scribe Management 3 people min ~6 people max Records errors found and action assigned or planned Should not be moderator or author

Roles during Inspection Moderator Author Reviewer(s) Scribe Management 3 people min ~6 people max Usually should not be involved –Changes from technical to political meeting Might need to see results of meeting

Stages of Inspection – Planning Author gives code/design to moderator Moderator then: – chooses reviewers –ensures code is appropriate for review e.g. line numbers printed –distributes code and checklist –sets meeting time

Stages of Inspection – Overview If reviewers arent familiar with code at all, can have overview Author gives a brief description of technical requirements for code Separate from review meeting Can have negative consequences –Groupthink –Minimize points that should be more important

Stages of Inspection – Preparation Reviewers work alone to scrutinize for errors –Checklist can guide examination Depending on code, review rate varies –125 to 500 lines per hour Reviewers can have varied roles –be assigned perspective e.g. evaluate from users view, or from designers view –evaluate different scenarios e.g. describe what code does, or whether requirement is met –read code/design in certain order/way e.g. top-down, or bottom-up

Stages of Inspection – Inspection Meeting A reviewer chosen to paraphrase design or read code –Explain all logic choices in program Moderator keeps things moving/focused Scribe records errors when found –Record type and severity Dont discuss solutions! –Only focus is on identifying problems –Sometimes dont even discuss if it actually is an error – if it seems like one, it is one No more than 1 per day, about a 2 hour limit

Stages of Inspection – Third Hour meeting Depending on interest/stake of reviewers, possibly hold a separate followup meeting –Immediately after inspection meeting Focus here is to discuss possible solutions

Stages of Inspection – Inspection Report Moderator produces report shortly after meeting –List of defects, types, and severity Use this report to update checklist to be used in future inspections –List main types of errors commonly found –No more than 1 page total length Collect data on time spent and number of errors –Helps evaluate how well things work, justify effort

Stages of Inspection – Rework Moderator assigns defects to someone to repair –Usually the author

Stages of Inspection – Follow-Up Moderator verifies that work assigned was carried out. Depending on number and severity of errors, could take different forms: –Just check with author that they were fixed –Have reviewers check over the fixes –Start cycle over again

Adjusting Inspections Over Time Organizations will have characteristics of code unique to them –Density of code determines how fast reviewers and inspection meeting can go (application tends to be faster than system code/design) –Checklists highlight common problems Measure effect of any changes –Evaluate whether they actually improved process

Inspections and Egos Point is to improve code –Not debate alternative implementations –Not discuss who is wrong/right –Moderator needs to control discussion Author needs to be able to take criticism of code –May have things mentioned that arent really errors –Dont debate and defend work during review Reviewers need to realize the code is not theirs –Up to author (or someone else) to determine fix

Walkthroughs Alternative to formal code inspection Vague term, many interpretations –Less formal than inspections, though Usually hosted and moderated by author Chance for senior and junior programmers to mix Like inspection: –Preparation required –Focus on technical issues –Goal is detection, not correction –No management

Walkthrough Evaluation In best cases, can match formal code inspections in quality In worst cases, can lower productivity, eating more time than saved Can work well for large groups Can work well when bringing in outsiders

Code Reading Alternative to inspections and walkthroughs Author gives out code to two or more reviewers They read independently Meeting held for everyone –Reviewers present what theyve found, but dont do a code walkthrough

Code Reading Evaluation Most errors tend to be found in individual review –Reduces effort and overhead of managing group dynamics at inspection meeting –Maximizes productive effort per person – time not wasted in meetings where others are speaking Works well for geographically distributed reviewers

Pair Programming Basic idea: One person codes with another looking over the shoulder. Person at keyboard writes code Second person is active participant –Watch for errors –Think strategically about code Whats next? Is code meeting overall goal/design? How to test this code

Successful Pair Programming Standardize coding style Dont force pairs for easy tasks Rotate pairs and work assignments frequently Use good matches –Avoid personality conflicts –Avoid major differences in speed/experience Set up good work environment At least one pair member should be experienced

Evaluating Pair Programming Seems to achieve quality level similar to formal inspection Tends to decrease development time –Code written faster, fewer errors Tends to be higher quality code –Holds up better during crunch time – fewer shortcuts taken that come back to haunt All the traditional collaborative benefits