Practical Blog

Knowledge Platform

Practical Blog

Knowledge Platform

Practical Software - 5 things to improve your code review

5 Things to Improve Your Code Review

Understand the Requirements

The first step for a productive code review is to understand what the task was all about and think about possible solutions. Once you understand the requirements, the code review can be more productive since you are focused on the problem to be solved rather than on a shallow read-through of the code that only looks for mistakes.


Verify the Definition of Done / Verify the Tests Cover the Requirements

Knowing what the solution should do is key to identifying possible issues or missing functionality. If you practice Agile methodologies and don’t have a DOD (Definition of Done) defined yet, it might be worth creating one so that your developers would know what is expected of them. Part of the Code Review should be to go over the requirements and validate that the tests that verify the requirements are implemented and work correctly to prevent regressions in the future.


Note Clean Code Practices

It is not enough to verify that the code works and even that it works correctly. It is also important to leave the code as clean as possible for the next feature. A dirty and messy code is just as bad as a dirty and messy room and will make it harder to progress at a constant speed. In fact, it will slow things down as the mess increases. As Uncle Bob (Robert C. Martin) said: “Always leave the code you’re editing a little better than you found it”.


Identify Developer Weaknesses and Introduce Improvements Incrementally

Every person has their weaknesses. Once you’ve identified their weaknesses, you can introduce a routine for them to follow and plan for incremental improvements in their working standard. This will reduce the number of rejects on future code reviews and make them more efficient in the future.


Go Over Static Code Analysis Results Together

Some static code analyses issue identify security flaws from which we can learn. Some identify styling issues that make the code less readable, some identify algorithmic or data issues. The more noise the static code analyzer produces, the less likely it is that the developer will notice future issues. It is important to identify noise and remove it so the issues reported are taken to heart. Let the developer explain why a certain issue is important or not so that you could identify the gaps between what you consider important and readable and what the developer considers important. Furthermore, explain your motive for enabling or disabling a certain type of issue so you’ll both be on the same page and quality will improve.


Designed by Freepik