Code 'transplant' could revolutionise programming

Shutterstock

Code has been automatically "transplanted" from one piece of software to another for the first time, with researchers claiming the breakthrough could radically change how computer programs are created.

The process, demonstrated by researchers at University College London, has been likened to organ transplantation in humans. Known as MuScalpel, it works by isolating the code of a useful feature in a 'donor' program and transplanting this "organ" to the right "vein" in software lacking the feature. Almost all of the transplant is automated, with minimal human involvement.

Automated transplants of features between apps could free human programmers from tedious, manual work and make developing software faster and cheaper. "As any programmer will attest, a large amount of programming work consists of this kind of manual transplantation work; redesigning, implementing and reinventing functionality that already exists in some form on some other system." Mark Harman, head of software systems engineering at UCL tells WIRED.co.uk. "By automating it, we make it much faster and cheaper."

To demonstrate the system, Harman's team successfully transplanted a video coding format from one media player to another. The H.264 codec, which used to be lacking in VLC media player, was transplanted from x264. It took the automated system 26 hours to complete the transplant, while VLC's manual addition of the code happened over a period of 20 days.

The system could be used to transplant anything from automatic save features to social media integration, video chat, spellcheckers and even video and audio processing.

At present it only works on the C programming language, but there is nothing to stop it being applied to others. Eventually it may even be possible to transplant features between languages and platforms with no human involvement whatsoever. The team has published a paper detailing how MuScalpel works, along with the software's source code, in the hope that more developers will get involved.

The breakthrough is unlikely to see people losing their jobs to software-creating computers, Harman explains. "We want to free programmers from their shackles, not to make them redundant," he says. Instead, it will free programmers up from boring tasks. "We believe that our research may ultimately change the understanding of the word 'programmer' considerably. A lot of human activity in programming is laborious and intellectually tiresome."

Ultimately, this system may move programmers away from "reinventing the wheel" and free them up to become software designers. Such a shift will allow them to think in terms of features, rather than code. "Transplantation technology could even potentially allow non-specialist users to investigate what their existing software would be like with new features," Harman says.

Similarities between the process and organ transplantation was something that surprised Harman and his team -- and also provided a useful way of understanding how the system worked. "We thought it was fascinating that a transplant could actually be rejected by the host, and could have side-effects. The language of human organ transplantation seemed to provide us with ways to understand what was happening," Harman explains.

Like an organ that has been translated, there's a chance that features could be rejected by the new host. But when a code transplant fails the system can simply try again, potentially hundreds or even thousands of times.

While the research is still in its early stages, the team have ambitious targets. As well as developing the system to be more autonomous and work across any programming language, Harman has also started speculating on the impact it could have on what programming means.

He compares the potential disruption to that last seen in the 1940s, when the word "computer" was used to describe a person who performed computation. "The computation was tiresome and repetitive, but it required some of the most skilled and intelligent humans, since it had to be correct," he explains. Today, that meaning of the word computer is anachronistic. "Today, human programmers perform low-level programming tasks. Perhaps our grandchildren will look back on our current use of the word 'programmer' in a similar way?"

This article was originally published by WIRED UK