The Different Types of Code Ownership
Code ownership is a model that developers use to define responsibility and management of parts of a larger code base.
There are three main different types of the code ownership model: strong, weak, and collective code ownership. It is important to understand the different types of code ownership in order to use the right model for your project/company.
Strong code ownership
Strong code ownership refers to splitting up a code base and assigning developers into those sections. Each developer has complete responsibility for their own part; meaning, they are responsible for maintaining the code and keeping its quality, and only they are responsible for the code they own. This means that if other developers want to make changes to code that they do not own, they must get approval from the code owner in order to do so. Code owners are also the first ones to get tagged whenever someone wants to make any changes, and the ones other developers contact when there is an issue.
Code owners really know their part of the code base, so it makes sense to go over them before making any changes. The strong code ownership model looks highly-organized, but this may prove to be counterproductive at times, especially when you have a larger team or if the code owner decides to abandon their code.
There are times where the code owner goes on vacation or leaves the company, which makes it difficult to maintain the code. If the code owner is not available for any reason, a new owner is assigned. This can take a lot of time since the new owner most likely needs time to adjust to the code they now own.
Also, using the strong code ownership model may also create bottlenecks, as developers have to go through the code owner every time they want to make changes, even small ones as well. This most likely will increase the code owner’s work and create a lot of unfinished work-in-progress as modification requests pile up.
While some developers are against this ownership model, it can be an effective way to organize code maintenance (for smaller to medium size teams, for example).
Weak code ownership
Weak code ownership has some similarities to strong code ownership. The weak code ownership model also splits up a code base and assigns developers specific parts of it. The main difference is that other developers are allowed to modify code they do not own directly, instead of going through the owner(s).
Although a weak code ownership allows more freedom than a strong model, this does not mean code owners are free of responsibilities. Code owners still are responsible for maintaining the code they own, and must still be aware of the changes other developers make. Although code owners do not have to make the changes themselves, they still are needed in order to review and approve those changes made by other developers.
The weak code ownership model is preferred over the strong code ownership model, as it increases contributions to source code and collaboration between team members while still maintaining the quality of the code. It also proves to be more efficient and reduces the amount of work for code owners; team members do not have to ask the owner to make the changes anymore, rather, they can do them directly.
This model may be helpful for those belonging to a larger team that may have many other shared responsibilities. However, since the code owner is not as tied to the code as in a strong code ownership model, it may result in a lack of responsibility for the quality of the code. It can also confuse team members, as it is not exactly clear who is responsible for making changes and updating the code. A weak code ownership can also lead to merge conflicts if there are many people working on the same code. This results in an expensive loss of time and resources; many developers wasted time on solving one specific issue that could have been solved by a single developer.
The weak code ownership model is a great way to avoid the issues that arise when using a strong code ownership model. Developers have more freedom to make changes without piling up work for the code owner. However, it also has its drawbacks, so it is important for the team or contributors to have a clear understanding of who is responsible for maintaining the code.
Collective code ownership
A collective code ownership model is very different from the previous two models. In a collective model, there is no individual ownership; rather, responsibility and management of the code base is shared among all team members. Team members are allowed to make changes to any part of the code regardless of who originally wrote it.
The collective model encourages all developers to work together and collaborate to manage and keep the quality of the code base. It also is more time efficient and decreases workload, as it allows all team members to contribute and review the code, as opposed to a single individual or a small group of individuals. In other words, it is easier and faster to make improvements and fix bugs.
However, as efficient as this sounds, the collective model has its own drawbacks. Since there is no individual ownership, some developers may not be familiar with some parts of the code base, causing knowledge gaps and possible misunderstandings. Also, there is no specific code owner available to manage and coordinate the work of multiple team members, causing difficulties with structure and organization. Furthermore, this model may turn out to be counterproductive, as there will be an increase of meetings to sync and better coordinate with other team members.
Overall, the collective code ownership model has great potential to improve efficiency of a team and the quality and maintainability of the code base, but it is important to be in the loop, and have clear communication and understanding of what is going on. There must be a set practice, as well as careful planning in order for this model to succeed.