Do you know how to read code?

Inspired by Mot Munich’s meetup topic of Code Reading yesterday (thank you @samuel), I realised we don’t have much on this topic.

So, I’m curious

When it comes to “code reading” ability, what level would you define yourself as?

  • Novice, just discovering it
  • Beginner, starting to practice
  • Intermediate, practice regularly
  • Expert, it’s instinctive

As always, community commentary is welcome.

4 Likes

I would go with: Intermediate, but not that I practice regularly (anymore).
Reading code is not a problem at all, unless it becomes reallllly technical. I haven’t been involved as much lately into coding my last couple of years.

1 Like

I would mirror @kristof with intermediate but I’ve not had to read code for a few years other than web page code like HTML etc. Would probably make a good subject for an on demand course or experience report article on how someone learned to read code.

2 Likes

Also semi intermediate but not regular usage, though I would not be able to do a code review in most languages so perhaps that intermediate is actually closer to junior developer but I can usually read and understand it.

I work with a lot of mobile flutter apps and getting traffic access on usual build delivery systems remains not straight forward so I’ll often have a local build and step through code usually only for debugging an issue and monitoring traffic. Now and again my bug reports will contains snippets of code if I’m fairly confident that’s the route cause or at least a good starting point for a developer to look at.

1 Like

Perhaps Intermediate to Expert, but that is because I am in code everyday.

If the code is written with Clean Code and Solid in mind, then we all could/should be able to read code easily, and understand what is happening with it.

Within my Team I work on the more complex code in areas such as Infrastructure and ORM, and this is then hidden.
With strong naming conventions, best practices and SOLID principles, my colleagues can come in and write the code that just performs the 3As. keeping things nice and simple.

If anyone is starting in .Net look at XUnit, FluentAssertions, Chaining and Functional programming.
This way your test code looks like a paragraph in English that even a developer might understand :smiley:

ps.. do not jump into BDD for the sake of it. Gherkin is not does not make code readable and adds a layer of complexity.

Rant over :smiley:

1 Like

I’d place myself somewhere between intermediate and expert when it comes to reading code – mainly because I work with it regularly.

We have a lot of unit and integration tests in our software, and underneath it all, it’s not just simple algorithms or database queries, but a whole lot of formulas and complex logic. I also occasionally debug code together with developers.

1 Like

Same here - I am based somewhere between intermediate and expert when it comes to reading code, mainly due to automation test code reviews.

I feel the expert bit for me is that even with our company clean code/style docs, I have started to recognise which dev/qa wrote it from their writing style.

I would say in intermediate now I’ve got back into reviewing my tech testers code. I was a test automation engineer/developer for years (2008-2018) but since being more of a hands off manager after then when I managed a large team of testers I confess I lost my confidence a bit.

I manage a smaller team now and they were struggling to get meaningful code reviews done just through a lack of available time and resources. I just threw myself in there to help despite their code being language I’d barely coded with, and did a code review. Not only did I find I could read the code very easily, I gave suggestions the developer thought was cool and adopted. :grin:

So far more regularly read code now, but I don’t think I’d ever consider myself an expert…there is always an opportunity to improve.

Expert level with HTML and CSS. I can write JavaScript at Beginner level and can understand simple functions written by other people, but I can’t make any sense of large frameworks.

This level of ability is essential for doing an accurate WCAG audit and making appropriate recommendations. For exploratory testing, you can get away with a slightly lower level of knowledge, but I have always required that all our testers become as proficient as possible.

It’s also important for testers to be aware of and understand coding paradigms such as single page applications, responsive design, lazy loading, asynchronous content loading, parallax scrolling, synchronous vs asynchronous JavaScript etc. These may be well understood now, but none of them existed when I started testing, so there was a time they were new to us. Other new paradigms will undoubtedly emerge.

I can’t read any server-side languages even though I have written some very simple applications in PHP, Ruby and Perl. However, we never get to see the server-side code so this isn’t a limitation.

I used to have a basic knowledge of SQL, mySQL and phpMyAdmin but haven’t needed to use it for ten years.

Expert as I’m also my own toolsmith and do automation.
I found some bugs by just reading code.

1 Like

Somewhere between beginner and intermediate with help from AI.

1 Like

If reading code means analyzing the code in PR, then yes, we regularly review the code as part of white box testing.
And I would categorize myself between beginner and intermediate.
Because sometime the code logics are bit complex while sometime they are quite easy to understand.

Any specific tips for using AI to help?

What kind of prompts or tools have you been using?

Usually something like copilot or cursor helps as pasting a code block in chatgpt has limitations (it doesn’t understand anything beyond 200 lines of code)
The way to go about it is first reading through the code yourself.
Then identifying confusion areas.
Then asking the AI about what that code block does. Followed by some doubt clearing questions.
If it’s too technical, you can always let the AI know your skill level.
If the code block reveals a new concept, you can always start another thread to ask the AI to explain it to you.
Given the fact that the AI can make mistakes, watching/reading a tutorial or two from an actual person can be of great help too!

the thing about having an AI inside the IDE is that you can add reference files to make it understand better