What is mob programming?
Mob programming is a collaborative approach to software development in which a group of developers work together in real time on one task. Mob programming has its roots in pair programming, an Extreme Programming (XP) technique in which two developers work as a team on the same task, using just one computer.
- Mob. The mob refers to the group of developers working together. They are responsible for discussing multiple alternative implementations and selecting the best course of action.
- Navigator. This developer is responsible for listening to the mob's discussion and communicating instructions to the driver.
- Driver. This developer is responsible for converting the navigator's instructions into code.
Often, a mob programming session also includes a champion within the group. This developer is responsible for keeping the mob's discussion on task and telling the group when roles should switch, which should be roughly every 15 minutes.
Mob programming can be used for a single, discrete step in the development process, multiple steps or an entire development project.
This collaborative approach to defining user requirements, designing, testing and deploying software strengthens skills by giving newer employees an opportunity to benefit from the knowledge more experienced team members possess. This approach also provides more experienced employees with an opportunity to gain fresh perspectives from newer employees. Ideally, each participant gets to play every role during each mob programming session.
How does mob programming work?
The defining quality of mob programming is that all the developers are grouped together at one workstation and the entire team works on the same task at the same time. There is no specific number of developers needed to be considered a mob, but four to six developers is considered the norm. Projectors and dual monitors can be used to ensure everyone on the development team can see exactly what code they are working on at a given time.
The mob strategy uses a driver-navigator workflow. The driver is the designated developer who controls the keyboard. The navigator's job is to give the driver instructions and help the mob review code as they write it. At all times, there should only be one person behind the keyboard. The development process begins with the champion or facilitator stating what task needs to be done. The mob discusses what approach they should use, and the navigator is responsible for achieving consensus and providing the driver with instructions.
If mob programming is being implemented for smaller individual tasks, then a smaller mob may suffice. If the implementation carries through the entire development process or calls for high-level design and development decisions, a larger mob makes more sense.
In mob programming, the same computer is used to design and test code. Teams can use additional computers for research and looking at databases.
Benefits of mob programming
Potential benefits to mob programming include the following:
- Enables continuous learning. Everyone has total access to the shared knowledge of team members. Teams can quickly solve problems that come up, and team members continuously learn more about the development process.
- Ensures coding standards are met. By having the navigator and mob review the code as the driver writes it, the team can make sure coding standards are met. Having another separate code review is not required. Best practices can also be reviewed in real time.
- Overcomes individual weaknesses. As development continues, the strengths and weaknesses of individual team members become more obvious. With shared access to knowledge, those team members can learn how to address those weaknesses.
- Provides fast feedback. Constant feedback can be given and discussed by mob members.
- Enables continuous work. If one team member is out of office, work can continue as planned.
- Cultivates both hard and soft skills. Not only do team members enhance their technical skills, but they also develop soft skills, like communication and time management abilities.
Disadvantages to mob programming
Mob programming may not be a good fit for every organization. Depending on the environment, some developers may think that mandatory group work and discussions are more tedious than beneficial and find the collaborative process to be unnecessarily slow. If the team isn't fully on board, mob programming sessions can be difficult to manage, and there can be a decrease in code productivity.
Another aspect of mob programming that can prove difficult is remote mob programming. Although possible, programming remotely can be a challenge when developers are in different time zones or technical difficulties ensue over meeting software.
Mob programming best practices
Because mob programming can be difficult to implement for all members of a team, it is important to follow a list of best practices. Some of these best practices are the following:
- Treat fellow team members with kindness and respect.
- Follow the driver-navigator approach.
- Focus on creating quality code. Have the navigator and mob members review the code as it is written.
- Take small breaks at a designated time, and ensure roles change.
- Navigators should express the mob's decision to the driver clearly. This can be at a high level if the driver understands what is being instructed or more granular if not.
- Hold retrospectives for whenever they would be most helpful to the team. They can be kept short and can focus on singular items if needed.
- Hold calls and send emails as a team. This keeps everyone on the same page and aware of related interactions between the development team and other areas of the organization.
Mob programming vs. pair programming
Pair programming is an Agile development technique originating from XP. Pair programming has two developers work together on one computer to design, code and test user requirements. Typically, the two developers take equal turns coding or reviewing, checking each other's work as they go. Ideally, their skill level should be roughly equal.
Mob programming acts as an extension to pair programming. Instead of having two people in a group, a mob programming team is made up of multiple developers. Mob programming can be more effective than pair programming in situations where there is a need to make high-level design and development decisions. With more people working together, it's more likely that a mob produces different and diverse ideas for solving a problem.