Automated Dead Code Deletion at Scale: Google’s Sesenmann Project
The article explains how Google tackles the costly problem of dead code in its massive monorepo by using the Sesenmann automated deletion system, which leverages build‑system dependency graphs, activity signals, and graph‑analysis algorithms to safely identify and remove unused C++ code while addressing cultural resistance among engineers.
Large software projects inevitably accumulate dead code—modules that are no longer used or have not run for years—incurring ongoing maintenance costs and risking larger future expenses if left unchecked.
Google’s unique single‑repository approach, stored in the Piper system and supporting billions of lines of code, makes manual cleanup impractical; therefore the company introduced the Sesenmann project, an automated code‑deletion system that identifies dead code and submits change lists for removal.
Sesenmann relies on Google’s internal build system Blaze (the predecessor of Bazel) to construct a comprehensive dependency graph of binaries, libraries, tests, and source files, allowing it to pinpoint libraries that are not linked to any binary and flag them as potential deletion candidates.
Activity signals are gathered from logs that record when internal binaries are executed; binaries that have not run for a long period trigger deletion proposals, while exceptions (e.g., example code or missing logs) are handled via a block‑list to avoid accidental removal.
To handle complex dependency cycles, the system treats libraries and their tests as strongly connected components and applies Tarjan’s SCC algorithm, ensuring that only truly dead nodes are removed without breaking test coverage.
Beyond the technical solution, Google addresses cultural resistance by crafting concise change descriptions, providing clear supporting documentation, and actively processing user feedback, recognizing that engineering adoption is as critical as the automation itself.
According to the Google blog, the automated deletion effort has already yielded a ten‑fold return on investment, reducing C++ code‑base maintenance burden by about 5% and demonstrating the significant impact of combining technical tooling with thoughtful communication.
Continuous Delivery 2.0
Tech and case studies on organizational management, team management, and engineering efficiency
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.