On May 3, the associate professor in the Department of Computer Science was presented with a 2019 New Researcher Award from the University of Saskatchewan (USask). It was the fifth major research award in less than a year for Roy—who studies, among other problems, how to recognize clones.
“Finding similarity is a fundamental problem for any science,” said Roy, a faculty member in the College of Arts and Science.
The clones Roy researches are pieces of computer code, not living things—although his work draws on some of the same technologies used in biology.
Countless scientific fields have benefitted from Big Data and machine learning techniques developed by computer scientists. Roy turns those techniques inward, using them to create tools that help fellow computer scientists write better and more reliable code.
His internationally acclaimed work has the potential to boost the Canadian economy and even save lives.
It starts with software clones: duplicated fragments of code in software systems.
Clones are usually created deliberately by software developers who copy and paste code, either to save time or to recycle old code they know to be reliable.
“We cannot forbid that, but we can assist them to overcome the issues and consequences,” said Roy, whose research is supported by a Natural Sciences and Engineering Research Council of Canada Accelerator Grant.
The most serious consequences of software cloning involve bugs. If a fragment of code contains a bug, duplicating it also duplicates the error. Because up to half of the code in some software systems is made up of clones, these cloned bugs spread widely.
Additionally, when developers update their software, they might change some instances of clones and not others, resulting in inconsistencies and the creation of even more bugs.
“Bugs are very, very bad,” said Roy. “Just in 2017—I’m talking about one year—only 606 software bugs cost around $1.7 trillion, with 3.7 billion people and 340 companies affected.”
The damages are not just economic. Software errors have contributed to automotive collisions and airline crashes that have resulted in hundreds of deaths.
Roy’s greatest research achievements have been in the area of clone management: developing better ways to detect, avoid and remove buggy software clones.
In 2007, when Roy was working on his PhD at Queen’s University, the topic of software clones was a nearly dead area of study. A technical report he co-authored that year with his PhD supervisor James Cordy has been credited with revitalizing the subject, which is now a major topic in computer science journals and at conferences around the world.
Since coming to USask in 2009, Roy and his students have continued to drive the field forward. Roy’s laboratory has pioneered new techniques and tools for detecting software clones, as well as methods for measuring the effectiveness of such tools. These methods have been widely adopted by researchers and industry members.
The ultimate goal, said Roy, is to create a fully automatic system that helps programmers practice “safe cloning.”
“Safe cloning means you let people clone if they need to, and if there are consequences of cloning, you help them overcome it,” he explained.
Such a system would detect when a programmer is editing a clone, predict the consequences of the change and recommend solutions. Providing that information to developers in real time would reduce software maintenance costs and prevent bugs from being created.
Roy’s work on detecting similarity has many other applications. One of these is code completion—a system that can read code as it is being written and offer the programmer suggestions of what to write next, speeding up development.
An early version of a code completion tool developed in Roy’s lab is already being used by a local industry partner.