Agile 101 - Code Reviews (Part 2 of 2)
The traditional code review is in a meeting with one or more peer programmers. But it does not have to be this way. A couple alternatives are:
- Grab someone. In this approach when you finish a module you grab a peer and ask them to review the code with you. Yes, the second person is already busy, but they understand that in the future you will reciprocate the favor.
- Email. It is possible that peers can review your code on their own and send you feedback by email.
- Collaborative tools. You don't need to sit in a physical meeting but perhaps you can meet virtually by Skype or another collaborative tool.
The process for code reviews is as follows:
- Preparation. Normally the code should be completed and unit tested. The code review can then include the unit test work. A second approach is to review the code before unit test. This could potentially save defect time in the unit test process.
- Review. The owner describes each section of the code, discusses what goes on and how the logic flows. This is not a line-by-line review, but a section at a time. If the program generates screens or reports, they should be discussed as well. The reviewers should challenge anything that seems odd or unusual and ask questions to clarify why code is written as it is. In the course of these challenges and questions, errors may be uncovered.
- End of Review. There are two possible outcomes from the review meeting. One is that the program is approved. The second is that there is more work needed. The work is corrected and reviewed until the program finally passes.
Assuming that everyone goes into the review with an open mind, and that the comments are constructive, a code review can be quick and agile. (You don't have to stand-up, but the meeting can still be quick.)
Summary
Code reviews are done on many traditional project teams. They are also valuable on Agile teams. Agile teams rely on quick turnaround of code within an iteration. Spending an hour up front to critique code and look for points of failure can provide a more effective alternative than having to fix many more defects in the downstream testing process.
........................................................
Project Management Suite. Get pre-built project management processes and much, much more with the TenStep Project Management Suite. Companies and individuals.Click here for more information. |