Portfolio Services Company Contacts Blog Get a Quote
uaruen
Athena holds an open book and points at code beside a shield representing review.
Technology

How to maintain code quality when junior developers use AI

Ivan Deineka
Ivan Deineka
CEO at BotLabs
· Updated 11 min read
Key takeaway: Learning and delivery modes, comprehension-focused reviews and practical exercises can help juniors use AI while developing independence.

You do not have to ban AI, but rules for beginners should differ from those for experienced developers. Quality improves when a junior developer explains a solution, checks it and receives feedback. In practice, separate two modes: learning mode, where AI gives a hint or helps explain an error while the developer implements and defends the solution; and delivery mode, where generation is allowed but the author remains responsible for every line.

Measure neither the amount of generated code nor how quickly a task closes. Measure whether the person can explain, reproduce and fix the code without generating another answer. This article helps you set team rules, adapt code review, choose learning exercises and track progress.

What the problem looks like

Team leads describe a familiar pattern. A developer submits code that looks functional but cannot explain during review why it uses a lock or a particular library. They miss a validation step, such as never comparing a payment amount with the order total. When a test fails or an error appears in the logs, they do not investigate; they paste the message into chat and ask for another version. After several cycles, tests pass but no one on the team knows why.

Do not jump to one explanation. The same symptoms may have different causes:

  • the developer does not understand the topic and hides that gap with generated code;
  • they understand it, but the task rewards speed alone, so they optimize what is measured;
  • code review is perfunctory and no one previously asked for an explanation;
  • the project lacks tests or documentation, so even an experienced developer would struggle to verify the solution.

You can investigate with simple methods: ask the developer to explain the change without access to chat, give them a similar task with a different condition, or observe how they analyze a known defect. If a mentor’s hint helps them quickly get to the point, the issue may be habits or process. If it still does not, they need to learn the topic, not just follow new AI rules.

What we know about learning with AI

A randomized study published in January 2026 closely resembles this situation. It involved 52 mostly junior developers who had used Python weekly for at least a year and had experience with AI assistants, but had not worked with Trio, an asynchronous programming library. Each participant implemented two Trio features and then took a comprehension test covering code reading, debugging, code writing and conceptual questions. One group had an AI assistant in a chat sidebar that could provide correct code on request; the other group coded by hand.

The AI group averaged 50% on the quiz; the group without AI averaged 67%. The difference between the averages was 17 percentage points, or roughly one quarter lower relative to the no-AI group. The largest gap was on debugging questions. The AI group finished about two minutes faster on average, but the difference was not statistically significant, so the study did not establish a speed improvement.

Results also varied within the AI group. Participants who asked conceptual questions, requested code with explanations or asked follow-up questions after generation averaged 65% or higher. Those who fully delegated the task or debugging averaged under 40%. These subgroups were very small, however — two to seven people — and the analysis does not establish a causal link between interaction style and results.

Keep the limits in mind. The sample was small, and the quiz came only minutes after the task, measuring short-term understanding rather than skill changes over months or years. The tool was a chat assistant, not an agentic system. This does not prove that every junior developer who uses AI will irreversibly lose skills. It is evidence that, under certain conditions, AI-assisted learning can produce poorer understanding of a new topic than learning without AI, and that the way people use the tool may matter.

Two earlier controlled studies provide additional context. In one 2022 study, participants with access to an AI coding assistant of the time wrote less secure code and were more likely to believe it was secure; participants who trusted the assistant less and actively refined their prompts produced fewer vulnerabilities. This supports requiring verification, but it is not an evaluation of today’s models. In a separate 2023 experiment, participants using an AI assistant built a JavaScript HTTP server 55.8% faster than the control group. That was one limited task; completion speed says nothing about skill formation or long-term code maintenance.

Rules for working with an assistant

Keep rules short enough that people will follow them. Adapt this starting set:

  1. Describe the task in your own words first. Before using AI, the developer writes what needs to be done, the constraints and their proposed approach. Two or three sentences are enough.
  2. In learning mode, ask for a hint rather than a finished solution. Try “Which approach fits here, and why?”, “What am I missing?” or “Explain this error” instead of “write the function.”
  3. Verify the implementation. Run each generated part, cover it with a test and review it. Check unfamiliar library functions in the documentation.
  4. List what you do not understand yet. Before review, the author honestly notes which parts remain unclear. This is material for a mentor, not a reason for punishment.

The difference between modes is clearest in examples:

SituationDelivery-mode promptLearning-mode prompt
Retry a request to a service“Write a retry function with a pause between attempts”“What retry strategies exist, and when can a retry cause harm? I plan three attempts with pauses — what am I missing?”
A test fails with a closed-connection error“Fix this error” plus the full error text“Explain what the error means and where to look for the cause. Do not write code yet”
An unfamiliar library“Generate an example for my case”“Explain the library’s main idea with a simple example. Then I’ll write my version and ask you to review it”

A delivery-mode prompt is not “bad.” By itself, it does not show that learning happened; for a new topic, hold it until the person understands the basics. Learning-mode prompts can also produce better answers because the developer has already described a plan and given the model more context.

The team lead chooses a mode for each task. A new topic, critical module, security or money-related change calls for learning mode. A routine change in familiar code with good tests can use delivery mode. In either mode, the author must explain the code during review.

Changes to code review

Review is a convenient place to see whether an author understands their code. Asking “Was this generated?” does not help: there is no reliable way to distinguish model output from human writing, and that is not the point. The meaning is.

