For an electronic device to ‘know’ what to do, computer programmers need to give it a set of instructions, called code. Writing software programmes can be an immense task — the average Android phone uses 12 million lines of code, Facebook runs on 62 million, and a modern car on 100 million.
Because of the sheer size of code involved, starting from scratch every time you need to write a new programme would be a nightmare. Plus many software utilise similar functions, such as password authentication, copy and paste tools, or parsing a text file. So instead, some software developers employ a neat trick: code reuse, where they take existing code and use it to build new software.
“Programmers who reuse code are free to adapt it to their own software needs,” says Chuan Hoo Tan, an associate professor at NUS Computing who studies open source software (OSS) — code that is publicly accessible. “Think of a code as a recipe for a dish. When you reuse it, you adapt it to your own style of cooking.”
Code reuse is an important part of software development, says Tan. It saves developers precious time and resources when they “don’t have to reinvent the wheel,” improves coding quality, and helps advance technology. “People build on top of each other’s work...it’s like standing on the shoulders of giants,” he says.
Because of the many benefits code reuse can bring, it is a subject that has been widely studied by academic scholars. But the literature is often skewed towards leaders and examining the impact they have on code reuse. Followers — those who don’t write the original code but help adapt it, share knowledge, search for bugs, give feedback, and so on — are traditionally overlooked in such studies.
Tan recognised this gap in knowledge and set out to correct it by conducting a series of empirical investigations with his team, starting in 2012.
“For the longest time, we’ve been talking about leaders — what kinds of leaders we expect, how an organisation works well because of leaders, and so on,” he says. “But they’re only one person. A team consists of many more people who actually make things happen.”
“We need to do justice to the followers too,” Tan says.
Not just passive subordinates
To understand how followers influence the extent of code reuse, Tan and his team — comprising then PhD student Qiqi Jiang, as well as researchers Choon Ling Sia and Kwok Kee Wei from the City University of Hong Kong and Singapore Institute of Management, respectively — used a dataset of 650 OSS projects from GitHub, a popular code-hosting platform owned by Microsoft. They collected data at two time points (in 2012 and 2014), examining the frequency of code reuse (a statistic GitHub measures) with respect to the types of followers a project leader had.
Based on their observations, which are published in a 2019 MIS Quarterly paper, the team concluded that followers play an important role in supporting code reuse. “These are not just passive people with low energy, but high-energy individuals who field the diffusion of technology itself,” says Tan.
Followers actively cooperate with leaders and help promote their innovations, but their impact on code reuse depends on the type of follower they are, discovered Tan and his team. Projects that have a high variety of developers — those who didn’t develop the original code but helped adapt it for new software — enjoy high levels of code reuse. The more developers collaborate with project leaders they have never worked with before, the more likely it is that code gets reused.
“The benefit of such collaboration is that there’s cross-fertilization that allows for new ideas or knowledge to be accumulated,” says Tan. “Open collaboration allows for knowledge spillover across OSS projects.”
Similarly, projects that have a large number of observers following a leader also see higher code reuse. Observers refer to followers who contribute not through coding but by learning and sharing “general updates, trendy information, coding or programming knowledge.”
“They help manifest code reuse by applying what they have learnt from other OSS projects,” explains Tan. For instance, they may suggest code solutions from other projects they follow and apply them to a project that is facing similar challenges.
In addition, observers also spread news and information easily through social media and other means, thus helping project leaders “export their innovation to other people.”
Thinking about teams
To verify their findings, Tan and the team also conducted additional investigations, including a survey with some of the GitHub participants as well as three focus group discussions. These qualitative investigations corroborated their initial results. As one focus group participant surmised, “Innovation and inspiration come from diversity.”
The research findings are useful because they provide insight as to how an organisation can configure their software development teams, says Tan. “If you really want to expedite code reuse in other projects, here are some suggestions as to who are the type of people you should recruit or should involve to create a better code for the community to advance technology development.”
“We need good leaders, but we also need good followers to make things happen,” he says. “This is important for teams.”
Today, Tan continues to conduct research in the field of open source software. This time, instead of looking at followers, he is studying the composition of teams and the ecosystems in which they work. He says, “It’s a bigger, grander scale of large open source development.”