Mob programming is a collaborative approach to software development in which a small 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.
- Small group of developers responsible for discussing multiple alternative implementations and selecting the best course of action.
- Individual developer responsible for listening to the mob's discussion and communicating instructions to the driver.
- Individual developer responsible for converting the navigator's instructions into code.
- Individual developer responsible for keeping the mob's discussion on task and telling the group when roles should switch.
Mob programming can be used for a single, discrete step in the development process, a group of 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 will get 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 computer or 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 to be the norm. Projectors and dual monitors can be used to ensure everyone on the development team can see exactly what code is being worked on at a given time.
The mob strategy uses a driver-navigator workflow. The driver is the designated developer who controls the keyboard. The navigators' job is to give the driver instructions and help the mob review code as it is being written. At all times, there should only be one person behind the keyboard. The development process begins with the facilitator stating what task needs to be done. The mob discusses what approach should be used, and the navigator is responsible for achieving consensus and providing the driver with instructions.
Almost all work in the software development technique is handled as work meetings or workshops. If mob programming is being implemented for smaller individual tasks, then a smaller mob is all that may be needed. If the implementation carries through the entire development process or calls for high-level design and development decisions, a larger mob will make more sense.
In mob programming, the same computer is used to design and test code. Additional computers can be used for research and looking at databases.
Benefits of mob programming
Potential benefits found in mob programming include the following:
- Enables continuous learning. Everyone has total access to the shared knowledge of team members. Problems that come up can be solved quicker, and individual team members can learn more about the development process.
- Ensures coding standards are met. By having navigators review the code as it is being written, the team can make sure any decided-on 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 will 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 sick, work can still continue as planned.
- Breeds better hard and soft skills.
Disadvantages to mob programming
Mob programming may not a good cultural fit for every organization's developers. 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. Other downsides include the following:
- With everyone in close proximity to each other, there is an increased chance of catching someone else's cold or sickness.
- Remote mob programming, although possible, can be a challenge when developers are in different time zones.
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 include 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 be focused on singular items if needed.
- Hold calls and send emails as a team. This helps keep 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 work on one computer. The two people work together to design, code and test user requirements. Typically, the two developers will take turns coding or reviewing, checking each other's work as they go. Ideally, their skill level should be about equal to each other. Each developer should also have equal time at the keyboard.
Mob programming acts as an extension to pair programming. Instead of having just two people in a group, however, 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 will produce different and more diverse ideas for solving a problem.