Skip to main content

How to do a good code review

What is a code review? and why?

Code review is a common, but an important part of the development process where a fellow peer or a  technical person go through the code that you have written to find out issues with it. By reviewing the code we can reduce risks by fixing the issues that the reviewer have found. By doing so we can reduce process of fixing bugs during the later stages, which will save lot of time and money. And by reviewing codes we can share our knowledge on like how others code, and what we are doing wrong in our code. And also it can be a learning material for the junior developers, where they can learn how to apply particular designs and such.

What are the thing to look in a code review?


  • Code format - A team should have a way of coding like coding practices, line per class, naming conventions, comments. By having this the code will be have consistence, easy to maintain and easy to be learned. (Formatting, Style, Naming and Test coverage this process can be automated)
  •  Architecture - Does the new code follow the same architecture as the rest of the application
  • SOLID Principles - Does the code follow SOLID principles
  • Design Pattern - Does the code have appropriate design pattern implemented should be implemented
  • Functionality - Does the code to what it suppose to do
  • Affecting other functionality - Does the newly added code affect existing functionality.
  • Logging - Does the code have necessary logging added 
  • Documentation - Does the code have documentation
  • Testing - Does unit tests covers all the functionalities of the code.
  • Readability - Does reading through the code explains about the functionality 
These are some of the most important aspects to check when doing a code review. There are many more areas can be checked. And some teams may have different different checklist to be checked in code review. But most importantly code review process is a crutial aspect in development and should be included. By doing so it will save lot of time of the developers and testers and money from the client down the line. 


Reference : https://blog.jetbrains.com/upsource/2015/07/23/what-to-look-for-in-a-code-review/

Comments

Popular posts from this blog

Prototype Design Pattern

Prototype Design Pattern is a creational design pattern which will be used when there is a need to create multiple object with the same class and will be involved in lot of configurations. By using Prototype Design pattern we can clone a existing object with same configurations values, with same property values into a different memory location, that will exclude the costly operations. This will save us both time and resources. When to use? and Why? Creating new objects by cloning other objects. Allows for adding any subclass instance of a known super class at run-time when there are numerous potential classes that you want to only use if needed at run-time. Reduce the need for creating sub classes public interface Shape extends Cloneable {            public Shape makeCopy(); } public class Circle implements Shape {            public Circle() {                 ...

Why S.O.L.I.D

Why S.O.L.I.D SOLID principles are design principles that enable us manage most of the software design problems. Objective of SOLID is to make software design more understandable, flexible and maintainable. Why SOLID was promoted Rigidity - Every change affects many other parts Fragility - Things breaks in unrelated places Immobility - Cannot reuse the code outside of its origin context Because of these we ended up with these  End up with tight or strong coupling of the code with many other modules. Tight coupling causes time to implement any new requirements, bug fixes and some times creates unknown issues End up with code which is not testable End up with duplication of code End up creating new bugs when changing the code If followed SOLID Achieve reduction in complexity of the code Increase readability, extensible and maintainability Reduce errors and implement re-usability Reduce tight coupling S.O.L.I.D Principles Single Responsibility...

Redirect to a url after login - Spring Security

If you wa nt the browser to remember the url that you enter before login and redirect to that url after you login to the application.  XML Configuration - spring-security.xml   What happens after login will be handled by AuthenticationSuccessHandler SavedRequestAwareAuthenticationSuccessHandler will use the saved request stored in the session. After the successfull login the user will be redirected to the original request url.