Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Code Reviews Do Not Guarantee A Good Product

DZone's Guide to

Code Reviews Do Not Guarantee A Good Product

· Java Zone
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

If you have a decent development process, you most probably have code reviews. But it appears many people (especially management) believe that code reviews make sure the end product is good, and bug-free. This has nothing to do with reality, as you can probably guess. The purpose of code reviews is to:

  • make sure coding style is consistent throughout the application
  • basic things are done properly. For example – don’t use Strings for numbers, don’t synchronize access to singletons, use StringBuilder inside loops, etc.
  • no code duplication exists
  • layer boundaries are preserved – no database access in the view layer, no UI code in the service layer, etc.

By doing that, code reviews try to minimize the possibility of generating a lot of technical debt. That debt in turn may lead to problematic development of new features and maintenance. But preventing this does not guarantee the product will be good. It certainly does not mean that it will be as if the code was written by the reviewer. The code review cannot (and should not) catch problems with the business logic and the program flow. Exceptions flying all over is something not easily detectable by the reviewer. Depending on the structure this should be caught by QA, the developers themselves or in most cases – both.

So, when management asks you “how come the product is crap if we had code reviews?”, you can say “how come my car breaks all the time if all parts were inspected when built?”.

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:

Published at DZone with permission of Bozhidar Bozhanov, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}