Facebook's AI Tool for Squashing Bugs Is Now Open to All

Facebook used to move fast and break things. Now it's trying to move fast and fix things.
531847175fb
Circle machineryGetty Images

Facebook used to move fast and break things. Now it's trying to move fast and fix things. To do that, the company developed an artificially intelligent tool called Infer that can spot bugs in its mobile apps before they ever reach customers. And now the company wants everyone to test their software this way.

Today the company open sourced Infer, making its code freely available to any company or independent developer looking for new ways to debug their apps.

"It looks at the program and makes guesses or hypotheses about the program, the way a human might," says Peter O'Hearn, Infer's co-creator.

But unlike a human, it can read thousands of lines of code in mere minutes to spot potential bugs. Facebook claims that it has a fix rate of about 80 percent, which is great for such an automated system.

Most debuggers work by running a program and stepping through the code line by line and looking for errors. Infer is able to analyze code and look for problems without actually executing it, a concept called "static program analysis."

Static analysis has been around for decades, and there are both commercial and open source testing tools available based on the concept. But O'Hearn says these tools aren't able to do deep code analysis at the scale that Infer can. Unlike other tools, Infer is able to break down large code bases, analyze the smaller parts, and then stitch the results together, avoiding the trade off between depth and speed.

"I think of it as AI," O'Hearn says, though he says it's closer to the symbolic artificial intelligence branch of the field than the more brain-inspired neural networking techniques other researchers at Facebook are pioneering.

Free for All

Infer grew out of academic research O'Hearn started with the late computer scientist John Reynolds, with whom he helped develop a computer science concept called separation logic. The next breakthrough came later, when O'Hearn realized he could apply a concept called abductive reasoning to static analysis.

At the Queen Mary University of London, O'Hearn worked with Cristiano Calcagno, who was one of his PhD students, and Dino Distefano, who was his research assistant. Calcagno and Distefano went on to other institutes and continued their research. But they eventually found themselves wanting to make an impact on the world of software development outside of academia. They decided to found a startup called Monoidics and asked O'Hearn to join them.

The original plan was to build a commercial product based on their work. But when Facebook made an offer to buy the company, O'Hearn says the team realized that they'd be able to make a bigger impact there than they would have been able to as a small startup. Now the team is able to give the entire platform away for free. "It took some time to come to that decision, but that was always the ideal situation," he says.

O'Hearn says hopes that by making Infer open source, the team can help other companies, gather feedback from them, and attract contributions from academics.

"Static analysis is full of great ideas but also unsolved problems," he says. "We hope this can boost collaboration between industry and academia, and get research flowing in both directions."