RDEL #101: What can we learn from Meta's code improvement practices?
Teams had over 20 attributes for code improvement prioritization criteria, with diverse origins for code improvement efforts. Reengineering efforts led to statistically significant improvements.
Welcome back to Research-Driven Engineering Leadership. Each week, we pose an interesting topic in engineering leadership, and apply the latest research in the field to drive to an answer.
Codebases don’t stay healthy on their own—they rely on developers who take the time to refactor, clarify, and improve as they build. But what drives those decisions? And how can teams encourage consistent, high-leverage improvements in the flow of everyday work? This week we examine these questions from a very specific lens and ask: What can we learn from Meta’s code improvement practices?
The context
As software systems grow, so do the challenges of keeping them maintainable. Over time, layers of complexity, obsolete code, and poorly structured components accumulate. These issues don't just slow teams down—they also make systems harder to test, more prone to outages, and more difficult to onboard new developers into. Despite these challenges, some companies manage to move fast and maintain quality. Understanding how they do this can help engineering leaders replicate their success.
Code improvement efforts can range from sweeping architectural redesigns to small, consistent refactoring. But while the need is clear, prioritizing and executing these improvements at scale remains difficult. Many teams focus only on firefighting, while the most impactful code changes may go unnoticed or deprioritized.
The research
Researchers collaborated directly with engineers at Meta to investigate the company’s approach to code improvement. Using a combination of action research and large-scale analysis of code changes, the study examined how engineers identify, prioritize, and execute improvements across a large, rapidly evolving codebase.
Key findings include:
Scope of Improvement Work: Meta engineers use internal tags to label code changes related to improvement work. By analyzing these tags across all submitted diffs, researchers found that over 14% of changes were explicitly dedicated to code improvement.
Diverse Origins: Code improvement efforts range from top-down initiatives (e.g., removing dead code or platformizing subsystems) to bottom-up, organic work initiated by individual engineers.
Prioritization Criteria: The researchers conducted interviews with Meta engineers and reviewed internal documents to identify over 20 criteria used to prioritize code improvements. These included frequency of change, outage association, complexity, and centrality within the call graph.
Impact of Reengineering: Reengineering efforts led to statistically significant improvements:
Reduction in code complexity: Up to 26% for certain types of restructuring.
Decrease in outages: For example, SEV-triggering diffs dropped from 76% to 24% after dead code removal.
Efficiency gains: Diff authoring time and number of coding sessions decreased substantially.
Increase in centrality: Suggesting improved cohesion and maintainability for critical code paths.
The application
Meta’s approach shows that sustained code improvement isn’t just a one-time refactor—it’s a continuous, multi-layered practice supported by both individuals and systems. Their success comes from making improvement work visible, prioritizing it with data, and creating cultural and organizational support for engineers to act.
Engineering leaders can apply these lessons by:
Make improvement efforts measurable. Tag or track code improvements explicitly so they’re visible in team metrics and conversations—not buried in feature work.
Use data to guide decisions. Prioritize code improvement work based on impact signals like outage history, complexity, and frequency of change—not just intuition.
Support improvement culture. Encourage bottom-up improvements by giving engineers the time, autonomy, and recognition to tackle quality issues as part of regular development.
—
Enjoy this week’s RDEL, and happy Research Tuesday!
Lizzie