Code Review as a Test Strategy?
I was casually browsing through some pages of topics that didn’t get my attention on the latest book “how google works” series called Software Engineering at Google. Something sparked in my head while reading this particular approach towards code review that says the following:
“A code review is often the first test of whether a given change is understandable to a broader audience”
I don't know about you, but to me, this is a game-changer.
Common sense, experience, and some articles say that a good pull request needs to be small with a few commits, few files changed, single-purpose, and it’s easy to read. This is the mantra that every person who engages with a PR, either the author or the reviewers, generally needs to mind.
But never occurred to me that a code review is, in fact, a test process because you have a set of technical rules in your head that you apply in the code to approve it. Still, when I do code reviews, I never realized to be testing something on this particular stage of the code life cycle to production, and I think most of the developers that I worked with also don’t realize this.
I wish I had this perspective before.
Sometimes it is tough to get to some developers, and hell knows it is awful to work at a team that could care less about testing. Now imagine that you could engage with those devs in their code reviews and explain that what they are doing is a test process but with a different pre-set of rules and checks. Once you can make them understand that they test code every day, they might as well work with you, the QA, to check for testability, scalability, accessibility, logs, how easy it is to deploy, and unit coverage.
“But hey, I’m only a QA.”
Wake up sweetheart, it’s 2020, and your fridge has a terminal.
If you really want to improve as a professional, you need to sharpen your technical and coding skills. If the devs can improve their soft skills and start testing the pull request code, why can't you go towards this technical direction?
I highly recommend you read this book to get some reference on how big companies like Google operates and test things :)