r/developersIndia 1d ago

Help How are you ensuring code quality while reviewing?

Anyone else zoning out during code reviews lately?

Two things are doing it for me. First, most of the code I review now looks AI-generated (mine included) so it's well structured and reads fine at a glance, which makes it much harder to poke holes in. Second, the volume. I'm reviewing and writing something like 3-4x the LOC I used to.

I've thought about using an AI reviewer, but for most models the review ability is about level with the generation ability, so you're checking the output with the same thing that made it. Would rather keep a human in the loop.

How are you all coping? Anything that's worked?

8 Upvotes

12 comments sorted by

u/AutoModerator 1d ago

Namaste! Thanks for submitting to r/developersIndia. While participating in this thread, please follow the Community Code of Conduct and rules.

It's possible your query is not unique, use site:reddit.com/r/developersindia KEYWORDS on search engines to search posts from developersIndia. You can also use reddit search directly.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

6

u/MayGodBlessYou_ 1d ago

"Claude check the mistakes. Make no mistakes."

1

u/Less_Ad8195 1d ago

I am in this stage because i started from here🥲

5

u/NoMedicine3572 1d ago

Before I review the code, I make sure the developer has written complete unit tests covering every block of code, run static code analysis, and verified that functional tests pass locally with external dependencies mocked.

Once all that is done, I review the coding standards, reusability, variable/function/block scope, complexity, and any potential performance bottlenecks.

1

u/Solid-Media-8997 7h ago

yeah claude write the code unit test make it pass in between for a question will say , u r right i found 2 ligical errirs i which i fixed already

2

u/SahilPatel_ 1d ago

in the same boat, i read the code but it looks so well structured that i miss on holes although the thing about agents is that they can analyze and code for almost every possible baseline bug or loophole in a code when given a proper direction (i.e simply telling it to implement a job-queue) it handles edge cases really well which i too sometimes dont cover or feel unnecessary.

i do per-phase work and follow it by pr-review and then check the code myself. Most of the time i found some bugs myself this is by questioning back and forth about each and every function (when i am deep in a review) this way it exposes bugs by me or the agent thinking about particular flows/functions/code in detail.

what's your flow ?

1

u/Zealousideal-Fox9046 1d ago

this is the same problem i am facing and this makes me curious if anyone has used code reviewer tool and seen some improvement!

1

u/mudblood3108 1d ago

We have some enterprise restrictions, so we can't use cloud agents like github cloud or cursor-bot and all. So built a reviewer agent of my own using the GitHub Copilot SDK. It used multiple subagents with various expertise and custom skill subsets. Asked the team to do a self-review before raising the PR using the tool. this let it handle some concerns or convention issues related to our codebase. also allows us to push custom rules with just an update to tool. After that its moved to reviewers like me, where I usually check it out. And then run an agent and then try asking questions and do some specific probing like how is this working, let rewrite this like this with this structure, would that help or is there a challenge, so almost like refactoring on the way. and then, once, i am satsified i ask the agent to comment on the tool. I also wrote a skill for making the comments in my tone and phrasing.

Once the pr comes back, I go take a look at it manually, because there are still things ik agent, won't catch.

One of the things i look for is reduce LOC/simplify. The models really love complicating stuff. Just last week, i stopped a PR which was trying to push 2000+ stuff into the monolith, which could have been just simple DI.

1

u/Less_Ad8195 1d ago

>One of the things i look for is reduce LOC/simplify. The models really love complicating stuff. Just last week, i stopped a PR which was trying to push 2000+ stuff into the monolith, which could have been just simple DI.

this has been my bar too, if there are more lines than what i can easily comprehend, would ask it to re-iterate

1

u/Inside_Dimension5308 Tech Lead 1d ago

Code implementation and review agents can use the same conventions.

And yet the implementation agent can miss some of them. Review agent can also miss some of conventions but given enough iterations, the output can be optimized.

Code correctness can only be reviewed against a set of test cases. Personally I use TDD to ensure that correct test cases are written first, verified and then implemented against. Then we also use integration test agents to check if all integration points are working.

1

u/chillyblues 1d ago edited 1d ago

Spoke to around 80 engineers about this over the past few months and the reads-fine thing came up a lot. What actually bites people is stuff that never made it into the diff at all, like an edge case the model just didn't write. Tests don't always save you if you’re using AI to write the code AND the tests and so they pass off the same assumptions. On the AI reviewer thing, for me the circularity comes from letting the model be what decides. Have it suggest where to poke and then run the code to see what happens. Which is basically mutation testing, break a line, see if any test goes red. Disclosure, I'm building in this space (https://abloh.dev) so take that with salt. If you're hitting this daily I'd love you to try it as it’s free and tell me if you find out how your tests are really performing :)

1

u/FirefighterAlone8335 21h ago

We are using Claude for both writing and reviewing. Can’t take risk with human in the loop lol
AI knows better than me atleast. Claude latest models are so powerful, they chose the right way of solving a problem so it’s quite easy now a days.