Inside the World of Developer Productivity: Best Practices from Google
In the field of software development, measuring developer productivity is a complex and often debated topic yet a key priority for many companies. It's an important focus for many tech companies, as improving dev productivity can help them deliver high-quality software products faster, making the most of their developers' time.
So, is it possible to measure a developer's effectiveness? Is the number of lines of code(LOC) still a good indicator? But what about the quality of those lines? How long does it take to review that code? Understanding how hard a developer is working can be tricky, So how do you measure productivity when it comes to software development?
As mentioned earlier, measuring developer productivity can be hard. However, companies like Google, Amazon, Facebook, Uber, Apple and Microsoft, who are leaders in their respective industries, have come up with effective strategies for doing so. In this blog post, we will explore what developer productivity is and delve into the methods used by Google to measure developer productivity. Furthermore, there are some key takeaways for developers on how they can maximize their own productivity.
What is Developer Productivity, and Why Does It Matter? #
Developer Productivity is often referred to as the efficiency with which a developer can build software. It's the ability to take software development tasks such as writing, testing, and deploying code from start to finish in an efficient and timely manner, with minimal errors or rework. It's about maximizing output for the time invested so that developers can work smarter, not harder.
Measuring developer productivity can be challenging, as it encompasses a wide range of factors, such as:
1. Quality of code: How well-written, maintainable, and readable is the code?
2. Speed of development: How fast can developers write, test, and deploy code?
3. Collaboration: How well do developers work together and share knowledge across team members?
4. Job satisfaction: Are developers motivated and satisfied with their work environment?
It's important for companies to be able to track this kind of performance as it impacts their overall success and competitiveness. Google, Amazon and other leading firms have utilized various data-driven strategies like tracking code commits, analyzing user feedback or monitoring task completion rates - all designed with one goal in mind: optimizing developers' workflow.
Several factors can impact developer productivity, including the availability of tools and resources, the quality of the codebase, and the level of collaboration among team members.
It can be measured by a range of metrics such as: the number of features or tickets completed per unit of time, code quality, velocity, time to market, code review feedback,the error rate or bug count and bugs discovered after release. Traditional methods of measuring developer productivity involved tracking the amount of code committed by developers, however, this method has proven inadequate over time.
Why is Measuring Developer Productivity Important? #
Advancements in technology with new frameworks, tools, and programming languages being introduced regularly, has led to complexities in software development. With increasingly complex systems and pressing deadlines, it's important to measure and enhance developer productivity. Measuring this productivity can help organizations determine how much effort is required for future projects and if they need more resources. Software engineers often work on multiple projects at the same time. With multiple tasks on their plates, it's important to track how long each task takes so that other projects can be accurately estimated. By fostering an environment conducive to developer productivity, organizations will be poised for success in today's competitive landscape.
New Definition for Developer Productivity #
A new definition for developer productivity revolves around making software delivery teams more efficient and effective by combining the right people with the right tools and processes. It emphasizes measuring the outcome of developer efforts (e.g. value delivered to end-users) as opposed to measuring outputs (e.g. lines of code). This approach shifts the responsibility of ensuring the best return on investment for developer productivity from the developers themselves to their team leads and managers.
Engineering Leader or a Corporate Tech Leader?
How Google Measures Developer Productivity #
Google is known for its highly productive and innovative engineering culture. Google has a data-driven engineering discipline focused on optimizing the engineering process so that Google can deliver amazing experiences to their users, faster. Here are the core principles that drive their Engineering Productivity:
- System Analysis
- Tools and Infrastructure
- Focus on the User
Google uses the Goals/Signals/Metrics (GSM) framework to guide metrics creation.
- A goal is a desired end result. It’s phrased in terms of what you want to understand at a high level and should not contain references to specific ways to measure it.
- A signal is how you might know that you’ve achieved the end result. Signals are things we would like to measure, but they might not be measurable themselves.
- A metric is a proxy for a signal. It is the thing we actually can measure. It might not be the ideal measurement, but it is something that we believe is close enough.
Google measures developer productivity using various metrics and tools.
Code review feedback: Google's code review process is highly structured and includes a detailed feedback loop. Each code change is reviewed by at least one other engineer, with code ownership and readability certification. This helps identify potential issues early on in the development process and ensures that code changes are thoroughly reviewed before they are merged into the main codebase.
- Code Reviewers at Google look for Design, Functionality, Complexity, Tests, Naming, Comments, Style and Documentation.
- Google uses a tool called Critique to automate repetitive tasks
- Code review feedback at Google is expected to be constructive and respectful
- Google encourages open communication and collaboration during code reviews
- Google's code review process helps to improve code quality and maintain consistency across projects.
One of the primary metrics used is the code review turnaround time, which is the time it takes for a developer's code to be reviewed and approved by other engineers. The faster the turnaround time, the more productive the developer is considered to be. The code review process takes 4 hours on average, which indeed is pretty fast.
This extensive code review process ensures their code is easy to read, understand, maintain, and scale. Better Code Quality might increase productivity as it makes it easier and faster for developers to add new features; on the other hand, high productivity might increase quality code because engineers have free time to spend on quality improvement.
Test coverage: Google has a strong focus on automated testing, and they use metrics such as code coverage and test suite execution time to measure the effectiveness of their testing efforts. Developers are expected to write automated tests for their code changes, and test coverage is closely monitored to ensure that code changes do not negatively impact the quality of the codebase.
- Google does not mandate a universal ideal coverage number, but recommends 60% as acceptable, 75% as commendable, and 90% as exemplary.
- Developer changes are automatically tested when they’re sent for code review
- Google’s test infrastructure makes it trivial to split up tests in a test suite to be executed across multiple servers. This increases the cost of CPU time, but it can provide a large savings in developer time.
Time to production: Google tracks how much time it takes for a code change to be deployed into production (in other words, release velocity). This helps identify bottlenecks in the development process and encourages developers to optimize their workflow to reduce time-to-production.
Fix rate: The percentage of bugs developers fix reported/flagged by a tool. Google engineering teams have set a high bar for themselves when it comes to fixing bugs. With the implementation of their ErrorProne code analysis tool, they strive for a fix rate of above 90%. By deploying only tools with reliable fix rates, this not only builds trust between developers and Google but also ensures that important issues are being taken care of.
Internal tooling: Google uses several internal tooling to improve developer productivity.
- Blaze is Google’s build tool of choice. It automates software builds and tests. As slow and unreliable builds began to interfere with developers’ productivity, Google built Blaze to solve it. It automatically applies dependency management, caching, and parallelization to accelerate build times. This helps developers to focus on coding, testing and shipping the product.
- Engineers at Google seem to be very happy with Blaze, and one of their engineers said:
“Any engineer at Google can build any Google product from source on any machine just by invoking a Blaze command.”
- In 2015, Google finally open sourced an implementation of Blaze named Bazel
- ML-Enhanced Code Completion Improves Developer Productivity: Google used semantic ML code completion and saw a 6% reduction in coding iteration time (time between builds and tests) when exposed to single-line ML completion. Currently, 3% of new code is now generated from accepting ML completion suggestions.
Overall, Google uses a combination of quantitative and qualitative measures to evaluate developer productivity and ensure high-quality code.
Key takeaways for developers from Google’s productivity measurement techniques:
- Automated testing helps increase code coverage and reduce introduction of bugs.
- Addressing code review feedback can lead to higher-quality code.
- Invest in infrastructure and tools to speed up development processes.
- Optimize your workflow to reduce time-to-production and minimize delays.
By investing in tools that help developers automate routine tasks, providing opportunities for upskilling, and fostering a culture of transparency and communication, companies can increase developer productivity significantly.
Developer Advocate, DevZero