Code Review. How to save your code from bugs

Flawlessly written code. Do you consider it a myth or you think it possible?

Experts say that whatever qualification a developer has nobody is perfect. Great code is written by talented, happy and motivated developers. It is not an easy thing to retain the best experts as it is time-consuming, worthwhile and just difficult, that is why some CEOs hire juniors and inexperienced folks giving them serious tasks. No wonder quality of code written by such “specialists” is not always high.

What is the purpose of code review?

An effective code review process is key to ensuring the long-term quality of the code base. Code review is considered to be one of the most effective QA practices in software development. While it is relatively expensive in terms of time and effort, it delivers benefits of identifying defects in code modifications before they are committed into the project’s code base. Google is famous for its code review, not a line goes to production until it is approved by Core Review (CR).

images (3)

There are more factors that may influence the quality of code

Change of a programmer (for misc reasons). When a code was initially written by one dev and the baton was passed to another one lots of discrepancies and mistakes may be found. Or a developer may move to another country or simply refuse working on a project. After all replacement of initial programmer is bad.

Deadlines. Due to human psychology strict deadlines or stressful conditions of work influence quality of work and definitely not in a good way. Most people (not only developers) who find themselves in severe emotional environment try to complete the task asap not paying much attention to the quality.

Bad code review tools. OK, the code is already at hand and you only need to review it. The simplest way is to use available code review tools able to review hundreds lines of code in hours, but one should bear in mind that tools for detecting bugs may contain bugs too so when a code is being reviewed and sentenced to be  perfect, it is not always so and not a developer to be to blame.

Lack of management in development teams. When dev team is being managed by not a technical person misunderstandings may arise. It is tough to explain to a person how he/she should do this or that if you do not know it yourself. The same is with work revision, only dev can review the code written by another dev.

Why do code review?

This review is a must have not only for code that goes into production, but for all the code if you want to be considered as a serious company. Yes, it will take time, but the quality will exceed all expectations.

This procedure has many benefits. First, your code will be reviewed by at least one more person. It will help to notice obvious mistakes that had been made accidentally. But the most precious feature of CR is its social nature: when you know that your colleagues are to check your code you will be more diligent at work.

Second, it is spread of knowledge. Usually there are few people responsible for certain chunks of code in a team and each member do not pay attention to it until somebody finds some bugs in it. But when not only the author knows a code structure and architecture it is important.

All these benefits prove that code review should be done on a regular basis no matter whether it is a new project or not, bugs appear randomly and need to be removed all at once.

AOG has top experts in code review and you can see developers with expertise in CR and their projects.