Why code review is an underrated skill in testing

ashleygraf_ - Mar 27 '22 - - Dev Community

NOTE: This was written as part of the Ministry of Testing's Blogger's Club challenge. If you are interested in learning testing, I encourage you to check out MOT.

What is code review?

It's both looking over the code personally, and letting the linter - with rules decided as a team - inspect the code.

Why code review?

Code review is the first step after the development is 'ready for testing'. It's the first step of post development testing - you've scoped out the work, analysed the requirements, had a session with the developer and designer to discuss. This is the last chance to catch bugs without intense 'traditional testing', as it were.

I like it to be the first step I take before I start testing. I may not comment, but I definitely read it. I too often regret when I don’t.

It's a place to catch issues you would take a longer time to find when testing with other methods - security flaws, small but important business rule mis-interpretations, commented out code, code that could be tested with integration and unit tests that aren't - and issues you can't find when testing with other methods that can lead to product quality issues down the line, like hard to understand code, unclear names, de-standardisation of naming styles.

It helps you learn how to code. That is useful for the inevitable programming you'll end up doing - whether it is fixing minor bugs, creating testing tools, using testing tools, or test automation. You see examples of different patterns and when they should it shouldn’t be used, out in the wild.

It helps defect replications later - you understand the code, and therefore the most prominent scenarios that the code fixes are referring to just by reading the code. If fix tickets are ever lacking the required details, or they assume knowledge you don't yet have, you can reverse engineer the intent, and then talk to the engineers and product manager when they are available to fill in the blanks.

This makes doing code reviews both a potential workaround to organisational issues, and a skill enhancer.

Ultimately, it helps you refine your questioning skills - which is ultimately what we are doing as testers. Making and recording observations and asking questions. You practice asking questions, while both broadcasting your assumptions, and assuming that you may be missing context that the developers have. This improves your communication skills.

. . . . . . . . . . . . . . . . . . . . . .