AI Academy · Book
Engineering Managers · Module 02 · Chapter 005

Small Batches and Pull Request Discipline

An assistant makes a thousand-line change as cheap to draft as a ten-line one, and the cost lands on whoever has to review it. This chapter gives a manager a size limit with a measurement rule, six habits that keep changes small without slowing the team, and a short set of numbers to watch.

≈ 11 min read

After this chapter you can

  • Describe how drafting speed moves effort from the author to the reviewer and the on-call engineer.
  • Write an enforceable size rule with a target, a hard cap, a counting rule and named waivers.
  • Require a slice plan before generation and keep one intent in each pull request.
  • Merge unfinished work behind a flag so large features can land in small pieces.
  • Track median size, share over the cap, first-review wait and waivers to judge whether the rule works.

Google’s logs from 2014 to 2016 put its median reviewed change at 24 lines1, an old, descriptive figure from before AI assistants and not a target. Compare it with what your reviewers face now: a prompt, a few minutes of generation and a green build can produce four hundred lines before lunch.

The engineering manager’s question is a practical one: what size limits and habits keep AI-assisted changes reviewable? The answer has three parts. Why size matters, what a workable limit looks like and how to measure it, and the habits that make a limit livable. This chapter gives each.

Why assistants push batches up

Before assistants, the effort of typing was plausibly a natural brake: a change that took three days to write was less likely to be bundled with an unrelated cleanup. This is a reasoned mechanism, not a measured one. Drafting speed lifts that brake. Adding another file, another endpoint or another refactor to the same pull request costs the author almost nothing. The cost does not vanish. It moves to the reviewer, who must read more, hold more in mind and trace more interactions, and to the person on call, who must find which of forty edits broke production.

The 2024 DORA report found, from a survey, that AI adoption raised individual productivity, flow and job satisfaction, but was also associated with lower delivery stability and throughput, and it named small batch sizes among the practices that remain crucial2. These are survey associations, not causal estimates, and the report does not say that batch size alone explains them. DORA’s guidance on its small-batches capability goes further and states that AI adoption often leads to increased delivery instability, with working in small batches as a countermeasure3. Treat this as a credible reading and a good reason to act, not as a measured effect of your own tooling.

One vendor report points the same way at the level of pull requests. Faros AI reported, from telemetry on more than 10,000 developers, that teams with high AI adoption merged 98 percent more pull requests, with average pull requests 154 percent larger and review time 91 percent longer, and it found no measurable improvement at the organization level4. Those are correlations from a vendor of engineering analytics, and the authors say the findings may not generalize. They fit the story but should not be quoted as a law.

What small buys you

Small changes buy three things, and a manager should be able to say which one they are paying for.

Review quality. The best-known data come from a 2006 study by Smart Bear Software of lightweight review in one Cisco product group: 2,500 reviews of 3.2 million lines by 50 developers. Reviews under 200 lines had relatively high defect rates, and no review over 250 lines found more than 37 defects per 1,000 lines. Reviewers who went faster than 450 lines an hour found below-average defect density in 87 percent of cases5. The study’s own footnote states its main assumption, that the true number of defects per line does not change between small and large changes. A large change that is mostly new boilerplate may in fact contain fewer defects per line, and the vendor-published study covers one group at one company. Read it as a consistent warning from observation, not a proof.

Review speed. Google’s logs show that small changes got a first response in a median of under an hour, against about five hours for very large ones1. Waiting is a cost the author pays in context switching and the team pays in work-in-progress.

Cheap rollback and learning. DORA describes the benefit as a shorter time to feedback, which makes problems easier to triage and remediate3. A single-intent change can be reverted without taking unrelated work with it. That matters in the next chapter, where release safety depends on being able to undo one thing.

Small batches improve review quality, review speed and the ease of rollback and learning, each backed by a different source.ReviewqualitySmaller reviews found more defects per line in one Cisco studyReviewspeedGoogle: first response under an hour for small changesRollback andlearningOne intent per change, so one revert
Figure 2.5.1 What small batches buy, with the sources behind each; the studies are observational and from before AI assistants.

A size limit you can enforce

