Index / 001 EN
Software Engineering at Google: Lessons Learned from Programming Over Time cover

Computer Science

Computer Science

Software Engineering at Google: Lessons Learned from Programming Over Time

Titus Winters; Tom Manshreck; Hyrum Wright (editors)

A collection of essays by Google engineers on how a large organisation sustains software over time. It distinguishes programming from software engineering, then examines culture, process and tooling, explaining the reasoning behind practices such as mandatory code review, monorepos and large-scale automated testing. The full text is free online.

Prerequisites: Working experience as a software developer and familiarity with version control, testing and code review in a team setting.

Difficulty Level
Intermediate
Academic Level
Advanced
software engineeringengineering practicescode reviewtestingopen accessTextbook

01 / Reading Guide

Reading Guide

Citation

Winters, T., Manshreck, T., & Wright, H. (Eds.). (2020). Software Engineering at Google: Lessons Learned from Programming Over Time. O'Reilly Media. Free official edition: https://abseil.io/resources/swe-book

Chapter Summary

Chapter 1: What Is Software Engineering?

Part I, "Thesis", consists of this single chapter by Titus Winters, which sets up the book's argument that software engineering is "programming integrated over time". It builds on three themes named in the preface: time and change, scale and growth, and trade-offs and costs. It introduces Hyrum's Law (with enough users, every observable behaviour of an API will be depended on), illustrated by code that relied on hash-table ordering, and argues that code expected to live for years must be able to absorb change. Further examples (a compiler upgrade, "shifting left" to find problems earlier, distributed builds) show policies that scale or fail to scale with an organization, and the chapter closes on decision-making from data, precedent and argument.

Chapter 2: How to Work Well on Teams

Part II, "Culture", opens with Brian Fitzpatrick's chapter on the human side of engineering. It attacks the "genius myth" and the habit of hiding unfinished work, using ideas such as early detection and the bus factor, and proposes three pillars of social interaction (humility, respect and trust), with practical advice on giving and receiving criticism and running blameless post-mortems.

Chapter 3: Knowledge Sharing

This chapter treats learning as an organizational problem. It argues that psychological safety comes first, then describes ways to scale knowledge: asking questions, mentorship, group chats, mailing lists, an internal Q&A platform, office hours, tech talks, documentation and code itself. It ends with Google's readability process, a form of standardized mentorship delivered through code review.

Chapter 4: Engineering for Equity

The chapter argues that bias is the default in product development and that teams must build diverse perspectives and multicultural capacity into their work. It uses a publicly reported image-labelling failure as a case study and recommends challenging established processes and accepting slower delivery rather than shipping products that harm some users.

Chapters 5–6: How to Lead a Team; Leading at Scale

Chapter 5 distinguishes engineering managers, tech leads and tech lead managers, discusses moving from individual contributor to leader, and lists antipatterns (hiring pushovers, ignoring low performers, treating the team like children) and positive patterns (servant leadership, removing roadblocks, setting clear goals, tracking happiness). Chapter 6 extends this to leaders of several teams with three maxims: always be deciding (identify blinders and trade-offs, decide and iterate), always be leaving (build a self-driving team) and always be scaling (protect time, attention and energy).

Chapter 7: Measuring Engineering Productivity

The last culture chapter describes how Google's productivity research team decides whether a question is worth measuring at all, then selects metrics with the Goals/Signals/Metrics (GSM) framework and checks that they cover quality, attention, intellectual complexity, tempo and satisfaction (QUANTS). A running example about the readability process shows qualitative and quantitative data used together.

Chapter 8: Style Guides and Rules

Part III, "Processes", begins with how Google writes and maintains language style guides. Rules should pull their weight, optimize for the reader, be consistent and avoid error-prone constructs; they are changed through a defined process with style arbiters, and enforced as far as possible by error checkers and automatic formatters.

Chapter 9: Code Review

The chapter describes the code review flow at Google, where every change needs approval ("LGTM") plus approval from an owner of the code and from someone with "readability" in the language (the last two can be satisfied implicitly by the same person or by the author). It lists the benefits (correctness, comprehension, consistency, knowledge sharing, a historical record), best practices such as small changes, good descriptions and few reviewers, and the different kinds of review, from greenfield code to large-scale refactorings.

Chapter 10: Documentation

