http://www.deaded.com/staticpages/index.php/codereviewprocess
Simple Code Review Process
1. Overview
A code/peer review is where developers go over the code in a system to:
- make sure that the code is written to standard and satisfies the specifications, requirements or design documents
- suggest improvement opportunities to the author
- learn different ways of coding and about the system under review (competence building)
All code that is intended for production is a candidate for review.
Document base from www.processimpact.com
2. Work Aids
The following peer review work aids are available:
- Issue Log (for keeping track of issues found during the review)
- Java Inspection Checklist (things to keep a lookout for)
- Reviewed Code Tracking (keep track of what was reviewed and when)
3. What to Review
To get some idea which code to review, think about the following:
- code that uses new technology, techniques, or tools
- key architectural components
- complex logic or algorithms
- security related code
- code that has many exception conditions or failure modes
- exception handling code that cannot easily be tested
- components that are intended to be reused
- code that will serve as models or templates for other code
- code that affect multiple portions of the product
- complex user interfaces
- code created by less experienced developers
- code having high cyclomatic complexity
- code having a history of many defects or changes
When starting to do code reviews for the first time, core components,
base classes, and complex areas should be started with. As the code
reviews progress, more coverage is possible by choosing a use case to
follow through or selecting a layer (eg; EJB). Over time, reviewing
code as it is made ready and also picking on any areas that keep having
bugs reported in them. However, at no point should there be a target to
review 100% of the systems code.
4. Participants
Who should take part in a review? In general, the code should be reviewed by:
- the author
- peers of the author
- possibly a 3rd party unrelated to the project
In attendance, there should be at least the author of the work under review, the architect, and at least one other developer.
Ideally, 3 to 5 people should take part, not all needing knowledge of the system under review.
5. Inspection Procedure
The actual review meeting should be no longer than 2 hours a time (and never two reviews in the same day).
5.1. Before the meeting
To start with, someone selects which code will be reviewed. The
author(s) of the code ensure that the code is written to the coding
standards, compiles, and has passed static analysis checks (PMD and
FindBugs).
The code is then printed (one copy for each reviewer). At this point,
the code under review is frozen. This means that no more changes are to
be made to the code under review until after the review has been
completed and any actions taken related to the review have been dealt
with. There is no point reviewing code that has already changed, and
also no point in trying to fix issues raised by the review in code that
has changed since the review.
Printed code must have the class name, line numbers and a page number printed on each sheet.
5.2. During the meeting
Code reviews are for reviewing code – not for going over system
design, picking at brace placement or spacing, or criticising the way
the author has written anything. Remember that you are reviewing application code – not the person that has written that code.
The review should have a light, informal, atmosphere where questions
relating directly to the code under review can be freely asked and
answered, yet also keeping the meeting moving forwards.
The author(s) of the code starts with a quick verbal explanation of
what the code does and then starts to go through the code. This does
not mean in a robotic fashion “line 1 import com.mycompany.bla.blaâ€
… “line 55 for x equals zero, x is less than the size of myarray,
increment xâ€. It means to describe in natural language the important
aspects of what the code is doing. The line numbers are used to direct
attention to a place in the code when going through.
When an issue is raised, it needs to be recorded in the issue log so
that it can be dealt with after the review meeting. The class name,
line number, and text description of the issue should be recorded. It
is up to the project to decide what should be fixed and when, sometimes
it is enough to recognise an issue and ensure that the developers are
informed about what or what not to do in the future. Other times, you
will find bugs that must be fixed or possibly some refactoring. When
something like refactoring is done, you should also consider putting
the refactored code under review again.
Filling in the issue log is the only task that should be done with a
computer. Trying to review code on a computer screen with 3 or more
people doesn’t work – it must be printed. The issue log should be
kept even after any actions raised by the review have been dealt with
(this may help to spot any patterns so that the static analysis tools
can be improved to help find any issues automatically in the future).
Note that these tools cannot replace human checking of what is done,
they can only check how something is done.
6. Reference Sheet for Peer Reviews
-
- Select review participants, obtain their agreement to participate, and schedule a walkthrough meeting. Responsibility:
Moderator
- Author prints a copy of the code for each member of the meeting. Responsibility: Author
- Describe the work product to the reviewers during the meeting in
any appropriate way. Lead discussion on the topics of interest or
concerns about the work product. Responsibility: Author
- Present comments, possible defects, and improvement suggestions to the author. Responsibility: Reviewers
- Based on reviewer comments, perform any necessary rework of the work product. Responsibility: Author
Participants
The architect / author selects the participants for the review.
Entry Criteria
Architect has selected work to be reviewed and author(s) has prepared the work for review.
Tasks
Deliverables
Modified work product
Verification
No verification of rework is required. Changes are made at the project group’s discretion.
Exit Criteria
The author has made any appropriate changes in the work product.
7. Process Maintenance
Submit suggestions for improvements to be made in this peer review process to the Quality Department ( a.person@mycompany.com ).
http://www.stickyminds.com/index.asp
- 2488517.zip (101 KB)
- 描述: Code Reviews - An Improved, Light Weight Process
Summary: Formal code inspections work for some organizations, but are often considered too structured for many others. Thirumalesh Bhat discusses the pitfalls of formal inspections and presents a lightweig
- 下载次数: 4
分享到:
相关推荐
our study sheds light on why Google introduced this practice and analyzes its current status, after the process has been refined through decades of code changes and millions of code reviews....
**Source Insight CodeReview宏**是专门针对Source Insight这款强大的源代码查看和编辑工具设计的一套扩展功能,主要用于代码评审和统计。Source Insight以其强大的代码导航、语法高亮和实时分析能力,深受程序员...
标题提到的"IDEA代码检视插件Code Review Helper"是针对IntelliJ IDEA集成开发环境的一款强大工具,旨在提升代码审查的效率和质量。代码审查是软件开发中的一个关键环节,通过它,团队成员可以互相检查彼此的代码,...
Code Review是软件开发过程中的一个重要环节,它有助于提高代码质量,发现潜在的错误,以及确保团队成员间的代码风格一致。本文将详细介绍两款Eclipse插件——Jupiter和Reviewclipse,它们是进行Code Review的有力...
CodeReview工具的作用:1.减少评审人的缺陷记录和汇总时间,方便责任人查找问题出处;2.检视完成后生成检查报告,代码作者点击按钮可以直接找到错误处;3.任务责任人修改完成后,直接修改问题状态,组织者按快捷键...
Code Review的作用和意义已在很多技术团队内达成共识,可是很多时候并未被有效执行,甚至被认为是一项费时费力的工作。借助一些工具可以更容易,更有效率地来进行Code Review,本文介绍的Jupiter即是其中之一。 ...
我一直认为CodeReview(代码审查)是软件开发中的最佳实践之一,可以有效提高整体代码质量,及时发现代码中可能存在的问题。包括像Google、微软这些公司,CodeReview都是基本要求,代 我一直认为CodeReview(代码...
在Redmine中,Code Review插件是一个重要的扩展,它致力于帮助开发团队进行代码审查,提升代码质量和团队协作效率。本文将详细介绍如何使用Redmine的Code Review插件。 首先,安装Code Review插件是必要的步骤。...
静态测试方法之代码审查(CodeReview)的清单。代码审查可以帮助提高代码质量,避免由于代码习惯而造成的bug。下面列出的这些要点因该可以作为大部分代码审查的指导,如果是Java应用的话,这些建议应该被视作最佳实践...
代码审核,是对应用程序源代码进行系统性检查的工作。它的目的是为了找到并且修复应 用程序在开发阶段存在的一些漏洞或者程序逻辑错误,避免程序漏洞被非法利用给企业带来不必 要的风险。
软件介绍: 一、软件特色 功能丰富:实现文件内容、度量、命名、注释、类图、Halstead等审查。 简单易用:无需安装,直接使用,直接删除;... 直观可视:分析结果与源代码在同一界面显示对照,...http://www.codereview.com.cn
source insighet 集成code review,代码审核时非常好用,使用起来比较简单,加入工程,同步,添加快捷键,使用快捷键即可正常使用,保存即可。
Steven Code Review 2009.12M1发布包.rar 代码在线审查工具 @date: 2009-12-28 @author: YF @email: yifi@tom.com 功能: 1 方便学员学习教师的代码,无需在本机运行IDE即可以代码加亮的方式查看服务器共享的代码...
### CodeReview中的常见代码问题分析 #### 一、引言 在软件开发过程中,CodeReview(代码审查)是一项至关重要的活动。它不仅有助于提高代码质量,还能促进团队成员之间的知识共享和技术交流。本文将深入探讨Code...
C++代码 Code Review时使用的检查清单和问题记录模板
代码审查(Code Review)是软件开发过程中的一个重要环节,它是一种质量保证活动,旨在通过同行对源代码的系统性检查来发现并修复错误,提高软件的可靠性和可维护性。这个过程通常在代码合并到主分支之前进行,有助...