Automatic program repair holds the potential of dramatically improving the productivity of programmers during the software development process and correctness of software in general. Recent advances in machine learning, deep learning, and NLP have rekindled the hope to eventually fully automate the process of repairing programs. However, previous approaches that aim to predict a single fix are prone to fail due to uncertainty about the true intend of the programmer. Therefore, we propose a generative model that learns a distribution over potential fixes. Our model is formulated as a deep conditional variational autoencoder that can efficiently sample fixes for a given erroneous program. In order to ensure diverse solutions, we propose a novel regularizer that encourages diversity over a semantic embedding space. Our evaluations on common programming errors show for the first time the generation of diverse fixes and strong improvements over the state-of-the-art approaches by fixing up to 45% of the erroneous programs. We additionally show that for the 65% of the repaired programs, our approach was able to generate multiple programs with diverse functionalities.
翻译:自动程序修复具有大幅提高程序员在软件开发过程中的生产力和软件一般正确性的潜力。 机器学习、 深层学习和 NLP 的最新进展重新燃起了最终使程序修复过程完全自动化的希望。 但是, 先前旨在预测单一修复的方法可能由于程序员真实意图的不确定性而失败。 因此, 我们提议了一个基因化模型, 了解潜在修复的分布。 我们的模型是作为一个深度的有条件变异自动编码器, 能够有效地为某个错误的程序进行抽样处理。 为了确保不同的解决方案, 我们提议了一个新颖的常规化工具, 鼓励语言嵌入空间的多样性。 我们对共同编程错误的评估首次通过修正45%的错误程序, 展示了不同修复方法的生成, 并大大改进了最先进的方法。 我们还进一步表明, 对于65%的修复程序, 我们的方法能够产生多种功能的多个程序。