Book Deep-Read · Software Engineering at Google · Chapter 19
Software Engineering at Google · Ch 19 · Critique: Google's Code Review Tool · Caitlin Sadowski, Ilham Kurnia, Ben Rohlfs · 2020
When a programmer changes code, they can't just drop it into the company's main codebase — a colleague has to look at it and nod first. That step is called "code review." GitHub pull requests and the review tools inside most companies all do this job. This chapter is about the most popular one inside Google, Critique. It isn't about how to review; it's about what a review tool people actually love looks like.
Of all the features Critique ever added, the one users praised most wasn't high tech at all: it simply shows in bold the name of whoever needs to act next. Once it shipped, people couldn't remember how they had lived without it — before, they had to message each other to ask "who is this change stuck on?"
Review is like several people passing around a contract: the author sends it out, each reviewer scribbles notes, the author revises and sends it back, round after round. The trouble: nobody can say whose move it is; you can't tell which notes are "must fix" and which are "just a thought"; tiny problems a machine could catch (a stray space, bad formatting) still need a human to point out; and there's no clear signal for "this is approved." With tens of thousands of people passing around thousands of contracts a day, those small frictions add up to a huge waste of time.
What you get: most changes need agreement from just two people, so things move fast; and years later, anyone who wonders "why was this line written this way?" can dig up the original review and find out. The honest cost: it is so tightly wired into Google's own codebase, editor and checking tools that nobody outside can use it — when Google works on open-source projects, it uses a different tool.
A good review tool doesn't do the talking for people. It does three things: lets machines catch the small stuff first, makes it obvious whose turn it is, and turns "can this go in?" into one clear green light — the rest is trust between colleagues.
Want to see what the tool adds at each of the six review stages, why analysis results come in just "red / not red," how the attention set updates itself, why LGTM and Approval are separate, why the "Needs More Work" score was cut, and how it differs from the open-source Gerrit? → Switch to Deep read
You'd think a review tool earns its keep with "more features, stricter process." This chapter says the opposite: Critique wins through restraint. The tool doesn't invent a communication protocol; it turns "whose move is it, what's still missing, what have the machines already found" into state you can read at a glance — and leaves trust and communication to people.
The fourth chapter of Part IV, "Tools" — the tooling companion to Ch9 "Code Review": Ch9 covers process and culture, this chapter covers the system that carries it. It follows Code Search (Ch17) and Build Systems (Ch18) and leads into Static Analysis (Ch20) and Large-Scale Changes (Ch22). Real-world counterparts: GitHub pull requests, GitLab merge requests, Gerrit, Phabricator.
Ch9 already set the process: every change is seen by at least one other person, approved by an owner, and meets readability standards. But a process on paper is not a process that runs smoothly. Tens of thousands of Google engineers produce a constant stream of changes — most under 100 lines, yet some are refactorings that touch hundreds or thousands of files. If the tool is slow or the state is murky, every change idles on "who are we waiting for" and "what's still missing."
The chapter's conclusion puts it bluntly: time spent in code review is time not spent coding. The review tool sits on the critical path of every commit, so any friction is multiplied by the company's entire change volume. The job isn't "can we review at all" but: can authors catch problems before sending, can reviewers understand a change fast, does everyone always know the next step, and can "ready to submit" be judged at a glance?
Critique was shaped by Google's review culture, distilled into four principles:
Simplicity had the biggest impact: many interesting features were rejected because the team would not complicate the model for a small set of users. Simplicity also pulls against integration: the team considered a "Code Central" combining editing, reviewing and searching in one tool and decided against it — features are linked from Critique but implemented in their own subsystems, so review stays the sole focus.
Critique reviews happen before commit (precommit). The typical flow: ① create the change and upload a snapshot, which triggers analyzers; ② when happy, the author mails it to reviewers; ③ reviewers comment; ④ the author revises and replies, with ③④ repeating; ⑤ reviewers give LGTM; ⑥ the author commits, and the change lands if presubmits pass. There are escape hatches: reviewers can reassign the change, authors can postpone it, and in emergencies an author can force-commit and have it reviewed afterwards.
As a change moves through the stages, Critique publishes event notifications that other tools subscribe to: a Chrome extension pops up when it's your turn; the email system sends notices and even turns email replies into comments. That's separation of concerns — Critique just emits events; other systems build on top. The authors are candid that some developers love the instant pop-ups while others skip the extension because it breaks their flow.
Bigger changes are harder to understand, so optimizing the diff is a core requirement. Critique's diff starts from an optimized longest-common-subsequence algorithm and adds syntax highlighting, cross-references powered by Kythe, intraline character-level diffs that respect word boundaries, adjustable whitespace ignoring, and move detection — a block of code that moved is marked as moved, rather than "deleted here, added there" as a naive diff would show. To fit side-by-side diffs with Java's 100-character lines, the view dropped borders and padding. At file level you can drag to compare any two snapshots, and every snapshot is prefetched.
The key move: the author sees exactly what reviewers will see, diff and analysis results included, and can make lightweight edits in the tool, add preliminary comments, and link a bug. Reviewing your own change first means a cleaner change goes out and fewer misunderstandings follow.
Each uploaded snapshot triggers static analysis (Tricorder, Ch20). Results appear as status chips under the change description: analyzers can mark specific findings red for visibility, analyzers still running show yellow, and the rest are gray. For simplicity, there are no other ways to mark or highlight findings — actionability is binary. Findings show inside the diff like comments but styled differently, and many carry fix suggestions. The book's example: a linter flags trailing spaces; two clicks take the author to the offending code, one more previews the fix, one more applies it.
Expensive checks go elsewhere: running tests is resource-intensive, so they belong to presubmits (at review request and at commit), not every snapshot like static analysis. A failed presubmit is highlighted, blocks sending or committing, and emails the author. Other common presubmits add mailing lists for awareness and enforce project-specific code style and change-description formats.
Even in a small team you want to spread reviews evenly and account for vacations. Teams can set up an email alias for incoming reviews, and GwsQ (named after the Google Web Server team that first used it) picks a specific member based on its configuration. Across projects it gets harder, so Critique proposes sets of reviewers sufficient to approve the change, weighing four factors: who owns the code, who changed it recently (knows it best), who is available (not out of office, ideally same time zone), and the GwsQ setup. This matters most for large-scale changes that touch many files.
Commenting is the second most common action in Critique after viewing changes, and it's free for all — not just the author and assigned reviewers; anyone can leave a "drive-by review."
A change often has several reviewers — an engineer, the UX person for the feature, the SRE carrying the pager. Critique keeps an attention set for every change: the people the change is currently blocked on. Those in the set are expected to respond promptly, and their names are shown in bold. Critique tries to update the set smartly when people publish comments, and users can also adjust it by hand.
After it shipped, users "had a difficult time imagining the previous state"; the prevailing reaction was "how did we get along without this?" Before, authors and reviewers had to chat to figure out who was handling a change. It also highlights the turn-based nature of review: it is always at least one person's turn to act. It pairs with the dashboard landing page, powered by Changelist Search, which indexes the latest state of every change at Google (pre- and post-submit) and supports regex queries; each section is a query, and by default the first one shows "needs your attention." The authors avoid customizability elsewhere, but allow it here — much as everyone organizes their email differently.
Google splits "can this be committed" into three parts:
The rule: at least one LGTM + sufficient approvals + zero unresolved comments = ready to commit, and the page header turns green. Note that every change needs an LGTM regardless of approval status, guaranteeing at least two pairs of eyes. LGTM and Approval are hard requirements — only reviewers can grant them, and they can revoke them any time before commit; unresolved comments are soft requirements — the author can mark a comment resolved when replying.
This scheme was deliberately simplified: early Critique had a "Needs More Work" rating and an "LGTM++"; it moved to LGTM / Approval always being positive. If a change needs a second look, reviewers leave comments without LGTM; once it's mostly good, reviewers trust the author with small edits — the tool doesn't demand repeated LGTMs, regardless of change size. It shaped culture too: reviewers can't just thumbs-down a change without useful feedback; all negative feedback must be tied to something specific to fix — even the phrase "unresolved comment" was chosen to sound relatively nice. The soft requirement embodies trust: a reviewer can give "LGTM plus a few unresolved comments" and never check each one afterwards — which saves a whole round trip when author and reviewer are many time zones apart.
After commit, Critique doubles as a change archaeology tool: anyone at Google can browse the history, comments and evolution of changes to generally viewable files, to understand why something changed or how a bug crept in; changes can still be commented on and rolled back after commit.
The whole chapter is really a string of "what we gave up for simplicity" decisions. Each has a cost:
Table 1 · Critique's design trade-offs
| Decision | Rejected option | Gains | Honest cost |
|---|---|---|---|
| Scores are always positive | Needs More Work, LGTM++, vetoes | Negative feedback must be specific and fixable; kinder review culture | No explicit "block" signal; reviewers object only by withholding LGTM |
| Unresolved comments are soft | Reviewer re-checks each one | One fewer round trip, especially across time zones | Relies on author diligence; the tool can't stop abused trust |
| Binary actionability | Severity levels, custom marks | Authors see at a glance what to fix | Analyzers must keep false positives low or red loses its meaning |
| Tests in presubmit | Run tests on every snapshot | Saves compute | Test failures surface only at review request or commit |
| Links, not embedding | An all-in-one "Code Central" | Review stays the focus; UI stays simple | Hopping between tools; test coverage is the one embedded exception |
| Deep internal integration | A generic, shippable tool | One click to the editor, cross-references, inline coverage | Can't be open-sourced; useless outside Piper and cloud workspaces |
Table 2 · Two review tools at the same company
| Dimension | Critique | Gerrit |
|---|---|---|
| Used for | The vast majority of projects in Google's monorepo | Open-source projects (Chrome, Android) and internal projects outside the monorepo |
| Version control | Piper; workspaces on a FUSE-based cloud filesystem | Tightly integrated with Git; web UI for browsing, merging branches, cherry-picks |
| Unit of review | Both review each commit separately; Gerrit can also review a stack of commits individually and submit the chain atomically | |
| Scoring | LGTM / Approval, positive only | More sophisticated and highly configurable; a reviewer can veto with -2 |
| Extensibility & permissions | Limited: custom analyzers, presubmits, team policies | Rich plug-in system; fine-grained permissions on repos and branches |
The rule of thumb: a homogeneous large organization (one repo, one toolchain, one culture) suits Critique's "opinionated process + simple UI"; a heterogeneous environment (open source, many repos, team-specific rules) has to accept Gerrit-style configurability and complexity.
Review tools are often treated as install-and-forget infrastructure; this chapter hands you evaluation criteria: can you see at a glance whose turn it is, can you see what's still missing, has the machine-checkable stuff been caught before a human looks, can the diff detect moves? When an architecture review debates "should we add a mandatory-approval rule to PRs," borrow the chapter's split: what is a hard requirement (who may let it through) and what is soft (trust the author).
Industry evidence · publicly verifiable
-2 means "This shall not be submitted," and any -2 blocks submit — the reverse of Critique's positive-only scoring, buying the explicit veto that heterogeneous environments need. GerritCodeReview/gerrit · config-labels ↗① A defined process isn't enough; the tool decides whether it runs smoothly. Review is on every commit's critical path, so friction multiplies by the company's change volume.
② Of the four principles, simplicity mattered most: skip niche features; link out to other tools rather than build an all-in-one Code Central.
③ Before sending, the author sees what reviewers will see: intraline character diffs, move detection, cross-references, plus analysis results.
④ Analysis actionability is binary (red / not red), often with one-click fixes; expensive tests run in presubmit, not on every snapshot.
⑤ Comments are unresolved by default and published as an atomic round; Done / Ack resolve in one click; anyone can drive-by review.
⑥ The attention set makes review turn-based, showing "whose turn" in bold — the feature users can't imagine living without.
⑦ Ready to commit = ≥1 LGTM + sufficient approvals + zero unresolved comments; the first two are hard, the last is soft, by design of trust.
⑧ Scores are positive only: negative feedback must be a specific, fixable comment. Gerrit does the opposite, with a -2 veto and heavy configurability, suiting open source and heterogeneous setups.