Problems with AI PRs and code reviews are a self-inflicted problem.
Originally published on LinkedIn
๐ฃ๐ฟ๐ผ๐ฏ๐น๐ฒ๐บ๐ ๐๐ถ๐๐ต ๐๐ ๐ฃ๐ฅ๐ ๐ฎ๐ป๐ฑ ๐ฐ๐ผ๐ฑ๐ฒ ๐ฟ๐ฒ๐๐ถ๐ฒ๐๐ ๐ฎ๐ฟ๐ฒ ๐ฎ ๐๐ฒ๐น๐ณ-๐ถ๐ป๐ณ๐น๐ถ๐ฐ๐๐ฒ๐ฑ ๐ฝ๐ฟ๐ผ๐ฏ๐น๐ฒ๐บ.
One of the big complaints about AI-assisted development is that AI generates more code than humans can physically review.
That can be true. But I think people are looking at the problem backwards.
Weโre using the old PR/review process in a completely different development model.
Before AI, a PR came with assumptions:
๐ค A human read and refined the ticket. โ A human asked questions about the requirements. ๐ง A human designed the solution. ๐ป A human wrote the code. ๐งช A human ran it and checked that it worked.
The PR was a second review.
The reviewer might be more senior, looking for architecture, standards, patterns, security or maintainability.
But most reviewers werenโt pulling down every PR and testing every scenario just to prove the developer had done their job.
There was an assumption the implementation at least vaguely worked.
Why? ๐๐ฐ๐ฐ๐ผ๐๐ป๐๐ฎ๐ฏ๐ถ๐น๐ถ๐๐.
The engineer was accountable for the implementation. The reviewer was accountable for reviewing it. Those are not the same job.
AI changes this when we automate the human out of the loop of design and remove accountabilty.
Weโre engineers. We love automation.
A ticket arrives. AI analyses it, decides what to build, creates a design nobody reviewed, writes the code and tests, runs the pipeline... and a giant PR lands in front of a human.
Theyโve never seen the design, may barely understand the requirements, and then have to validate thousands of generated lines of code.
Then we complain: โThis PR is impossible to review.โ
Well, yes. You created that problem.
Now take a different process.
A human is deeply involved in requirements, planning and design. They know what is being built, challenge the approach, and define scenarios, constraints, tests and safety rails.
Then AI builds it.
That same accountable engineer reviews the implementation against a plan they understand. They pull it down. Run it locally. Test it. Confirm the behaviour. Make sure the damn thing actually works.
That isnโt really a traditional PR review.
Itโs the implementation loop engineers have always had: write code, run it, test it, fix it.
Push all human involvement to the far end and you donโt have a code-review problem.
You have a missing-accountability problem.
Throwing more AI at the review stage isnโt the answer either, this compounds the lack of accountability.
AI code review is useful. I use it. But I use it as another reviewer of my code.
I donโt take its feedback as gospel. I review the review, decide which findings matter, and decide what remedial actions should be taken.
AI can dramatically increase how much software we build.
But if humans can no longer understand, verify and take responsibility for what is produced, the problem isnโt that AI writes code too quickly.
๐ฌ๐ผ๐๐ฟ ๐ต๐๐บ๐ฎ๐ป ๐ถ๐ ๐ถ๐ป ๐๐ต๐ฒ ๐๐ฟ๐ผ๐ป๐ด ๐ฝ๐น๐ฎ๐ฐ๐ฒ ๐ถ๐ป ๐๐ต๐ฒ ๐น๐ผ๐ผ๐ฝ.