In the pull request description or a short meeting, the author explains:

  • invariants: what must always be true, such as “the amount charged never exceeds the order total”;
  • edge cases: an empty list, zero amount, duplicate request or external-service timeout;
  • the reason for the choice: why this approach was selected over an obvious alternative.

The reviewer checks these explanations, not style: does the code preserve the invariant, is there a test for the edge case, was an alternative considered? If there is no explanation, return the PR with a specific question instead of “rewrite this”: “What happens if the payment service sends the same event twice?”

Practice independence

Habits change through practice, not rules alone. A few formats that fit into a normal work week:

Short tasks without hints. Once a week, give a small 30–60 minute task without AI: fix a defect, add a test or implement a simple function. The goal is to train independent thinking, not to test someone.

Defect analysis. When a bug is found in a junior developer’s code, ask them to reproduce it, explain the cause and propose a fix. The mentor guides with questions rather than giving the answer.

Reimplementation. After AI or a mentor explains a solution, the developer closes the explanation and implements it again independently.

A learning exercise: payment handler

This is a suggested mentoring exercise, not a completed experiment. AI generated a handler for a payment-service event: receive a “paid” event, find the order, update its status and deduct inventory. The code passes a basic test. Ask the junior developer to:

  1. Explain duplicate delivery. Payment services may send the same event twice. What will the code do? Could it deduct inventory twice?
  2. Explain amount validation. Where does the code compare the payment amount with the order total? What happens with a partial payment?
  3. Explain the transaction boundary. If the order status changes but inventory deduction fails, what state is the system in?
  4. Write a duplicate-event test: the same event arrives twice, but inventory is deducted once.
  5. Show timeout behavior: the database does not respond in time; what does the payment service see, and will it send the event again?

The mentor can track progress with a simple table:

StageWhat the mentor checksEvidence it is complete
Understands the causeDeveloper explains why duplicate events are dangerousIn their own words, without reading the model’s answer
Reproduces the failureA test or scenario deducts inventory twiceTest fails on the original code
Fixes itAdds event uniqueness or another idempotency mechanismNew test and existing tests pass
Explains the trade-offNames the cost: another table, locking or added complexityCan describe an alternative and explain the choice

How to assess progress

The number of accepted AI suggestions or chat requests says nothing about a junior developer’s work quality. A request limit only teaches them to hide usage. Track what is directly related to quality and independence instead:

  • Post-review defects: how many bugs are found after merge and whether the number decreases over time.
  • Ability to explain: whether the developer can describe invariants, edge cases and the reason for a choice during review or a debrief.
  • Independent debugging: whether they can find and fix the cause without another generation.
  • Transfer of learning: whether they can solve a similar task with a changed condition.
  • Maintenance time: how long the team spends reworking code after merge.
  • Repeated mistakes: whether the same kinds of defects keep recurring.

These measures do not need complex analytics. Task labels and a short mentor note after each debrief may be enough. Compare each developer with their own earlier work, not with other people, because their tasks differ.

Summary and first steps

AI does not necessarily reduce junior developers’ code quality, but without rules it can become a way to bypass understanding. Outcomes depend on what the team asks for and measures.

In the next sprint, you can:

  1. Introduce learning and delivery modes and explicitly assign one to each junior developer’s task.
  2. Add three fields to the pull request template: invariants, edge cases and reason for the chosen solution.
  3. Schedule one short no-AI task each week and review it together.
  4. After a defect is found, ask the author to reproduce it with a test and explain the cause.
  5. Use a mentor tracker: “understood — reproduced — fixed — explained the trade-off.”
  6. After a few weeks, compare post-review defects, repeated mistakes and ability to explain with the baseline, then adjust the rules.

Rules for junior developers work best when they fit the tools the team already uses: pull request templates, CI checks and the task system. If you want to discuss a pilot and review criteria for your team, BotLabs specialists can review your development process and suggest where to begin.

Frequently asked questions

The research does not establish a universal need for a ban. A small controlled study of learning a new library found poorer understanding in the AI group, but the sample was small and the test was short and immediate. Participants who used AI to ask for explanations and conceptual guidance averaged better results. It is more practical to set a learning mode, require explanations and checks, and track quality than to ban a tool someone may use outside work.

No. Speed shows only how quickly the task was closed. It does not show whether the developer understood the solution, can fix it a month later or can handle a similar task. In the new-library study, the AI group’s speed difference was not statistically significant, while its understanding was lower. Also assess comprehension, independent debugging and transfer to a new task.

Change the condition. Ask the developer to reproduce a failure with a test, explain why an obvious alternative does not work or adapt the solution to a new requirement — for example, partial payment — without access to the original answer. Someone who understands the code can handle the change, even if it takes a moment. Someone repeating an answer usually cannot explain what would change or why.

Request a consultation

15 min · specialist consultation

Junior developer code review consultation

In 15 minutes with a BotLabs technical specialist, discuss how authors explain AI-assisted changes in your review process. Choose one task category and questions to check understanding; the next step is a pilot of these rules with a mentor.

15 minutes with a specialist.

A BUSINESS CONSULTATION
AI-ASSISTED CHANGES → AUTHOR EXPLANATION → NEXT STEP

AI-assisted changes
Author explanation

15 minutes with a specialist to discuss questions for PR authors and a pilot to check code understanding.

technical consultation15 min · specialist consultation
… click to support
Ivan Deineka
Ivan Deineka
CEO at BotLabs
Ivan Deyneka is an entrepreneur and founder of BotLabs Agency, with over 8 years of experience launching and scaling digital products in the field of business automation.
← Back to Blog

Recommended articles

Review junior developers’ code15 minutes with a specialist.Request a consultation