Documentation is treated like code: owned, reviewed, tested and kept in the same workflow. The chapter covers knowing your audience, the main document types (reference, design docs, tutorials, conceptual documentation, landing pages), reviews, and principles such as answering who, what, when, where and why, and deprecating stale documents.

Chapters 11–14: Testing Overview; Unit Testing; Test Doubles; Larger Testing

Four chapters form the book's largest block. Chapter 11 explains why automated testing enables change, classifies tests by size (small, medium, large) and scope, introduces the "Beyoncé Rule" ("if you liked it, you should have put a test on it"), discusses code coverage, and recounts how Google built a testing culture through programmes such as "Testing on the Toilet". Chapter 12 gives rules for maintainable unit tests: test through public APIs, test state rather than interactions, test behaviours rather than methods, avoid logic in tests, and prefer "DAMP" over "DRY" test code. Chapter 13 compares real implementations, fakes, stubs and interaction testing, recommending real implementations first and warning against overused mocks. Chapter 14 covers larger tests (their structure as system under test, data, action and verification, and types from performance to disaster recovery) and how to keep them from slowing developers down.

Chapter 15: Deprecation

The last process chapter argues that removing old systems is often harder than building them, distinguishes advisory from compulsory deprecation, and describes how to manage a deprecation: owners, milestones, tooling and the true costs of keeping old systems running.

Chapters 16–17: Version Control and Branch Management; Code Search

Part IV, "Tools", opens with version control: centralized versus distributed systems, why long-lived branches hurt, trunk-based development, Google's monorepo and the "One-Version Rule". Chapter 17 explains Code Search, Google's web-based tool for browsing and searching the entire codebase, how engineers use it, and the design trade-offs forced by scale.

Chapter 18: Build Systems and Build Philosophy

This chapter explains what goes wrong without a build system, contrasts task-based with artifact-based build systems, and describes Google's Blaze (open-sourced as Bazel), including hermetic and distributed builds, fine-grained modules and explicitly versioned external dependencies.

Chapters 19–20: Critique: Google's Code Review Tool; Static Analysis

Chapter 19 walks through each stage of a change in Critique, Google's review tool, from creating a change and requesting review to commenting, approval and committing, highlighting features such as the "attention set". Chapter 20 explains what makes static analysis effective (few false positives, actionable fixes, integration into code review) and describes the Tricorder platform.

Chapters 21–22: Dependency Management; Large-Scale Changes

Chapter 21 argues that dependency management is harder than source control, examines semantic versioning and its limits, and considers how cheap compute and testing could change the problem. Chapter 22 describes large-scale changes that touch thousands of files: why atomic changes become impossible, the infrastructure (including the Rosie tool) used to split and test them, and the process for landing them.

Chapters 23–25: Continuous Integration; Continuous Delivery; Compute as a Service

Chapter 23 presents CI concepts and Google's TAP system, distinguishing fast presubmit checks from slower post-submit tests. Chapter 24 gives idioms for continuous delivery (feature flags, release trains, staged rollouts, shipping only what gets used). Chapter 25 explains how Google's Borg cluster manager standardizes the running of workloads and what writing software for a managed compute environment requires.

Afterword

A short afterword by a Google engineering vice president restates the book's themes of sustainability and responsibility to users.

Key Concepts

Chapter 1: Thesis

  • Programming integrated over time: software engineering includes maintaining and changing code over its whole life span, not only writing it.
  • Hyrum's Law: with enough users, every observable behaviour of a system becomes something someone depends on.
  • Shifting left: finding problems earlier in the development workflow, where they are cheaper to fix.

Chapters 2–7: Culture

  • Humility, respect and trust: the three pillars the book proposes for effective teamwork.
  • Psychological safety: an environment in which people can ask questions and admit mistakes, the basis for knowledge sharing.
  • Readability: Google's mentorship process certifying engineers in a language's style through code review.
  • Goals/Signals/Metrics (GSM): a framework for choosing metrics that trace back to what a team actually wants to know.

Chapters 8–10: Style, Review and Documentation

  • Optimizing for the reader: rules and reviews favour code that is easy to read later over code that is quick to write.
  • LGTM and ownership: a change needs approval from a reviewer and from an owner of the affected code.
  • Documentation as code: keeping documents in source control, with owners and reviews, so they stay current.