A limit has to be specific enough to be checked by a machine and humane enough to survive contact with real work. A workable starting rule has four parts. Every number below is an illustrative starting value, to be tuned with your own data.

A size rule with a 200-line target, a 400-line cap, one intent per change, a counting rule and a one-day first review.RuleStarting valueWhy this formTarget size200 changed lines or fewerThe Cisco data show the best results belowabout 200Hard cap400 changed linesAbove it, split or carry a named waiverIntentOne purpose per pull requestA revert then removes exactly one thingCounting ruleAdded plus deleted, excluding generated, lock andsnapshot filesStops size gaming and unfair penaltiesFirst reviewWithin 1 working dayA small change should not wait long
Figure 2.5.2 Illustrative starting values for a size rule; the 200 and 400 echo the Cisco findings, and each team should recalibrate.

Three design choices decide whether the limit helps or becomes theater.

First, agree on the counting rule before the first dispute. A migration that adds 900 lines of generated schema is not 900 lines of review burden, but a hand-written 900-line service is. List what is excluded and keep that list short and public.

Second, give the cap a waiver path with a name and a reason. Some changes cannot be split: a mechanical rename across the repository, a dependency upgrade, a generated client. A waiver costs the author a sentence and tells you where size discipline is hard. A cap with no waiver gets bypassed in ways you cannot see.

Third, let the reviewer say “too big to review”. Without that, the limit is only a request. A reviewer who returns a change with “please split along these lines” has done a review, and the team agreement should say so.

Six habits that keep batches small

Limits state the rule. Habits make it easy.

Slice the work first, keep one intent per change, stack small changes, merge behind a flag, then measure size and wait times.Slice firstAgree the piecesbeforegeneratingOne intentRefactor andbehavior apartStack themEach piecereviewed aloneUse a flagUnfinished workstays darkMeasure median size, share over the cap, wait for first review
Figure 2.5.3 Four of the six habits as a flow from plan to merge, closed by the measures in the footer.
  1. Slice before you generate. For anything larger than a day’s work, the author writes a slice plan before prompting: the pieces, the order and what each can be tested on. An assistant can propose the plan; a person approves it. This is the habit with the most leverage, because it is cheap and it changes what gets generated.
  2. Prompt for one slice at a time. Ask the assistant for the next piece of the plan, not the whole feature. Smaller prompts yield smaller diffs and smaller diffs are easier to check against the plan.
  3. Keep one intent per pull request. Refactors, formatting, dependency bumps and behavior changes go into separate changes. Assistants can tidy neighboring code unasked; reviewers should be able to reject the tidying without rejecting the fix.
  4. Stack, do not pile. A feature of several slices becomes several small pull requests, each building on the last and reviewed on its own. Most hosting platforms and several tools support this.
  5. Merge unfinished work behind a flag. DORA recommends checking in to the main branch at least daily and using feature toggles or dark launches so incomplete work can merge without users seeing it3. This removes the main reason people give for big batches, which is that the feature only works when it is all there.
  6. Write the description for the reviewer. The author states the intent, what was generated and what was hand-written, how it was checked and what is not covered. A short description is the cheapest review aid there is, and it makes the author read the diff once before anyone else has to.

Case: what the Cisco data suggest, and where they stop

The Cisco study is the other direction of the same point. Its authors found that results trailed off after about 200 lines and that hurried reviews found fewer defects. They also reported that review effectiveness fades after about an hour, and recommended reviewing no more than 200 to 400 lines at a time5. That is where the 200 and 400 in the table above come from. The limits of the evidence matter as much as the figures: the study is from 2006, one group of 50 developers, published by a vendor of review tools, and observational. Nothing in it concerns AI-written code. Use the numbers to anchor a starting rule, and replace them with your own distribution once you have six weeks of data.

What to measure

Four numbers, all available from your pull request host, tell you whether the discipline is holding. Review them in the weekly rhythm, not in a dashboard nobody opens.

Four measures of batch discipline, with starting alert levels for median size, share over the cap, wait for first review and waivers.MeasureWhat it showsStarting alert levelMedian changed linesThe shape of typical workAbove 250 for two weeksShare over the capHow often the rule is brokenMore than 15% of merged pull requestsMedian wait forfirst reviewWhether size is hurting flowAbove 1 working dayWaivers per monthWhere splitting is hardA rising count, or any repeat author
Figure 2.5.4 Illustrative alert levels for four size measures; set yours after six weeks of your own data.

