BSSE and BSCS students can read Software Engineering at Google free online. It is an industry textbook edited by Titus Winters, Tom Manshreck and Hyrum Wright, and it fits the Software Engineering, Software Construction, Software Quality Assurance and Professional Practices courses. There is no official PDF: the authors keep the full book free to read in the browser, and O’Reilly sells the print and e-book editions.
The book is about what changes when code lives for years and many people work on it. It is organized in four parts: Thesis, Culture, Processes and Tools. You will find team culture, code review, documentation, unit and larger testing, version control, builds, static analysis, dependency management, continuous integration and delivery. Be aware that it describes practices at Google’s very large scale, so many of them will not apply to a small team or a semester project. Read it for the ideas and the reasoning behind them.
Book Overview
| Course | Software Engineering / Software Construction / Professional Practices |
| Degree Programs | BSSE, BSCS |
| Level | University / Undergraduate (upper semesters) |
| Edition | Online edition of the March 2020 O’Reilly book (no edition number is given) |
| Authors | Titus Winters, Tom Manshreck, Hyrum Wright (curators), with chapters by many Google engineers |
| Publisher | O’Reilly Media (print and e-book); free online edition on abseil.io |
| Structure | 4 parts: Thesis, Culture, Processes, Tools, plus a short Afterword |
| Total Chapters | 25 chapters plus a foreword, a preface and an afterword |
| Exercises | No exercise sets; each chapter ends with a TL;DRs summary |
| Language | English |
| License | CC BY-NC-ND 4.0 (online edition) — Model: Link-only |
| Format | Free online book (HTML); no PDF; print and e-book from O’Reilly |
Chapter List
Chapter 1: What Is Software Engineering?
Part: Thesis · Difficulty: Easy · Key topics: time, scale, trade-offs, sustainability, Hyrum’s Law, shifting left, cost
The opening chapter defines software engineering as programming integrated over time and separates it from plain programming along three axes: time, scale and trade-offs. On time, it explains why code that lives for years must be able to change, and introduces Hyrum’s Law with a hash-ordering example. On scale, it contrasts policies that grow badly with headcount against ones that grow well, using Google’s 2006 compiler upgrade as a case. On trade-offs, it asks engineers to justify decisions with data and precedent instead of “because I said so”, and ends by saying Google’s way is one proven example, not the only way.
Key Points:
- Programming produces code; software engineering also covers maintaining that code over its whole useful life.
- Code that must live for a few minutes and code that must live for decades differ in expected lifespan by a factor of about 100,000.
- A project is sustainable when the team is able to react to valuable change, even if it chooses not to.
- Hyrum’s Law: with enough users of an API, every observable behaviour will be depended on by somebody.
- Good processes should scale sublinearly with the size of the organization and the codebase.
- “Cost” includes money, resources, people, transactions, opportunity and society, not only budget.
Memory Tip: Remember the three axes as T-S-T: Time, Scale, Trade-offs. Every later chapter applies at least one of them.
Common Mistake: Reading “software engineering” as “writing bigger programs”. The book’s point is that the extra ingredients are time and other people.
Important Questions:
- What is the difference between programming and software engineering? Programming is producing code; software engineering is programming integrated over time, including how the code is changed and maintained by many people over its life.
- What is Hyrum’s Law? With a large enough number of users, every observable behaviour of an API, documented or not, will be relied on by someone, so changing it can break users.
Chapter 2: How to Work Well on Teams
Part: Culture · Difficulty: Easy · Key topics: genius myth, bus factor, humility, respect, trust, blameless postmortem, feedback
This chapter argues that software engineering is a team sport and that hiding unfinished work is risky. It debunks the “genius myth” by pointing out that well-known engineers succeeded inside teams, then shows what hiding costs: late detection of design mistakes, a low bus factor and slower progress. The second half builds the team around three pillars, humility, respect and trust, and turns them into habits such as losing your ego, giving and taking criticism, failing fast and learning patience. It closes with blameless postmortems as the way to learn from failure.
Key Points:
- Bus factor is the number of people who must disappear before a project is in serious trouble; spread knowledge to raise it.
- Sharing work early catches design mistakes while they are still cheap to fix.
- The three pillars are humility (you are not the centre of the universe), respect and trust.
- Criticize the work, not the person, and accept feedback without defensiveness.
- A blameless postmortem records timeline, root cause, impact, action items and lessons.
- The chapter notes that private offices and open floor plans both have drawbacks.
Memory Tip: H-R-T: Humility, Respect, Trust. If a team conflict feels stuck, ask which of the three is missing.
Common Mistake: Waiting until a project “looks good” before showing it to the team. The chapter says early sharing is exactly what saves effort.
Important Questions:
- What is the bus factor and why does it matter? It is the number of people who would need to be lost before a project is doomed; a higher number means knowledge is shared and the project survives departures.
- What are the three pillars of social interaction? Humility, respect and trust.
Chapter 3: Knowledge Sharing
Part: Culture · Difficulty: Easy · Key topics: psychological safety, mentorship, documentation, Q&A channels, canonical sources, readability
Chapter 3 explains how an organization lets people learn without slowing everyone down. It begins with the obstacles: fear of looking ignorant, information islands that duplicate work, single points of failure and “haunted graveyard” code nobody dares touch. Psychological safety is presented as the base, followed by ways to grow your own knowledge, scale your questions through chats, mailing lists and a Q&A platform, and scale your answers through office hours, talks and documentation. The last section describes Google’s readability process, in which code review doubles as standardized mentorship.
Key Points:
- Admitting what you do not know is a prerequisite for learning, which is why psychological safety comes first.
- Information islands cause fragmentation, duplication and skew between groups doing the same task.
- Chesterton’s fence: understand why something exists before you remove it.
- Group chats are fast but poor records; mailing lists and Q&A sites keep searchable answers.
- Canonical sources such as developer guides and short go/ links reduce repeated questions.
- The readability process certifies engineers per language through code review by trained reviewers.
Memory Tip: Think of three scales: ask (you), teach (your team), canonize (the organization). Each level needs its own tool.
Common Mistake: Copying a code pattern without learning why it exists. The chapter calls this parroting and links it to fragile, haunted code.
Important Questions:
- What is psychological safety? A setting where people can ask questions and admit mistakes without fear of punishment; the chapter treats it as the foundation for knowledge sharing.
- What is an information island? A group that works without talking to others and builds its own practices, causing fragmentation, duplicated solutions and inconsistent results.
Chapter 4: Engineering for Equity
Part: Culture · Difficulty: Medium · Key topics: unconscious bias, diversity, inclusive design, representative data, discernment, equity
This chapter treats equity as an engineering responsibility, because software built by a narrow group tends to fail users outside it. It argues that bias is the default, using Google’s own image-recognition failure as a case study, and explains why engineers need multicultural understanding and the judgment to decide when not to build something. It then asks organizations to make diversity actionable: fix retention as well as hiring, build for the hardest-to-serve users first, and measure equity instead of assuming it. A hiring-system example shows how performance ratings were found not to predict future performance.
Key Points:
- Unconscious bias is the default and is harder to catch than intentional exclusion.
- Training data that does not represent all users produces products that work worse for some of them.
- Discernment means knowing when a feature should not be built at all.
- Fixing only the hiring pipeline is a singular approach; progression and retention matter too.
- Designing for the user who will struggle most tends to benefit everyone.
- Slowing a release can be better than shipping something that harms some users.
Memory Tip: “Measure, don’t assume”: the chapter’s fix for good intentions is to measure equity outcomes.
Common Mistake: Treating the chapter as a social-science essay with no engineering content. Its examples are product failures such as image labelling, autocomplete and facial recognition.
Important Questions:
- Why does the chapter say bias is the default? Because most people hold unconscious bias and an unrepresentative team and dataset will build products that reflect it unless someone actively corrects for it.
- What is a singular approach to diversity and why is it insufficient? Fixing only one thing, such as hiring; retention, progression and inclusive product design must be addressed as well.
Chapter 5: How to Lead a Team
Part: Culture · Difficulty: Easy · Key topics: engineering manager, tech lead, servant leadership, antipatterns, psychological safety, delegation, motivation
Chapter 5 separates two leadership roles: the engineering manager, who looks after people, and the tech lead, who owns technical direction, and notes that small teams often combine them. It explains why moving from individual contributor to leader feels frightening and introduces servant leadership, where the leader removes obstacles instead of issuing orders. A list of antipatterns, such as hiring pushovers and ignoring low performers, is followed by positive patterns: lose the ego, stay calm, remove roadblocks, set clear goals and be honest. It ends with intrinsic motivation, built on autonomy, mastery and purpose.
Key Points:
- An engineering manager is responsible for the performance, productivity and happiness of the team.
- A tech lead owns technical decisions, architecture and priorities; a tech lead manager does both jobs.
- Servant leadership means serving the team by removing obstacles and building trust.
- Antipatterns include hiring pushovers, ignoring low performers and being everyone’s friend.
- Praise in public and criticize in private; run failures as blameless postmortems.
- Intrinsic motivation comes from autonomy, mastery and purpose.
Memory Tip: A-M-P for motivation: Autonomy, Mastery, Purpose.
Common Mistake: Assuming the best engineer automatically makes the best manager. The chapter says organizations should offer parallel career paths so people are not pushed into management.
Important Questions:
- What is the difference between an engineering manager and a tech lead? The manager leads people and their growth and happiness; the tech lead leads technical decisions, architecture and velocity.
- What is servant leadership? Leading by serving the team: removing roadblocks, shielding them from chaos and building humility, respect and trust.
Chapter 6: Leading at Scale
Part: Culture · Difficulty: Medium · Key topics: leading a team of teams, always be deciding, always be leaving, always be scaling, trade-offs, delegation
This chapter follows on from Chapter 5 and covers leading several teams at once, where the work becomes broader and more abstract. It is organized around three habits. Always Be Deciding means naming the key trade-offs of a hard problem and then iterating, shown through a Search latency case study. Always Be Leaving means building an organization that works without you by dividing problems, delegating subproblems and tying team identity to a problem, not a product. Always Be Scaling protects the leader’s time and energy by separating the important from the urgent and learning to drop balls.
Key Points:
- Ambiguous problems have no permanent answer, only the best trade-off for now; revisit it regularly.
- A leader who cannot disappear for a week is a single point of failure.
- Divide the problem space so that teams own problems, not specific solutions.
- Anchor a team to a problem, because products are temporary solutions.
- The cycle of success runs from analysis to struggle to traction to reward.
- Protect your energy with real vacations and short breaks, and let low-value tasks go.
Memory Tip: Three ABCs: Always Be Deciding, Always Be Leaving, Always Be Scaling.
Common Mistake: Micromanaging in the name of quality. The chapter says it recreates the single point of failure you were trying to remove.
Important Questions:
- What does “Always Be Leaving” mean? Build an organization that can solve a class of problems without you, so you are not a single point of failure.
- Why should a team be tied to a problem and not a product? Products are temporary solutions, and a team attached to one resists change when a better solution appears.
Chapter 7: Measuring Engineering Productivity
Part: Culture · Difficulty: Hard · Key topics: Goals/Signals/Metrics, QUANTS, triangulation, surveys, logs, triage, actionable results
Chapter 7 explains how Google decides whether to measure something about developer productivity and how to do it well. A triage step asks what result is expected, what action follows if the data agrees or disagrees, and who will decide. The Goals/Signals/Metrics framework then links a goal to a signal and to a measurable proxy, and the QUANTS list (quality, attention, intellectual complexity, tempo and satisfaction) keeps one improvement from damaging another. The readability process serves as the running example: engineers used surveys and tool logs, checked them against each other and then acted on the results.
Key Points:
- Do not measure unless a result, positive or negative, could change a decision.
- A goal is the desired outcome, a signal is how you would know it was met, and a metric is a measurable proxy for the signal.
- The streetlight effect is measuring only what is easy to measure.
- QUANTS: Quality of code, Attention, Intellectual complexity, Tempo and velocity, Satisfaction.
- Triangulation uses several imperfect metrics; disagreement means one of them may be wrong.
- Surveys and tool logs complement each other: one gives context, the other gives scale.
Memory Tip: Read GSM as a staircase: Goal at the top, Signal in the middle, Metric at the bottom, each step traceable to the one above.
Common Mistake: Picking a metric first and inventing a goal for it afterwards. GSM exists to stop exactly that.
Important Questions:
- What is the Goals/Signals/Metrics framework? A way to link metrics to goals: the goal states the outcome, the signal is how you would recognize it, and the metric is a measurable proxy for the signal.
- What does QUANTS stand for? Quality of the code, Attention from engineers, Intellectual complexity, Tempo and velocity, and Satisfaction.
Chapter 8: Style Guides and Rules
Part: Processes · Difficulty: Medium · Key topics: rules versus guidance, consistency, readability, style arbiters, automation, formatters, exceptions
The chapter asks what rules a codebase needs and why. It separates mandatory rules from recommended guidance and says every rule must pull its weight, because each one has a learning and maintenance cost. Five principles shape Google’s rules: optimize for the reader, be consistent, avoid error-prone constructs, concede to practicalities, and keep rules few. Rules fall into avoiding dangers, enforcing best practices and building consistency. The chapter also covers changing rules, using primers and tips as guidance, and enforcing rules through training, code review and above all automated tools such as formatters.
Key Points:
- Rules are musts, guidance is shoulds; not everything deserves to be a rule.
- Code is read far more often than it is written, so optimize for the reader.
- Consistency lets engineers move between projects and lets tools work everywhere.
- Rules record their pros, cons and reasoning so they can be reviewed when a language changes.
- Automated checks and formatters such as
gofmtandclang-formatenforce style without arguments. - Exceptions are allowed when the benefit clearly outweighs the cost of breaking a rule.
Memory Tip: Ask of any proposed rule: “What goal does this serve?” If you cannot answer, it should be guidance or nothing.
Common Mistake: Writing a rule for every preference. The chapter says more rules mean more cost and less compliance.
Important Questions:
- What is the difference between a rule and guidance? A rule is mandatory and enforced; guidance is recommended best practice that leaves room for judgment.
- Why is consistency valuable in a codebase? It lets engineers move between projects, helps people recognize patterns quickly and lets tools be applied across the whole codebase.
Chapter 9: Code Review
Part: Processes · Difficulty: Medium · Key topics: precommit review, LGTM, OWNERS, readability approval, code health, small changes, best practices
Chapter 9 describes how nearly every change at Google is reviewed by another engineer before it is committed. It walks through the review flow, from writing a change to getting approval, and explains the three approvals a change may need: a peer’s LGTM, the owner of the directory, and a readability approval for the language. The benefits are correctness, comprehension, consistency, cultural effects, knowledge sharing and a historical record. Best practices include being polite, writing small changes of around 200 lines, writing good descriptions, using few reviewers and automating what tools can check.
Key Points:
- Precommit review means the change is reviewed before it enters the codebase.
- LGTM, owner approval and readability approval are three separate checks on a change.
- OWNERS files give hierarchical ownership of directories.
- Comprehension, whether someone other than the author can understand the code, matters as much as correctness.
- Small changes are reviewed faster and are easier to debug and roll back.
- Presubmit automation handles formatting and basic checks so humans can focus on design.
Memory Tip: Three keys open a change: Peer, Owner, Readability.
Common Mistake: Sending one huge change with unrelated fixes bundled in. The chapter says this slows review and makes rollbacks harder.
Important Questions:
- What are the main benefits of code review? Correctness, comprehension, consistency, psychological and cultural benefits, knowledge sharing, and a historical record of why a change was made.
- Why should changes be small? Small changes are reviewed more quickly and thoroughly and are easier to debug and roll back.
Chapter 10: Documentation
Part: Processes · Difficulty: Easy · Key topics: documentation as code, audience, reference docs, design docs, tutorials, canonical sources, reviews
Chapter 10 treats documentation as a tool that needs owners, source control and review, just like code. A case study of Google’s old wiki shows how flat, ownerless pages decay. The chapter then teaches writing for a specific audience, such as seekers who know what they want and stumblers who do not, and gives each document type its own purpose: reference comments, design docs, tutorials, conceptual documents and landing pages. It adds three kinds of documentation review, a short guide to structure and clarity, advice on retiring old pages and a note on when professional technical writers are worth having.
Key Points:
- Documentation changes should use the normal developer workflow: source control, owners and review.
- Every document should serve one purpose; mixing tutorial, reference and concept confuses readers.
- Write for your audience, not yourself, and keep customer and maintainer documentation separate.
- A function comment should begin with an active verb describing what the function does.
- Design docs record goals, strategy, trade-offs and alternatives before work starts.
- Freshness dates and deprecation labels stop obsolete pages from misleading readers.
Memory Tip: Open every document with WHO, WHAT, WHEN, WHERE and WHY, then explain HOW.
Common Mistake: Writing one giant page that is tutorial, reference and design rationale at once. Readers cannot find what they came for.
Important Questions:
- Why does the chapter say documentation is like code? Because it needs owners, source control, reviews, issue tracking and regular evaluation to stay accurate and useful.
- What is the difference between seekers and stumblers? Seekers know what they need and want consistent, scannable pages; stumblers do not and need clear overviews.
Chapter 11: Testing Overview
Part: Processes · Difficulty: Medium · Key topics: automated tests, test size, test scope, flaky tests, hermetic tests, test pyramid, Beyoncé Rule, code coverage
Chapter 11 argues that developer-written automated tests are what make large software safe to change. The Google Web Server story shows the effect: once the tech lead required tests with every change, emergency pushes fell sharply. The chapter then shows how to design a test suite. Tests are classified by size (small, medium, large, set by the resources they use) and by scope (unit, integration, end-to-end), with a recommended pyramid of mostly unit tests. It covers flaky tests, the Beyoncé Rule, code coverage, the pitfalls of brittle tests and slow suites, and how Google’s testing culture grew.
Key Points:
- Test size is about resources: small tests run in one process, medium tests on one machine, large tests across machines.
- Test scope is about how much code is validated: unit, integration or end-to-end.
- The recommended mix is roughly 80% unit, 15% integration and 5% end-to-end tests.
- A flaky test passes or fails without any code change and destroys trust in the suite.
- Beyoncé Rule: if you liked it, you should have put a test on it.
- Coverage shows which lines ran, not whether behaviour was checked.
Memory Tip: Picture a pyramid: wide base of fast unit tests, narrow tip of slow end-to-end tests. An “ice cream cone” is that picture upside down.
Common Mistake: Equating size with the number of lines in a test. In this book, size means the resources the test needs.
Important Questions:
- What is a flaky test? A test that passes or fails nondeterministically for the same code; at scale it wastes engineer time and makes people ignore failures.
- What does the test pyramid recommend? Many fast unit tests at the base, fewer integration tests in the middle and very few end-to-end tests at the top.
Chapter 12: Unit Testing
Part: Processes · Difficulty: Medium · Key topics: brittle tests, public APIs, state versus interaction testing, behaviours, given/when/then, DAMP versus DRY
This chapter is about writing unit tests that stay useful as code changes. It first targets brittle tests, which fail on harmless changes: aim for tests that never need to change unless requirements do, call the code through its public API, and check state, not the sequence of calls. It then covers clear tests: make each test complete and concise, test behaviours instead of methods, use given/when/then structure, name tests after behaviour, keep logic out of tests and write informative failure messages. Finally it argues that tests should be DAMP, descriptive and meaningful, rather than strictly DRY.
Key Points:
- A brittle test fails because of an unrelated change; a flaky test fails with no change at all.
- Only a real behaviour change should force existing tests to change; refactors, new features and bug fixes should not.
- State testing checks the result; interaction testing checks which calls were made and is more brittle.
- Write one test per behaviour, structured as given, when, then (arrange, act, assert).
- Avoid loops, conditionals and string building inside tests, which can hide bugs.
- DAMP: Descriptive And Meaningful Phrases; a little duplication is fine if it makes a test readable.
Practice Tip: Take a test you wrote that calls a private helper, rewrite it to use only the public method, then refactor the helper. If the test still passes, it has become robust.
Common Mistake: Naming a test after a method (testWithdraw) instead of the behaviour (“rejects withdrawal when the balance is too low”).
Important Questions:
- Why should tests exercise the public API? Tests that use internal details break whenever the implementation is refactored, while public-API tests only change when behaviour changes.
- What does DAMP mean and how does it differ from DRY? DAMP favours descriptive, self-contained tests even with some repetition, whereas DRY removes repetition and can hide a test’s meaning in helpers.
Chapter 13: Test Doubles
Part: Processes · Difficulty: Medium · Key topics: fakes, stubs, mocks, seams, interaction testing, fidelity, real implementations, dependency injection
Chapter 13 covers test doubles, the stand-ins that replace real dependencies in tests. It weighs three costs: testability (code must have seams where a double can be inserted), applicability and fidelity, meaning how closely the double behaves like the real thing. Using a payment-processor example it introduces faking, stubbing and interaction testing, and ranks them. A real implementation is preferred, a fake is often next best, and stubbing and interaction testing should be used sparingly because they expose implementation details and make tests brittle. Early overuse of mocking frameworks at Google is the cautionary tale.
Key Points:
- A real implementation should be preferred over a test double whenever it is fast and deterministic enough.
- A fake is a lightweight working implementation, such as an in-memory file system, and should be tested itself.
- A stub hard-codes return values; overusing stubs makes tests unclear and brittle.
- Interaction testing verifies that a call happened; prefer state testing where possible.
- A seam is a place where a dependency can be replaced, usually through dependency injection.
- Fidelity is how closely a double matches the real system’s contract.
Practice Tip: Write a tiny in-memory fake of a database class and use it in two tests. Notice that you never have to write when(...).thenReturn(...) lines.
Common Mistake: Mocking every collaborator by habit. The chapter says this produces tests that rarely find real bugs and break on every refactor.
Important Questions:
- What is the difference between a fake and a stub? A fake is a working lightweight implementation with real behaviour, while a stub only returns hard-coded values for specific calls.
- Why should interaction testing be avoided where possible? It checks how a result was reached, not the result itself, so it exposes implementation details and fails on harmless refactors.
Chapter 14: Larger Testing
Part: Processes · Difficulty: Medium · Key topics: fidelity, system under test, seeded data, hermeticity, A/B diff testing, probers, canary analysis, record/replay
Chapter 14 explains why unit tests are not enough and what larger tests add. It lists common gaps, such as unfaithful doubles, configuration problems, load, and unanticipated or emergent behaviours, and the costs of larger tests in speed, reliability and ownership. A large test is described as four parts: a system under test, seeded data, actions and verification, with a trade-off between hermetic isolation and real-world fidelity. The chapter surveys ten types, from functional tests and A/B diff tests to probers, canary analysis, disaster recovery drills and user evaluation, and asks teams to map risks to the tests that mitigate them.
Key Points:
- Fidelity is how closely a test reflects the real behaviour of the system under test.
- A large test has a system under test, seeded data, actions and verification.
- A hermetic system under test is isolated from outside interference; more isolation usually means less fidelity.
- A/B diff testing compares the output of two versions; running A against A measures noise.
- Probers and canary analysis check the production system; the chapter calls configuration changes a leading cause of major outages at Google.
- Record and replay turns traffic captured in large tests into smaller, faster tests.
Memory Tip: Remember the four parts as S-D-A-V: System, Data, Actions, Verification.
Common Mistake: Believing that more large tests always mean more safety. The chapter shows they are slow and flaky, so each one must earn its place by covering a named risk.
Important Questions:
- What gaps do larger tests fill that unit tests cannot? Unfaithful doubles, configuration problems, behaviour under load, unanticipated behaviour and emergent behaviour across components.
- What are the four parts of a large test? The system under test, seeded data, actions, and verification.
Chapter 15: Deprecation
Part: Processes · Difficulty: Medium · Key topics: code is a liability, advisory and compulsory deprecation, Hyrum’s Law, ownership, milestones, backsliding
Chapter 15 starts from the idea that code is a liability, not an asset, so old systems should be retired in an orderly way. It explains why deprecation is hard: replacements are rarely one-to-one, users depend on behaviour in unexpected ways, and the cost of keeping old code is diffuse. The chapter recommends planning for removal at design time and separates advisory deprecation, which relies on persuasion and rarely finishes, from compulsory deprecation, which has a deadline, enforcement and a funded team. It then covers actionable warnings, process owners, milestones and tooling that finds users, migrates them and prevents backsliding.
Key Points:
- Age alone is not a reason to deprecate; the target is a demonstrably obsolete system with a usable replacement.
- Advisory deprecation has no deadline; compulsory deprecation has a deadline and enforcement.
- Deprecation warnings must be actionable and relevant, or people ignore them.
- An explicit owner whose main goal is removal makes the project finish.
- Planned outages of a deprecated system reveal hidden dependencies.
- Backsliding is new users appearing after deprecation begins; build visibility rules block it.
Memory Tip: “Hope is not a strategy”: if nobody owns the deadline, the old system will still be there next year.
Common Mistake: Announcing a deprecation with no owner, deadline or migration help and expecting users to move on their own.
Important Questions:
- What is the difference between advisory and compulsory deprecation? Advisory deprecation encourages users to move with no deadline or dedicated resources; compulsory deprecation sets a deadline, enforcement and a team to carry it out.
- Why is deprecation so hard? Users depend on the system in ways its designers never planned (Hyrum’s Law), replacements are not exact, and the cost of inaction is hard to see.
Chapter 16: Version Control and Branch Management
Part: Tools · Difficulty: Medium · Key topics: centralized and distributed VCS, source of truth, branches, monorepo, one-version rule, trunk-based development, Piper
Chapter 16 explains what version control is, from file-level locking to atomic multi-file commits, and compares centralized systems with distributed ones such as Git and Mercurial. It argues that every project needs one source of truth and that long-lived development branches are a productivity drain, because tests, CI and review are better answers to stability. The second half describes Google’s setup: one monorepo run on an in-house system called Piper, per-directory OWNERS files, the One-Version Rule and almost no long-lived branches. It admits that a monorepo is not right for everyone and mentions virtual monorepos.
Key Points:
- Version control extends a file system from (filename) to (filename, time, branch).
- In a distributed VCS such as Git, which copy is central becomes a matter of policy.
- Unfinished work is like a branch: it has coordination costs even before it is committed.
- One-Version Rule: developers should never choose which version of a component to depend on.
- Trunk-based development hides unfinished features behind flags instead of long-lived branches.
- Piper is Google’s in-house centralized system; Git is improving for large repositories with shallow clones and sparse checkouts.
Practice Tip: On a practice repository, create a feature branch, commit twice and merge it back the same day. Then count how many merge conflicts a branch left open for weeks would have caused.
Common Mistake: Copying Google’s monorepo for a small team. The chapter gives it as one answer to Google’s scale and says multi-repo suits different legal or security needs.
Important Questions:
- What is the One-Version Rule? Each dependency should have exactly one version available in the codebase, which avoids diamond dependencies and conflicting versions at run time.
- Why does the chapter discourage long-lived development branches? They delay integration and create merge coordination work; tests, CI and code review keep trunk stable without them.
Chapter 17: Code Search
Part: Tools · Difficulty: Medium · Key topics: Code Search, cross-references, indexing, ranking, latency, trade-offs, trust
Chapter 17 describes Code Search, the web tool Google engineers use to answer questions about code, and why a custom tool was needed for a codebase this size. It groups real usage by intent: where something is, what it does, how it is used, why it behaves as it does, and who wrote it or when. The chapter then looks at design: low query and index latency, a search index built for scale, ranking with query-dependent and query-independent signals, and choices about completeness and expressiveness. Its main claim is that a tool is used only if it is trusted, which needs complete indexing and relevant results first.
Key Points:
- Developers use code search to find where, what, how, why and who or when.
- Cross-references and symbol navigation are powered by build-aware tools, not text matching.
- A sparse n-gram index replaced the trigram index and handles regular-expression queries efficiently.
- Ranking combines query-independent signals such as file popularity with query-dependent matches.
- Interactive tools need low latency; the chapter’s target for frequent actions is under 200 ms.
- Trust depends on complete indexing, complete results and the most relevant results appearing first.
Memory Tip: Five question words: Where, What, How, Why, Who/When. They cover most of what engineers ask of code.
Common Mistake: Assuming you need Google’s tool. The point of the chapter is the principles; ordinary tools such as IDE search or grep work for small codebases.
Important Questions:
- Why did Google build a separate web tool for code search? Because of the scale of the codebase, the value of a zero-setup global view and the need to integrate with other tools.
- What makes developers trust a search tool? Complete indexing, complete results and showing the most relevant results first.
Chapter 18: Build Systems and Build Philosophy
Part: Tools · Difficulty: Hard · Key topics: build systems, Bazel, task-based versus artifact-based builds, remote caching, sandboxing, modules, dependencies
Chapter 18 explains why a project needs a build system and what makes a good one. It starts with the limits of calling a compiler directly and of shell scripts, then explains that a build system is mostly about managing dependencies. Task-based systems such as Ant, Maven and Gradle let engineers write arbitrary tasks, while artifact-based systems such as Blaze, Bazel, Pants and Buck have engineers declare what to build and let the system decide how. That makes builds parallel, cacheable and reproducible. The chapter ends with distributed builds, fine-grained modules, visibility rules and how to manage external dependencies.
Key Points:
- A good build is fast and correct: the same inputs should give the same outputs on any machine.
- Task-based systems are flexible, but the system cannot see what a task does, which limits parallelism and caching.
- Artifact-based systems treat a build like a pure function from sources and tools to outputs.
- Bazel is the open source version of Google’s internal build system, Blaze.
- Remote caching shares build outputs; remote execution runs build actions on a pool of workers.
- External dependencies should be pinned to explicit versions, not set to latest.
Practice Tip: Write a small Makefile or Bazel BUILD file for a two-file program, build it twice and watch the second build do nothing. That is the incremental build the chapter is about.
Common Mistake: Treating the build as a pile of shell scripts that “works on my machine”. The chapter says this breaks onboarding and disaster recovery.
Important Questions:
- What is the difference between task-based and artifact-based build systems? Task-based systems run engineer-written tasks; artifact-based systems have engineers declare the artifacts and dependencies and let the system plan the work, which allows safe parallelism and caching.
- Why should modules be fine-grained? Smaller modules allow more parallel builds, better caching and running only the tests affected by a change.
Chapter 19: Critique: Google’s Code Review Tool
Part: Tools · Difficulty: Medium · Key topics: Critique, review flow, diffs, analysis results, attention set, approvals, tool integration, Gerrit
Chapter 19 takes the code review process from Chapter 9 and shows the tool behind it. Critique is built on four principles: simplicity, a foundation of trust, generic communication and workflow integration. The chapter follows a change through six stages: create a change, request review, understand and comment, modify and reply, approve and commit. It describes the diff view, analysis results from static analyzers, reviewer suggestions, the attention set that shows whose turn it is, and the rules for scoring approvals. A closing case study compares Critique with the open source Gerrit. Critique itself is Google-internal.
Key Points:
- Critique’s design principles are simplicity, trust, generic communication and workflow integration.
- Most reviews are precommit and follow six steps from creating a change to committing it.
- A snapshot is the version of a change uploaded for review; each update creates a new one.
- Comments are either unresolved (must be addressed) or resolved (informational).
- The attention set shows the people a change is currently waiting on.
- Gerrit is the open source alternative for projects outside Google’s monorepo.
Memory Tip: Remember the flow as six verbs: create, request, comment, modify, approve, commit.
Common Mistake: Looking for Critique to download. It is internal to Google; read the chapter for the ideas and try Gerrit or your Git host’s review tool.
Important Questions:
- What is the attention set? The list of people a change is currently blocked on, so everyone can see whose turn it is to act.
- What are the steps of the code review flow in Critique? Create a change, request review, comment, modify and reply, approve, and commit.
Chapter 20: Static Analysis
Part: Tools · Difficulty: Medium · Key topics: static analysis, Tricorder, false positives, Error Prone, clang-tidy, code review integration, suggested fixes
Chapter 20 covers tools that examine source code without running it to find bugs, antipatterns and maintainability problems. It names two properties of effective analysis, scalability and usability, and then three lessons: focus on developer happiness by keeping false positives low, make analysis part of the core workflow, mainly code review, and let domain experts write their own checks. It then describes Tricorder, Google’s analysis platform, with Error Prone for Java and clang-tidy for C++, feedback buttons such as Not useful and Please fix, automatic suggested fixes, presubmits and compiler integration.
Key Points:
- Static analysis inspects code without executing it.
- An “effective false positive” is any warning developers do not act on, even if it is technically correct.
- The best integration point is code review, where developers are already looking at changes.
- Showing only newly introduced warnings keeps results actionable.
- Error Prone (Java) and clang-tidy (C++) detect antipatterns in the syntax tree.
- Domain experts can add checks, and suggested fixes can be applied automatically.
Practice Tip: Turn on all warnings in your compiler (for C, gcc -Wall -Wextra) on an old project and see which warnings are real bugs and which are noise.
Common Mistake: Flooding developers with warnings in the editor or compiler. The chapter says people learn to ignore a noisy tool, so a few trusted checks beat many doubtful ones.
Important Questions:
- What is an effective false positive? Any static analysis warning that developers do not take action on, whether or not it is technically correct.
- Why integrate static analysis into code review? Developers are already examining the change, can fix issues cheaply, and reviewers can ask for fixes.
Chapter 21: Dependency Management
Part: Tools · Difficulty: Hard · Key topics: diamond dependency, SemVer, Minimum Version Selection, Live at Head, SAT solvers, Hyrum’s Law, importing and exporting dependencies
Chapter 21 deals with networks of libraries you do not control. Its central problem is conflicting requirements, the diamond dependency, where two libraries need incompatible versions of a third. The chapter advises weighing the maintenance cost of any import and then compares four models: nothing changes, semantic versioning, bundled distributions and Live at Head. It explains why SemVer can both overconstrain and overpromise, and why solving version constraints is hard. Minimum Version Selection, from Go, is presented as an improvement. A thought experiment about infinite resources and an example of exporting a library close the chapter.
Key Points:
- Prefer problems you can solve in source control to problems of dependency management.
- A diamond dependency happens when two paths need incompatible versions of one library.
- SemVer uses major.minor.patch numbers as a human estimate of risk, not as proof of compatibility.
- Minimum Version Selection picks the lowest version that satisfies all constraints.
- Live at Head means always depending on current versions, with providers testing against their users.
- Publishing a library is never free; plan for long-term support.
Memory Tip: Draw the diamond: your app on top, two libraries in the middle, the shared library at the bottom. If the two middle ones want different versions of the bottom, you are in trouble.
Common Mistake: Trusting a version number as a guarantee. The chapter shows that a patch release can still change behaviour someone depends on.
Important Questions:
- What is a diamond dependency? A situation where two libraries your code uses depend on incompatible versions of the same third library.
- What are the limitations of semantic versioning? It can overconstrain, demanding a major bump for an unused API, and overpromise, because behaviour changes can break users even in minor releases.
Chapter 22: Large-Scale Changes
Part: Tools · Difficulty: Hard · Key topics: LSC, atomic changes, Rosie, sharding, global approvers, testing, tooling, LSC process
Chapter 22 explains how to change a codebase when the change cannot be committed as a single atomic unit. It defines a large-scale change and shows why traditional refactoring breaks at scale: merge conflicts, test cost, version control limits and the risk of “haunted graveyard” code. The chapter then lists the infrastructure Google relies on, including supportive policy, codebase analysis tools, a change-management tool called Rosie that shards a large change by project and owner, strong testing and language-aware tools. It finishes with the LSC process: authorization, creating the change, sharding and submitting, and cleanup, with a migration of over 500,000 references as a case study.
Key Points:
- An LSC is a set of related changes that cannot practically be submitted as one atomic change.
- Most LSCs are generated by tools, not typed by hand.
- Sharding splits a global change into pieces by project and ownership, each with its own test and review.
- Global approvers can approve any change and review LSC shards by pattern.
- Testing is the main safety net: affected tests run for each shard.
- Centralizing LSC work in infrastructure teams avoids unfunded mandates on every product team.
Memory Tip: Four steps: authorize, create, shard and submit, clean up.
Common Mistake: Sending a one-line instruction to every team to “migrate by next month”. The chapter says this is an unfunded mandate and a tool-driven change is cheaper overall.
Important Questions:
- What is a large-scale change? A logically related set of changes across the codebase that cannot practically be submitted as a single atomic unit.
- Why are LSCs sharded? A single huge change would hit merge conflicts, test limits and review limits; shards by project and owner can be tested, reviewed and submitted independently.
Chapter 23: Continuous Integration
Part: Tools · Difficulty: Medium · Key topics: continuous integration, fast feedback, presubmit, post-submit, continuous build, flaky tests, hermetic tests, TAP
Chapter 23 redefines continuous integration as continuously assembling and testing the whole fast-changing ecosystem, not just one codebase. Its core ideas are fast feedback loops, automation through a continuous build and continuous testing at different stages. The chapter separates fast presubmit tests from slower post-submit tests and explains why presubmit alone is not enough. It then covers real problems: culprit finding, mid-air collisions between changes, resource limits, failure management and flaky tests. Hermetic testing is offered as a remedy, and Google’s TAP system and the Takeout case study show it in practice.
Key Points:
- The earlier a problem is found, the cheaper it is to fix; CI exists to give fast, actionable feedback.
- Put fast, reliable tests on presubmit and slower, less deterministic tests on post-submit.
- A mid-air collision is two changes that pass alone but break tests together.
- A culprit is the change that broke the build; finding it quickly is a key CI task.
- Hermetic tests carry everything they need and are far less flaky.
- CI becomes more necessary, not less, as a codebase gets older and larger.
Practice Tip: Set up a free CI workflow on a practice repository that runs your unit tests on every push, then break a test on purpose and read the failure report.
Common Mistake: Saying “we cannot afford CI”. The chapter argues that CI moves cost earlier, where it is cheaper, rather than adding cost.
Important Questions:
- What is the difference between presubmit and post-submit testing? Presubmit runs a fast subset of tests before a change is submitted; post-submit runs broader, slower tests afterwards and tolerates more instability.
- What is a hermetic test and why does CI like it? A self-contained test with no uncontrolled external dependencies, so it is more reliable and less flaky.
Chapter 24: Continuous Delivery
Part: Tools · Difficulty: Medium · Key topics: continuous delivery, velocity, feature flags, staged rollout, release trains, canaries, shifting left
Chapter 24 argues that faster is safer: small, frequent releases lower risk and speed up learning. It begins with the idioms of continuous delivery at Google, which are agility, automation, isolation, reliability, data-driven decisions and phased rollout, and notes that velocity is a team sport that needs a modular architecture. It explains flag-guarding features so launches are separate from releases, and shows how the Search release train moved from weekly releases to a binary every other day. Later sections cover shipping only what is used, device diversity, staged rollouts, canaries and changing team culture.
Key Points:
- Continuous delivery means software is always in a releasable state, ideally moving toward production automatically.
- Feature flags guard code paths so a feature can be launched or rolled back without a new binary.
- A canary releases a change to a small percentage of users first to catch crashes early.
- Release trains leave on a fixed schedule; a missed change catches the next one.
- Ship only what gets used, because unused code adds size and risk.
- Shifting left means making data-driven decisions earlier through CI and automated deployment.
Memory Tip: Think “train, not taxi”: a release train leaves on time for everyone, a taxi waits for you.
Common Mistake: Assuming flags are a security measure. The chapter says flags alone do not protect secrets, and flag changes themselves need staged rollouts.
Important Questions:
- Why does the chapter say faster is safer? Smaller batches of change are easier to test and roll back, so frequent releases reduce risk and improve quality.
- What is a feature flag used for? To turn a code path on or off independently of the binary release, enabling gradual launches and fast rollback.
Chapter 25: Compute as a Service
Part: Tools · Difficulty: Hard · Key topics: Borg, containers, automation of toil, batch versus serving, managing state, serverless, public versus private cloud
Chapter 25 follows how a company moves from running programs on hand-managed machines to a managed compute platform. It starts by taming the environment through automation of toil, containerization with multitenancy, and rightsizing and autoscaling. It then explains how software must change to run on managed compute: expect failure, separate batch jobs from serving jobs, keep state outside the instance and connect through service discovery. A section on time and scale covers containers as an abstraction, with the Borg cluster manager as the example. The chapter closes with how to choose a compute service, comparing centralization with customization, serverless and public with private options.
Key Points:
- Manual machine management does not scale, so repeated work (toil) has to be automated.
- Containers isolate programs from the machine and make sharing machines (multitenancy) practical.
- Batch jobs favour throughput and tolerate restarts; serving jobs favour low latency and run long.
- Design for failure: keep state outside the instance and make requests idempotent.
- Treat servers as cattle (replaceable), not pets (hand-maintained).
- Serverless runs stateless functions on a shared framework and can scale to zero, at the price of less control.
Memory Tip: Cattle, not pets: if a server dies, the platform should replace it without you noticing.
Common Mistake: Hard-coding hostnames and ports and keeping state in local files. On a managed platform the instance can be moved or replaced at any time.
Important Questions:
- What is the difference between batch and serving jobs? Batch jobs process data and care about throughput, tolerating restarts; serving jobs answer requests, run for a long time and care about latency.
- Why are containers useful? They give each program an isolated, standard environment, so the platform team can change the machines underneath without breaking applications.
Afterword
Part: Conclusion · Difficulty: Easy · Key topics: sustainability, long-term code health, inclusion, accessibility, looking ahead
The Afterword is a short closing note by Asim Husain, a vice president of engineering at Google. It describes Google’s software engineering as a long-running experiment in keeping a large, evolving codebase healthy, and says the principles in the book made that work possible. It defines sustainability as being able to adapt to changes in product direction, platforms, libraries and operating systems. The author does not claim these methods work everywhere; he shares them, setbacks included, to show that planning for code health is valuable. He also stresses designing for inclusion, equity and accessibility, and looks ahead to AI and other new fields.
Key Points:
- The book presents Google’s practices as an experiment, not a universal prescription.
- Sustainability means a codebase can adapt as products, platforms and libraries change.
- Good solutions must solve today’s problems and still hold up as technical systems change.
- Engineers are responsible for designing with inclusion, equity and accessibility in mind.
- The Afterword is about 400 words and needs no technical background.
Common Mistake: Skipping it as a formality. It is two minutes long and states the book’s own limits.
Important Questions:
- How does the Afterword define sustainability? A codebase is sustainable when it can adapt to changes in product direction, platforms, libraries and operating systems over its lifespan.
- Does the Afterword claim Google’s methods work for everyone? No; it shares them, setbacks included, to show that long-term planning for code health is valuable and feasible.
How to Study This Book
The book has 25 chapters in four parts, plus a foreword, a preface and a short afterword. The Thesis part is only Chapter 1, and it is the chapter to read first because Time and Change, Scale and Growth, and Trade-offs and Costs run through everything else. The Culture part (Chapters 2 to 7), is about people and teams. The Processes part (Chapters 8 to 15), covers style guides, code review, documentation, testing and deprecation. The Tools part (Chapters 16 to 25), covers version control, search, builds, review tooling, static analysis, dependencies, large-scale changes, CI, delivery and compute. The Afterword closes the book as a short Conclusion.
For a Software Engineering or Software Construction course, the best reading list is Chapter 1, then Chapters 9 and 10 (code review and documentation), Chapters 11 to 14 (testing) and Chapters 23 and 24 (CI and delivery). Read the four testing chapters in order: 11 gives vocabulary, 12 and 13 teach unit tests and test doubles, and 14 shows what unit tests cannot cover. For a Software Project Management or Professional Practices course, read Chapters 2 to 7, which are about teams, knowledge sharing, equity, leadership and measuring productivity.
The Tools part is the hardest. Chapters 18 (builds), 21 (dependency management) and 22 (large-scale changes) assume you have used a build tool, a package manager and a version control system on a real project. If you have only done small assignments, read Chapter 16 together with a Git tutorial and try Chapter 18 with a simple Makefile before attempting Chapters 21 and 22. Chapters 17 (Code Search), 19 (Critique) and 25 (Compute as a Service) describe Google-internal tools, so read them for the ideas, not for something you can install.
Keep the scale in mind throughout. Google has a single repository with billions of lines of code and tens of thousands of engineers, and many practices in this book make sense only at that size. The preface and the foreword both say this: use the lessons as options and starting points, not a formula to copy. For a university team project, the portable parts are code review, good commit descriptions, unit tests with clear names, a CI workflow, short design documents and blameless retrospectives.
The chapters are independent enough to read in any order, and each ends with a TL;DRs list that works well as a revision checklist before an exam. There are no exercise sets, so the Important Questions in this page’s chapter blocks are a good way to check your understanding. The book also leaves out software design, project management, API design, security hardening and any one language, so plan to pair it with a course text for those topics.
Used In These Programs
This book is used for the Software Engineering course in: BS Computer Science and BS Software Engineering. Browse all Software Engineering books, all BSSE books or all Computer Science books.
Who Should Read This
This book is written for BSSE and BSCS students who have finished a first programming course and have worked in at least one team project, usually in the fifth to eighth semester when Software Engineering, Software Construction, Software Quality Assurance or Professional Practices are taught. It is also useful for final-year project teams who want a working picture of code review, testing and CI, and for students preparing for software-company interviews and internships. It is not a book for complete beginners to programming, and it is not a software design or programming-language text. Because every example is at Google’s scale, pair it with a smaller practical text such as Think Java or Think Python to keep practising the code itself.
Applicable Universities
This book is useful for students at Pakistani universities offering BS Software Engineering and BS Computer Science, including Punjab University, Virtual University, COMSATS, FAST, UET, NUST, and other HEC-recognized institutions.
Official Copy of Software Engineering at Google
This book is free from its official site. There is no official PDF, so the legitimate free way to read it is the complete online edition on abseil.io. Click the button below to open the official book page, then choose Read online to go through the chapters. A print edition can be bought from O’Reilly.
→ Visit Official PageFAQs
Is Software Engineering at Google free?
Yes. The authors publish the full book on abseil.io under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International licence (CC BY-NC-ND 4.0). That allows reading and sharing the online copy with credit for non-commercial use, but not changing it. The printed and e-book editions are sold by O’Reilly.
Is there a PDF of Software Engineering at Google?
The official page offers the HTML edition (Read online) and a link to buy the book from O’Reilly. It does not offer a PDF download. This page links only to the official site and does not host or copy any file.
Which edition is this, and is it still current?
The abseil.io page says the book was published in March 2020, and it gives no edition number or later revision date. The ideas about testing, review, culture and delivery are general, but some tools described are Google-internal or may have changed, so treat tool details as examples.
How many chapters does it have, and are there exercises?
There are 25 chapters in four parts (Thesis, Culture, Processes and Tools), plus a foreword, a preface and a short afterword. There are no exercise sets; each chapter ends with a TL;DRs list that you can use for revision.
Is it good for complete beginners?
Not as a first book. It is not a programming tutorial and it assumes you have written programs and, ideally, worked in a team project. Students from the fifth semester onward, or anyone preparing for internships and interviews, will get the most from it.
Will these practices work for a small team or a university project?
Some will and some will not. The authors work at a very large scale, with one huge shared repository and tens of thousands of engineers, so practices such as a monorepo or large-scale automated changes do not fit small teams. Code review, clear tests, short design documents, continuous integration and blameless retrospectives transfer well.
Related Books
- Think Java – Downey & Mayfield
- Think Python – Allen B. Downey
- Open Data Structures – Pat Morin
- Operating Systems: Three Easy Pieces – Arpaci-Dusseau
Software Engineering at Google is a rare look at how a very large engineering organization thinks about teams, tests, review, builds and releases, and why. It is not a how-to for small projects and not a design or programming text, but it gives you the vocabulary and the reasoning that software companies expect. Browse more Computer Science books for the rest of your semester.
Software Engineering at Google: Lessons Learned from Programming Over Time, curated by Titus Winters, Tom Manshreck and Hyrum Wright. Published by O’Reilly Media (March 2020). The online edition is made available on abseil.io under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License (CC BY-NC-ND 4.0). Official source: https://abseil.io/resources/swe-book. This page links to the official site and does not host or copy the book.
© Copyright Policy
Freebooks.pk is an educational resource for students in Pakistan. Textbooks and other books belong to their respective boards, authors and publishers, and all rights remain with them. If you are the copyright holder of any material on this page and want it changed or removed, please contact us or file a request under our DMCA policy. We review every request and remove reported content promptly.
