We've moved! Visit
The Keyword
for all the latest stories about
life at Google
and our
student programs
.
Student Blog
Brought to you from your @GoogleStudents friends. From pre-university to PhD (and beyond), we got you.
The Google Test and Development Environment - Pt. 3: Code, Build, and Test
January 21, 2014
Cross-posted from the
Google Testing Blog
.
This is the third in a series of articles about our work environment. See the
first
and
second
.
I will never forget the awe I felt when running my first load test on my first project at Google. At previous companies I’ve worked, running a substantial load test took quite a bit of resource planning and preparation. At Google, I wrote less than 100 lines of code and was simulating tens of thousands of users after just minutes of prep work. The ease with which I was able to accomplish this is due to the impressive coding, building, and testing tools available at Google. In this article, I will discuss these tools and how they affect our test and development process.
Coding and building
The tools and process for coding and building make it very easy to change production and test code. Even though we are a large company, we have managed to remain nimble. In a matter of minutes or hours, you can edit, test, review, and submit code to head. We have achieved this without sacrificing code quality by heavily investing in tools, testing, and infrastructure, and by prioritizing code reviews.
Most production and test code is in a single, company-wide source control repository (open source projects like Chromium and Android have their own). There is a great deal of code sharing in the codebase, and this provides an incredible suite of code to build on. Most code is also in a single branch, so the majority of development is done at head. All code is also navigable, searchable, and editable from the browser. You’ll find code in numerous languages, but Java, C++, Python, Go, and JavaScript are the most common.
Have a strong preference for editor? Engineers are free to choose from many IDEs and editors. The most common are Eclipse, Emacs, Vim, and IntelliJ, but many others are used as well. Engineers that are passionate about their prefered editors have built up and shared some truly impressive editor plugins/tooling over the years.
Code reviews for all submissions are enforced via source control tooling. This also applies to test code, as our test code is held to the same standards as production code. The reviews are done via web-based code review tools that even include automatically generated test results. The process is very streamlined and efficient. Engineers can change and submit code in any part of the repository, but it must get reviewed by owners of the code being changed. This is great, because you can easily change code that your team depends on, rather than merely request a change to code you do not own.
The
Google build system
is used for building most code, and it is designed to work across many languages and platforms. It is remarkably simple to define and build targets. You won’t be needing that old Makefile book.
Running jobs and tests
We have some pretty amazing machine and job management tools at Google. There is a generally available pool of machines in many data centers around the globe. The job management service makes it very easy to start jobs on arbitrary machines in any of these data centers. Failing machines are automatically removed from the pool, so tests rarely fail due to machine issues. With a little effort, you can also set up monitoring and pager alerting for your important jobs.
From any machine you can spin up a massive number of tests and run them in parallel across many machines in the pool, via a single command. Each of these tests are run in a standard, isolated environment, so we rarely run into the “it works on my machine!” issue.
Before code is submitted,
presubmit
tests can be run that will find all tests that depend transitively on the change and run them. You can also define presubmit rules that run checks on a code change and verify that tests were run before allowing submission.
Once you’ve submitted test code, the build and test system automatically registers the test, and starts building/testing continuously. If the test starts failing, your team will get notification emails. You can also visit a test dashboard for your team and get details about test runs and test data. Monitoring the build/test status is made even easier with our build orbs designed and built by Googlers. These small devices will glow red if the build starts failing. Many teams have had fun customizing these orbs to various shapes, including a statue of liberty with a glowing torch.
Statue of LORBerty
Running larger integration and end-to-end tests takes a little more work, but we have some excellent tools to help with these tests as well: Integration test runners, hermetic environment creation, virtual machine service, web test frameworks, etc.
The impact
So how do these tools actually affect our productivity? For starters, the code is easy to find, edit, review, and submit. Engineers are free to choose tools that make them most productive. Before and after submission, running small tests is trivial, and running large tests is relatively easy. Since tests are easy to create and run, it’s fairly simple to maintain a green build, which most teams do most of the time. This allows us to spend more time on real problems and less on the things that shouldn’t even be problems. It allows us to focus on creating rigorous tests. It dramatically accelerates the development process that can prototype Gmail in a day and code/test/release service features on a daily schedule. And, of course, it lets us focus on the fun stuff.
Thoughts?
We are interested to hear your thoughts on this topic. Google has the resources to build tools like this, but would small or medium size companies benefit from a similar investment in its infrastructure? Did Google create the infrastructure or did the infrastructure create Google?
Posted by Anthony Vallone
Labels
A Day in the Life of a New Grad in Google Dublin
7
AdCamp
2
AdMob
11
Ambassador Program
14
APAC
7
Appy Trails
28
Back to School
4
Better Know a New Grad
1
Better Know an Intern
15
Better Know an Office
4
Black History Month
10
Caitlin Talks to an Engineer
9
Chrome Extensions
3
Chromebook
1
College Tips by Google
1
Community
14
Conferences
16
consortium
1
CSSI
5
Day in the Life
2
deSTEMber
1
Development Programs
1
Diary of a Business Associate Intern
1
Diary of a Summer Intern
41
Diary of a Summer Intern - Erika
9
Diary of a Summer Intern - Franklin
3
Diary of a Summer Intern - Jess
3
Diary of a Summer intern - Luke
3
Diary of a Summer Intern - Madelaine
4
Diary of a Summer Intern - Pablo
3
Diary of a Summer Intern - Rio
4
Diary of a Summer Intern 2012
18
Diary of an MBA Intern
2
Education
19
EMEA
47
Europe
8
Events
13
Exploring Design at Google
4
GHC15
6
Going Green
6
Gone Google
2
Google Code University
1
Google Code-in
1
Google Games
3
Google Japan
1
Google Lime Scholarship
1
Google on campus
2
Google Online Marketing Challenge
10
Google Science Fair
2
Google.org
1
Google+
6
Googlers
14
Googlers Beta
11
Grace Hopper
11
GradTips
9
Hangouts On Air
21
Inside ITRP
6
Intern Insights
31
Intern Program
72
Interns Making an Impact
7
Interviews
1
Jobs
5
just for fun
30
K-12 (Pre-university)
14
LATAM
3
Life at Google
17
Middle East
1
My Path to Google
45
My Summer at Google
15
My Summer at Google 2012
10
North America
4
Office Environment
4
Open Source
9
PhD
7
Products
94
Programs and Competitions
116
Recruiter Tips and Tricks
15
Rice Plus
4
Scholarships
56
Search
1
STEM
2
STEP
1
Student Tips
15
Students
13
Summer of Code
1
Teach Parents Tech
10
Tech Students
3
Tips and Tricks
27
Women in Engineering
21
Young Innovators
10
YouTube
3
Archive
2020
Jul
May
Mar
Feb
Jan
2019
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2018
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2017
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2016
Nov
Oct
Sep
Aug
Jul
Jun
Apr
Mar
Feb
Jan
2015
Dec
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2014
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2013
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2012
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2011
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2010
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2009
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2008
Dec
Nov
Oct
Sep
Feed
Follow @GoogleStudents
Interested in opportunities and programs for students? Visit
google.com/students
.