What happens if your development team is hit by a bus?
Tags: management, team, programming
Published: 2022-06-02 15:47:12

### A little bit of history

While the title may sound quite extreme, a similar sentence was asked publicly by [Michael McLay in 1994](https://en.wikipedia.org/wiki/Bus_factor#History):

> If Guido was hit by a bus? ([Guido van Rossum](https://en.wikipedia.org/wiki/Guido_van_Rossum) is the creator of the Python language)

That question led to the creation of the **Bus Factor**, known also as *bus problem,* *truck factor*, *lorry factor*, or even *lottery factor*.

### What is a “Bus Factor”?
While there are several slightly different definitions on the Web, we may summarize them as:

> The Bus Factor is the total number of people who would need to be incapacitated, as by getting hit by a bus so that the project would be left for dead.

To make this more descriptive, the **Bus Factor score** is an estimation of people who are so vital to your project that without them it will stall. If those people disappeared from the project for any reason (like an "accident" or even taking holiday, got fired, or left the project), no one would be able to maintain the project. 

The lowest possible Bus Factor score is just 1, which means that if one person leaves the project it will stall or die. From a more technical point of view, this could be considered a [single point of failure](https://en.wikipedia.org/wiki/Single_point_of_failure) within the project. A much larger Bus Factor score is preferable, but not always easy to achieve.

[![https://xkcd.com/2347/](https://cdn.hashnode.com/res/hashnode/image/upload/v1648058583185/nQ5vla14K.png)
Author: https://xkcd.com/2347/](https://xkcd.com/2347/)

### PHP Community problem
At end of 2021, the PHP community received the sad information that after 10 years of implementing innumerable bug fixes, features & maintaining PHP, one of the main contributors: **Nikita Popov**, decided to focus on working in a completely different language and community (Rust & LLVM), of which he had already been apart for a few years.

Similar to the history of the Python language, that decision showed the PHP language has a really big problem with such a low Bus Factor score. It put the future of the language that powers up ~78% of the Web in a dangerous position.

To improve the current state, people and companies working on PHP joined forces and started a new initiative: [PHP Foundation](https://opencollective.com/phpfoundation).

> The **PHP Foundation** is a non-profit organization whose mission is to ensure the long life and prosperity of the PHP language.

The first decision made by the foundation was to hire/sponsor new developers to work on PHP core components. That way they could start increasing the Bus Factor score to a safer level. This is one of many steps that need to be taken by the community to make PHP's future safe and stable.

### Company problems
Plenty of companies I worked for, from startups to corporations, often were hit hard by the Bus Factor. Many of their teams (most of the time not intentionally) fell into [NIH (Not Invented Here)](https://blog.bielawski.tech/not-invented-here-history-repeating), which led to problems with maintenance, higher entry-level for newcomers, as more & more things were created by people who could leave the project at any moment. This has often led to high Technical Debt (which I will try to explain in a later post).

A **low Bus Factor score** is often part of the fast-growing time when only a few developers create most of the functionality that later becomes the base for an increasingly complex project. Most companies start big hiring plans during such growth, but that's not something that can increase the Bus Factor alone.

### How to increase a low Bus Factor score?

#### Coaching sessions & pair programming
Each new member should have at least 30 minutes of a pair programming session with one of the *senior* people within the project she/he is joining. During such sessions, a less experienced person should do most of the coding, while the senior mentors, leads by example and suggests parts that may help to achieve the goal of the task.

#### Your Bus Factor person as a teacher
When you identify *Bus Factor people*, you should focus on how they can share the knowledge they aggregated during all those years in your project. Their knowledge is one of the biggest values for your team. Have them focus more on writing documentation, creating cheatsheets, doing internal presentations, and sharing knowledge in one-on-one sessions with teammates. Their focus on programming should be *reduced*.

#### Code Review Culture
While adoption of the Code Review Culture is done by teams to improve the code quality and the review process, the less obvious outcome is direct knowledge sharing between people in the project. Reviews must not be just like giving a stamp of approval. They should point out why something was done that way, not another, leading to constructive discussions between seniors & other teammates about what could be done differently, from the perspective of seniors. Reviews <u>must</u> lead to discussion.

#### Reducing project(s) complexity
Often the problem of fast-growing companies is fast-growing Technical Debt, which leads to a low Bus Factor score. One of the effective techniques is reducing the complexity of projects by splitting them into smaller, more dedicated ones. This leads to lower entry-level, faster adoption, and easier maintenance. All these points allow increasing the overall Bus Factor quite effectively. The biggest issue you <u>must avoid</u> during reducing the complexity of projects is to <u>always</u> involve teams (even small ones) in refactoring to avoid creating the very same problem in the new *sub-project(s)*.

#### Team "shuffling"
This can be the most effective way of increasing the Bus Factor score, but it's also the most difficult and dangerous one. You need to deeply plan every possibility to prevent losing team morale. "Shuffling" should not be forced, but proposed to team members on a regular basis, like: once every two quarters; teammates cannot change teams too often as they will need to be onboarded like a newcomer. If well planned & executed, your teams will get much wider experience in different domains, sharing the knowledge learned while working with other teams.

#### Training budget
Planning training budgets for your developers can also increase the Bus Factor score as people will gather a wider range of experience, and expand your team to have more people in each seniority rank within your company hierarchy.

### Summary
It’s not that easy, cheap, or quick to increase your team Bus Factor score. There are cases when you don't want (or even can't) easily increase that score, for example when the project contains sensitive data and you can't trust your new hires to start handling it. But now you know some of the basics that can help you prevent having your operations grind to a halt due to a "bus accident".