Chapters 11–15: Testing and Deprecation

  • Test size and scope: classifying tests by resources used (small, medium, large) and by how much code they exercise.
  • DAMP, not DRY: test code should be descriptive and meaningful even if that means some repetition.
  • Prefer realism over isolation: use real implementations or fakes before stubs and mocks.
  • Compulsory versus advisory deprecation: whether users are required, or merely encouraged, to migrate off an old system.

Chapters 16–25: Tools

  • One-Version Rule: developers should never have to choose between versions of the same dependency inside the codebase.
  • Artifact-based build system: a build tool that declares outputs and dependencies, letting it build hermetically, incrementally and in parallel.
  • Large-scale change (LSC): a change across too much of the codebase to be committed atomically, split into independently reviewed and tested pieces.
  • Presubmit versus post-submit testing: running fast, reliable tests before a change lands and slower ones afterwards.

Critical Analysis

Strengths

  • A clear unifying idea. The thesis that engineering is programming over time, with the three themes of time, scale and trade-offs, is introduced in the preface and Chapter 1 and recurs across chapters, so policies on style, testing and dependencies are explained by their effect on long-lived code rather than presented as rules.
  • Grounded in one organization's experience. Each chapter is written by Google engineers responsible for the practice it describes, with concrete stories (hash-ordering bugs, the history of testing culture, deprecation campaigns) and some internal data, such as survey results on tool satisfaction.
  • Covers culture and process as well as tools. Unusually for an engineering book, a whole part is devoted to teamwork, knowledge sharing, equity, leadership and measurement, alongside code review, testing and build systems.
  • TL;DR summaries. Every chapter ends with a short list of takeaways, which makes the book easy to revisit and to use in discussion.

Limitations

  • Google-specific scale and tooling. Many tools (Critique, TAP, Borg, Rosie, Code Search) are internal, and practices such as a single monorepo or the One-Version Rule depend on infrastructure most organizations lack; the preface itself says the book is not a prescription to copy.
  • Little on design or programming. By the preface's own statement, the book does not cover software design, API design, project management, security hardening or user interfaces, so it cannot serve as a general software engineering textbook.
  • Uneven, essay-style chapters. With many authors, chapters vary in depth and tone, and there are no exercises, case-study questions or formal models.
  • A 2020 snapshot. The book describes practices and tools as of around 2019–2020; some details, such as specific tools and organizational structures, may have changed since.

Where It Fits in the Course

In this software engineering list, Sommerville's Software Engineering is the broad textbook covering requirements, design, processes and verification; it is the better choice for a structured survey, and Software Engineering at Google works well alongside it as a detailed account of how one large organization handles maintenance, testing and tooling. Ousterhout's A Philosophy of Software Design and Thomas and Hunt's The Pragmatic Programmer address individual design and craft, the topics this book explicitly leaves out, so they pair well with it.

Bass, Clements and Kazman's Software Architecture in Practice and Jackson's Software Abstractions go deeper into architecture and formal modelling respectively. Students who have some industry or internship experience will get the most from Winters et al.; for those without it, reading Sommerville or an introductory title first provides context.

How to Use This Book

The book is aimed at working engineers, team leads and advanced students who have written code in a team and used version control, testing and code review. No particular language is required; code samples are illustrative.

Chapters are self-contained, so they can be read selectively. Chapter 1 is essential because it defines the vocabulary used throughout. For a course module on testing, read Chapters 11–14 in order; for code quality, Chapters 8, 9, 19 and 20; for release engineering, Chapters 16, 18 and 21–24. Students interested in leadership or team practice should read Part II (Chapters 2–7). Chapter 25 assumes some familiarity with distributed systems.

Use each chapter's TL;DR list as a discussion prompt, and for every practice ask the question the book itself raises: does this trade-off make sense at the scale and code life span of the reader's own project? The free HTML edition is published on abseil.io under a Creative Commons Attribution-NonCommercial-NoDerivatives licence.

Edition and Sources

This guide is based on the free HTML edition of Software Engineering at Google (first edition, O'Reilly, 2020) published at https://abseil.io/resources/swe-book. It draws on the foreword, the preface in full, the part divisions in the table of contents, all 25 chapters (every section heading, chapter openings, conclusions and TL;DR lists, with Chapter 1 read in detail) and the afterword.