Searching for Build Debt Managing Technical Debt at Google J.D. - - PowerPoint PPT Presentation

searching for build debt
SMART_READER_LITE
LIVE PREVIEW

Searching for Build Debt Managing Technical Debt at Google J.D. - - PowerPoint PPT Presentation

Searching for Build Debt Managing Technical Debt at Google J.D. Morgenthaler, M. Gridnev, R. Sauciuc and S. Bhansali Google Confidential and Proprietary Google's Build System Overview Single, Monolithic Source Repository Single,


slide-1
SLIDE 1

Google Confidential and Proprietary

Searching for Build Debt

Managing Technical Debt at Google J.D. Morgenthaler, M. Gridnev,

  • R. Sauciuc and S. Bhansali
slide-2
SLIDE 2

Google Confidential and Proprietary

Google's Build System Overview

  • Single, Monolithic Source Repository
  • Single, Global Build System
  • Single Continuous Integration System
slide-3
SLIDE 3

Google Confidential and Proprietary

Google's Build System Debt

  • Dependency Debt
  • Visibility Debt
  • Zombie Targets
  • Dead Flags
  • Other Discoveries
slide-4
SLIDE 4

Google Confidential and Proprietary

  • Declared dependencies have to be manually

kept in sync with source

  • Over-declared dependencies waste resources
  • Under-declared dependencies hinder progress

Dependency Debt

slide-5
SLIDE 5

Google Confidential and Proprietary

Example Under-Declared Dependency

calls Bar.getX() uses Bar defines Bar /project/BUILD: foo_binary(name = "main", deps = [":direct_dep"]) foo_library(name = "direct_dep", deps = ["//indirect/dependency:rule"])

slide-6
SLIDE 6

Google Confidential and Proprietary

Example Over-Declared Dependency

calls Bar.getX() stops using Bar defines Bar /project/BUILD: foo_binary(name = "main", deps = [":direct_dep"]) foo_library(name = "direct_dep", deps = ["//indirect/dependency:rule"])

slide-7
SLIDE 7

Google Confidential and Proprietary

Remove Over-Declared Dependency

calls Bar.getX() defines Bar /project/BUILD: foo_binary(name = "main", ## BROKEN deps = [":direct_dep"]) foo_library(name = "direct_dep", deps = [])

slide-8
SLIDE 8

Google Confidential and Proprietary

Treatment Philosophy

  • Automate
  • Make it easy to do the right thing
  • Make it hard to do the wrong thing
slide-9
SLIDE 9

Google Confidential and Proprietary

Treatment of Under-Declared Dependencies

  • Educate engineers
  • Automate addition of under-declared dependencies
  • Use build system to prevent reoccurrence
slide-10
SLIDE 10

Google Confidential and Proprietary

Results

  • Tools adopted by several large projects
  • Engineer pushback
  • Uncovered additional technical debt
slide-11
SLIDE 11

Google Confidential and Proprietary

Visibility Debt Cleanup Results

  • Changed default target visibility to private - 2011
  • Poor education increased change aversion
  • Engineer pushback overcome by management
  • Remaining debt slowly being paid down
slide-12
SLIDE 12

Google Confidential and Proprietary

Zombie Target Cleanup Results

  • Daily tracking of long-term broken targets (<1%)
  • Identification in code search UI
  • Semi-automated cleanup had little impact
slide-13
SLIDE 13

Google Confidential and Proprietary

Dependency Debt Removal Detail

  • Language-specific solution (Java)

○ Build system partitions classpath elements (jars)

into direct and indirect based on dependencies

○ Extend javac to determine the jar from which

each referenced class was loaded

○ Issue warning when indirect jars referenced ○ Enforce: strict_java_deps build rule attribute