Lecture 35: Code Review Techniques (Walk-through & Inspection)
Unit 5: Software Coding and Testing (4353202)
Lecture Agenda
- Recap of Unit 4
- What is Code Review?
- Why is Code Review Important?
- Technique 1: Code Walkthrough
- Technique 2: Code Inspection
- Comparison: Walkthrough vs. Inspection
- Key Takeaways
Recap of Unit 4
Unit 4 covered Software Project Management, including responsibilities of a Project Manager, size estimation metrics (LOC, FP), estimation techniques (COCOMO, Heuristic, Analytical), project scheduling (Gantt, Burn Down Charts), and risk management (identification, assessment, control).
What is Code Review?
Code Review is a systematic examination of computer source code. It is intended to find mistakes overlooked in the initial development phase, improving the overall quality of software.
It is a crucial part of the software development process, often performed by peers or a dedicated review team.
Why is Code Review Important?
- Defect Detection: Finds bugs and errors early in the development cycle, reducing rework costs.
- Improved Code Quality: Ensures adherence to coding standards, best practices, and design principles.
- Knowledge Transfer: Spreads knowledge about the codebase among team members.
- Mentoring: Provides an opportunity for less experienced developers to learn from more experienced ones.
- Increased Maintainability: Leads to cleaner, more understandable, and easier-to-maintain code.
Technique 1: Code Walkthrough
A Code Walkthrough is an informal review where the author of the code presents the code to a small group of peers. The author explains the logic, and the reviewers ask questions and provide feedback.
- Process:
- Author prepares and presents the code.
- Reviewers ask questions and identify potential issues.
- Discussion is informal and collaborative.
- Purpose: To gain a better understanding of the code, identify obvious errors, and share knowledge.
- Participants: Author, 2-3 peers, sometimes a moderator.
Technique 2: Code Inspection
A Code Inspection is a formal and systematic review process led by a trained moderator. It involves a detailed, line-by-line examination of the code to find defects.
- Process:
- Planning: Define scope, roles, and schedule.
- Overview: Author explains the code to the team.
- Preparation: Reviewers individually examine the code against a checklist.
- Inspection Meeting: Reviewers present findings, defects are logged.
- Rework: Author fixes identified defects.
- Follow-up: Moderator verifies fixes.
- Purpose: To find as many defects as possible in a structured manner.
- Participants: Moderator, Author, Reviewers, Recorder.
Comparison: Walkthrough vs. Inspection
| Feature | Code Walkthrough | Code Inspection |
|---|---|---|
| Formality | Informal | Formal, structured |
| Goal | Understanding, knowledge sharing, minor defect finding | Systematic defect finding |
| Leader | Author | Trained Moderator |
| Preparation | Minimal | Required (individual review) |
| Defect Rate | Lower | Higher |
Key Takeaways
- **Code Review** is essential for improving software quality and reducing defects.
- **Walkthroughs** are informal, author-led sessions for understanding and minor defect finding.
- **Inspections** are formal, structured processes led by a moderator, aiming for systematic defect detection.
- Both techniques contribute to better code and knowledge sharing within the team.
Next Lecture
Topic: Software Documentation (Internal & External)
Q & A
Questions & Discussion

