Should QA review some code in order to write better tests?

I heard that when bugs are fixed or incremental changes are made (i.e. not new feature development), then QA should review the code changes because it might help them to come up with better tests.

For example, an input field for a person’s name accepts any characters. It has been upgraded to handle special characters. If you know this, then apparently you will make better tests. I wonder why I need to read the code to figure out this incremental change. Shouldn’t it be called out in the change ticket or in some document? If the change is complex, then how can I understand it without knowing the code and architecture the way a Developer does? I think I would need that knowledge to be able to come up with better tests.

As an aside, if the QA starts learning more of the Developer knowledge, then at what point do they essentially become a Developer? Why not just make the Developers do the testing if the QA is expected to understand the code as well as the Devs?

Can reviewing code help a QA write better tests? Yes.
Should a QA need to read the code to write the right tests? Not necessarily.

A mature team with devs aware of good testing practices may own the automation, and may not have an embedded QA.
Like you said the change ticket may capture the behaviour and if it doesn’t then why has the developer made those changes. The QA may find the issue quicker through reading the code change, or they may find it through exploration of the actual product.

Being able and willing to go through code is a big plus for a QA. It makes sitting with the Dev and pairing a lot stronger, and means you can ask more informed questions while also helping build the Devs awareness.
On the flip side, not knowing can help ask the right questions as you search to understand (although also just knowing when and how to question assumptions is also useful with or without code knowledge).

Having some knowledge of the code can help with coverage gaps. We have started using AI to review the Jira ticket and the Git commit to find these gaps and it has caught a few issues. Of course, the person reviewing the AI has to have some understanding, but it is definitely helping us catch issues earlier in the process. You don’t have to “know” the code this way. Just how to use the rights skills and prompt to get a readable understanding.

Yes, I once introduced devs to boundary value analysis. They reduced the number of tests and kept the same test coverage. So yes, testers should help to review code because it can help come up with better tests.

Thanks @mikeharris .

As an aside, did all these Devs have CS degrees? If yes, then I wonder why the Devs were not at least aware of the existence of such common testing techniques. I’d hope that this is covered in College. Regardless, I wonder if Dev interviews should focus on testing techniques also, to at least check high level awareness.

If those Devs were self taught or bootcamp grads, then its understandable because most self training programs and bootcamps focus very little on testing or not at all. But, some of these Devs might take the initiative to discover the techniques and learn them.

@nsegal I think that they did have CS degrees. Unfortunately, I don’t think testing is taught well in CS degrees. Something testers bring to an engineering team is knowledge of testing techniques such as boundary value analysis.