Code ownership might not be a pressing concern when a small team of around 10 developers works on the same system. However, as the engineering team scales to 500, with hundreds of developers contributing to the same system, the dynamics change significantly. This was a challenge my organization faced from two years ago till now — a lesson learned through firsthand experience.
How Does Code Ownership Affect Software Engineering Teams So Negatively? As an engineering leader, how do I handle this challenge?
Builders and owners are often different people. Builders are responsible for implementing features, but code ownership typically falls to someone else.
In an ideal world, builders and owners should be the same group of people. A dedicated team owns a specific domain. But, in a shared code-based environment, everyone is a builder across many domains. The code base is co-owned by many teams.
Builders may not know the history of the code, we expect everything to magically work, but often, it doesn’t.
We find ourselves in this mode when there is no clear ownership of the codebase: touch the code, ship the feature into production, and then leave the “code” to the next builder — along with technical debt.
The system becomes error-prone and unstable, leading to low confidence in shipping new features. Most production issues arise because builders lack a complete understanding of the domain. Small code changes can unknowingly break other parts of the system.
Different builders repeatedly reinvent the wheel, wasting time and resources.
The software development lifecycle (SDLC) becomes tedious and slow. Even minor changes require running full end-to-end tests, which can take over 20 hours — further compounding the issues above.
No Ownership of Code = No Ownership of Bugs
When the on-call team tries to reach out to the domain owner for a production issue, after talking to three different teams, it ends up that no one understands the code.
Another common scenario is that a recent builder (who has touched the code recently) gets on the support call, but the builder realizes two more teams have touched the same code recently. Who should fix the bug, then?
There is no boundary between the business layer and the infrastructure layer. It is risky to touch one line of code in any file if the builder does not know the already baked-in business rules added by other builders.
Under the pressure of deadlines, we tend to quickly finish projects without “wasting” time on communications. As a builder, spending time in meetings with domain owners is not something favorable.
Gradually, the code design is not aligned across different builders. We start seeing very strange implementations, and everyone knows the system’s stability is a problem, but who should own the tech debts?
Owning code means having more responsibilities. Teams tend to push away ownership. A typical statement is like: “My team does not have the full picture (of this feature), please reach out to someone else if you have any questions.”
First of all, if I had a magic wand, I would assign owners’ names to each line of code. If an owner leaves, their successor’s name should be assigned automatically.
Embrace the design of microservices, where ownership is tied to each microservice.
For those managing monolithic applications, define domain modules within the monolith and identify an owner for each module.
When We Have to Work on a Shared Code Base … Microservices can help address code ownership issues, but they are not always the best solution for every organization.
Engineering teams often align with different business stakeholders, which ties directly to funding and resources. It is not uncommon for multiple teams to maintain the same code domain to support different business workflows.
For example, SSO (Single Sign-On) is a shared service that supports multiple product lines. There are two approaches to managing code ownership:
Builders must take responsibility for creating sustainable, high-quality code. Team leaders play a crucial role in fostering collaboration and maintaining a high standard for code quality.
In the Co-Ownership World, One Team Owns the Foundation, Others Embrace Collaboration In a co-ownership model, one team focuses on building the foundational elements — base classes, templates, and interfaces — while other teams align with the design and collaborate to build their features.
Using the SSO service as an example: one team sets up the identity service, creating the foundation for enabling SSO across two internal services and one external service. Other teams then follow the established design pattern to roll out SSO for additional domain services.
Hold review meetings between builders and owners. Reviews should happen at multiple stages of the development cycle, from the project kickoff time-point to the post-release period.
Especially for Projects with Tight Deadlines As a builder, proactively reach out to the owners and seek their insights.
As an owner/co-owner, provide support to the builder, do not limit your role to that of a gatekeeper. Otherwise, builders will stop communicating with you.
Be proud to own and maintain high-quality, sustainable code.