Facebook is using AI to help developers track down bugs

Linh Le

Facebook is releasing an AI-powered tool called SapFix which aims to help software developers track down pesky bugs in their code.

SapFix detects errors in code and suggests possible fixes to developers. Currently, it fixes bugs spotted by Sapienz – a software testing tool by Facebook – but the company promises it will be able to find errors in any code.

The AI works by rolling back the code which has caused an error. At this point, it refers to its knowledge base of fixes that have worked in the past until it no longer causes an error.

workflow

Multiple solutions are produced and tested against three parameters:

  • Are there compilation errors?
  • Does the crash persist?
  • Does the fix introduce new crashes?

After producing the potential fixes, it picks one to send to engineers who are then able to review whether it’s a viable solution.

engineer feedback

Facebook is already using SapFix internally and claims it helped them in shipping improved builds of its Android app. The company says it believes SapFix marks the first time AI-suggested fixes have been deployed into a codebase as large as Facebook’s.

“It’s an important milestone for AI hybrids and offers further evidence that search-based software engineering can reduce friction in software development,” wrote Facebook in a blog post. “As we develop SapFix to work with different kinds of bugs and software, the tool has the potential to change the speed and quality of code generation.”

The next step for SapFix is to detect crashes before they happen in order to be proactive about fixes before they become a problem for users.

SapFix and Sapienz will be released as open source tools once Facebook completes its engineering work.

 

Share the news now

Source : https://www.developer-tech.com