作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2018, Vol. 44 ›› Issue (10): 95-100. doi: 10.19678/j.issn.1000-3428.0048446

• 体系结构与软件技术 • 上一篇    下一篇

一种基于StackOverflow分析的程序自动修复方法

刘旭亮,钟浩   

  1. 上海交通大学 电子信息与电气工程学院,上海 200240
  • 收稿日期:2017-08-23 出版日期:2018-10-15 发布日期:2018-10-15
  • 作者简介:刘旭亮(1994—),男,硕士研究生,主研方向为软件工程;钟浩,副研究员。
  • 基金资助:
    国家重点基础研究计划(2015CB352203);国家自然科学基金面上项目(61572313)。

A Program Automatic Repair Method Based on StackOverflow Analysis

LIU Xuliang,ZHONG Hao   

  1. School of Electronic Information and Electrical Engineering,Shanghai Jiaotong University,Shanghai 200240,China
  • Received:2017-08-23 Online:2018-10-15 Published:2018-10-15

摘要: 现有程序缺陷修复方法缺乏充足的修复模板,多数只能修复小部分程序缺陷。为此,提出一种从StackOverflow中获取示例代码,并从示例代码中挖掘出修复样品的方法。从程序员日常开发讨论中获取与修复有关的代码对,并从中生成修复模板,该模板丰富了自动修复工具已有的操作,能够修复更多缺陷。对Defects4J数据集进行实验验证,结果表明,该方法能够修复23个程序缺陷,优于GenProg和Nopol等工具。

关键词: 程序自动修复, 真实缺陷修复, 修复模板, 示例代码, 修复样品

Abstract: Existing methods for program defect repair lack sufficient repair templates,and most of them can only repair a small number of program defects.To solve this problem,a method is proposed to obtain sample code from StackOverflow and to mine repair samples from sample code.From the programmer’s day-to-day development discussions,get the code pairs that are relevant to the fix and generate the fix template,which enriches the existing operations of the automatic fix tool and enables it to fix more defects.Experimental results on Defects4J dataset show that the method can repair 23 program defects,and is superior to GenProg and Nopol.

Key words: program automatic repair, real defect repair, repair template, sample code, repair sample

中图分类号: