Code Reviews in the Software Development Industry
Code reviews are a vital part of the software development process, helping to increase the quality of the code and the transfer of knowledge among team members. Code reviews can serve a similar purpose in the classroom, allowing students to engage in industry practices that strengthen their learning. Here’s a talk by Angie Jones, a Java Champion and renowned developer, about code reviews.
How the code review process works
In your classroom code reviews, there will be two roles: the developer, who wrote the code, and the reviewer(s), who review the code using the processes below.
The Preparation Process
The first step of the code review is that the developer who writes the code prepares the code for review. This includes:
- Making sure the code is complete
- Test the code to ensure it works as they expect
- Check the code against coding guidelines (using the coding rubric or other classroom guides)
- Write any specific questions they have for the reviewer
Once the code is ready, the developer asks for feedback from a colleague. Sometimes, they ask for feedback from multiple colleagues. Code reviews can be conducted at any time during the development process, not just when the work is completely done.
The Review Process
Once the developer asks for feedback, the reviewer will begin the code review process. First, the colleague needs to understand the assignment – what problem is the developer supposed to be solving by writing this code? Then, the reviewer reviews the code line-by-line, checking for each of the following:
- Code correctness: does the code follow coding guidelines? Are there any syntax errors in the code? Are there typos or other mistakes that will cause the code to have problems?
- Logical errors: is there anything in the way the code is written that seems illogical?
- Quality of comments and documentation: has the developer used clear comments in the code? Is there clear documentation? Are there clear variable names or other conventions to indicate what the code is doing?
- General code maintainability and clarity: will this code be easy to go back and change in the future?
Once the reviewer follows these steps, they add their feedback to the code for the developer to consider. A code-review is a fast-feedback process, and an iterative one. Developers and reviewers may have many conversations, and the developer may make changes and have them reviewed more than once before the code is considered accepted and ready for production.
Code Review as Formative Assessment
The fast-feedback and iterative improvement process makes the code review an ideal form of formative assessment. Code reviews provide an opportunity for paired learning, peer feedback, and ongoing learning.
Here are some of the following skills that teachers can teach and assess as students do code reviews:
- ability to give feedback that is kind, clear, and useful
- ability to give feedback that addresses the specific problems
- knowledge of coding rules and guidelines
- knowledge of tools and resources
- ability to think critically about/understand the problem that the code is intending to solve
- ability to give and receive feedback and collaborate to solve problems
- ability to communicate needs and ideas with clarity and technical proficiency
- ability to work with other people and use resources to address code problems
This is just one example of how code reviews can be used as formative assessment. Students can use the rubric with one another to do peer assessments as well!
Code Review as Summative Assessment
The code review process can also be used as a summative assessment. Teachers may provide a description of a problem along with some example code, and ask students to do a code-review of the code. This type of code review might be used as a quiz or test, to determine what level of professional and technical ability that students have about the problem being solved and how code is used to solve it.
An open-book code-review style test could be used, allowing students to review the code while using the internet to test the code and look up information that they don’t understand to complete the code review.
The code review happens every day in the software industry. In addition to being a wonderful introduction to how the software development industry works, code reviews are an excellent way for teachers to assess student learning in their code classrooms. Definitely give code-reviews a try, and use our resources to help.