Pair the size numbers with a delivery measure that DORA tracks, the share of deployments that need immediate intervention. If sizes fall and failures do not, the discipline is not paying for itself and you should look at what else is wrong. If the share over the cap rises, ask whether the slice plans are skipped or the limit is unrealistic for a certain kind of work.

A team-sized worked example

The numbers here are invented to show the mechanics, not drawn from a real team. A team of nine engineers adopted an assistant two months ago. In the last month, 80 pull requests merged. Of them, 32 exceeded 400 changed lines, which is 40 percent, and the median wait for a first review was 20 hours. Three senior reviewers had stopped reading the large ones closely.

The manager agreed a rule with the team: target 200 lines, cap 400, one intent per pull request, generated and lock files excluded, waivers named in the description. Authors began writing slice plans for anything over a day. One example: a billing feature that would have been a single 1,200-line change became six stacked pull requests of 150, 200, 180, 220, 250 and 200 lines. Those add up to the same 1,200 lines, and each was readable in one sitting. The data model and its flag landed first, the interface last.

After six weeks, 120 pull requests merged. Twelve exceeded the cap, which is 10 percent, ten of them under named waivers (seven dependency upgrades and three generated clients) and two without, which the manager followed up. The median wait for a first review was 6 hours. The count rose from 80 to 120, but over six weeks against one month, so the weekly pace (about 20 a week, if the month is four weeks) was unchanged; the only shift is that each review decision was smaller. The cost was real: authors spent time on slice plans, and stacked changes needed discipline about merge order. The manager kept the waiver list public and rechecked the cap after six weeks.

In an invented example, pull requests over 400 lines fell from 32 of 80 to 12 of 120 and the median first-review wait fell from 20 to 6 hours.MeasureMonth before the ruleSix weeks afterPull requests merged80120Over 400changed lines32 (40%)12 (10%)Median wait forfirst review20 hours6 hoursThe billing feature(1,200 lines)1 pull request6 stacked pull requests
Figure 2.5.5 Invented figures for a made-up team of nine: after the size rule, 12 of 120 pull requests exceeded the cap, against 32 of 80 before.

What this means for engineering managers

Your Monday action (owner: you, with a tech lead agreeing the counting rule): run the 30-pull-request count and share it with the team without commentary. The number may start the conversation. Copy this skeleton into your repository’s pull request template:

Intent (one sentence):
Slice plan position (e.g. 2 of 5):
Changed lines (excluding generated/lock files):  __   Waiver? (name, reason):
Generated vs hand-written:
How it was checked:
Not covered / follow-ups:

Check yourself

  1. Because an assistant drafts a change in minutes, a large change is no more costly than a small one.
  2. In the Cisco study, reviews over 250 lines never found more than 37 defects per 1,000 lines.
  3. Feature flags let unfinished work merge without users seeing it, which removes a common reason for big batches.
  4. A size cap should have no exceptions, or people will game it.

Reflection

What comes next

Small, well-tested changes are easier to approve, but approval is still human and fallible. The next chapter, Pipeline Gates and Safe Release for AI-Assisted Change, covers the automated gates and the rollout and rollback habits that catch what reviewers will miss.

References

  1. Caitlin Sadowski, Emma Soderberg, Luke Church, Michal Sipko and Alberto Bacchelli. Modern Code Review: A Case Study at Google. Proceedings of the 40th International Conference on Software Engineering, Software Engineering in Practice track (ICSE-SEIP 2018). 2018.
  2. DORA (Google Cloud). Accelerate State of DevOps Report 2024. Google Cloud. 2024.
  3. DORA (Google Cloud). Capabilities: Working in small batches. dora.dev. 2025.
  4. Faros AI. The AI Productivity Paradox Research Report. Faros AI. 2025.
  5. Smart Bear Software. Code Review at Cisco Systems. Best Kept Secrets of Peer Code Review (Smart Bear Software), chapter 'Code Review at Cisco Systems'. 2006.

Further reading

Sources last verified 2026-10-12.