The programmer's Gospel, AI can fix bugs automatically!

Source: Internet
Author: User
Tags abs
Artificial intelligence fully learn to program itself, may say there is a sense of science fiction, but AI help programmers find bugs this thing, has reached a good level. Peking University, Microsoft Research Asia and China's Chinese-made and the other try to let AI find bugs.   Microsoft Research Asia's Lily Sun, on Microsoft's official blog, said the precise state system they developed (accurate Condition system, ACS) could automatically fix bugs in software systems without interfering with humans.   Their paper on ACS Precise Condition synthesis for the program Repair published at the World Software Engineering Conference ICSE 2017. What bugs will the ACS automatically fix?   Lily Sun cited an example: int lcm=math.abs (Mulandcheck (A/GDC (a,b), b));   return LCM; This is a piece of code in Apache math that computes two-digit LCM and introduces Math.Abs to ensure that the returned value is a positive number.   However, the program is flawed and sometimes returns a negative value. We can create a test to find the error.   The input of the test is A=integer.min_value, B=1, and the expected output is throw arithmeticexception.   By inputting this program and the corresponding test into ACS, ACS will automatically generate path 2nd and 3 lines, fix defects: int Lcm=math.abs (Mulandcheck (A/GDC (a,b), b));   + if (LCM = = integer.min_value) {+  throw new arithmeticexception ();   +} return LCM; The fact that the algorithm has been modified by itself has been studied since 2009, with Westley Weimer of the computer department at the University of Virginia, Stephanie Forrest of the University of New Mexico and Claire Le Goues of Carnegie Mellon University, which developed Genpro   G. ACS, on the basis of previous research, has greatly improved the accuracy.   The test results on the DEFECTS4J benchmark show that 18 of the 23 patches generated by ACS are correct and nearly 80% accurate. The increase in the accuracy of ACS is mainly attributable to the increasedSources of information, especially the large amount of code on the Web. Compared with the previous methods, ACS has the following three new sources of information: one is to use the local principle information to order the variables in the patch; the second is to use natural language analysis technology to analyze Javadoc, and then use the information in Javadoc to filter the incorrect patches; third, through the online open source program for statistics Analysis, find the conditional probability of the operation of the variable, and then generate the correct patch.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.