Skip to content

Latest commit

 

History

History
66 lines (42 loc) · 3.82 KB

code-review-guidelines.md

File metadata and controls

66 lines (42 loc) · 3.82 KB

Learning to Write Good Code Reviews

charlytoc_Image_of_a_diverse_group_of_developers_discussing_aro_7773fc51-0eb9-4693-90fa-b266a820ceb9

What is a Code Review?

A code review is an essential part of the learning process for students. It's a way to ensure that students are following good coding practices as they work on projects. When using version control systems like Git, students typically make multiple commits as they modify their files. As mentors, it's our responsibility to review this modified code and identify areas where the student may not be following best practices. This process helps students improve their coding skills and learn from their mistakes. This process is easy to do using Rigobot as you can see here

Key Takeaways

  • A code review is a crucial part of the learning process for students.
  • It ensures that students are following good coding practices as they work on projects.
  • Version control systems like Git help track changes made to files throughout the project development process.
  • Mentors play a key role in reviewing modified code and providing feedback on best practices.

Common Guidelines for Conducting Code Reviews

You can check this general guide about good code practices, is useful to understand what the student might achieve when writting code, and is useful for you to understand what you need to review in the student's code.

charlytoc_Close-up_image_of_a_screen_showing_code_with_inline_c_f14f9948-2321-49c3-955c-d86fc1bb3676

1. Understand the Context

  • Before starting the review, understand the purpose of the code changes. This helps in providing relevant and constructive feedback.

2. Check for Code Functionality

  • Ensure the code works as intended and meets the requirements specified in the task description.

3. Readability and Maintainability

  • Review the code for clarity and simplicity. Good code should be easy to read and understand by others.
  • Check for consistent naming conventions and coding standards. Comments

4. Optimization

  • Look for any inefficient code segments that can be optimized without compromising readability.

5. Error Handling

  • Ensure that the code properly handles possible errors or exceptions.

6. Security

  • Check for any security vulnerabilities, such as SQL injection or cross-site scripting (XSS).

7. Testing

  • Verify that there are adequate unit tests and that they cover edge cases.
  • Check if the tests are meaningful and not just for increasing coverage metrics.

8. Documentation

  • Ensure that the code is well-documented, including comments in complex areas, to help future maintainers understand the logic.

9. Peer Feedback

  • Encourage peer-to-peer code reviews to foster a collaborative environment and diverse viewpoints.

10. Use Tools

  • Utilize code review tools and static code analyzers to automate some aspects of the review process. You can use Rigobot for this process.

11. Constructive Feedback

  • Provide feedback that is specific, actionable, and respectful. Focus on the code and not the coder.

12. Follow-up

  • Ensure that any critical issues are addressed and that there is a follow-up review if necessary.

By following these guidelines and utilizing Rigobot, code reviews can become a powerful part of the development process, enhancing both the quality of the code and the skills of the developers involved.