One example to understand SemFix: Program Repair via Semantic Analysis

One example to understand SemFix: Program Repair via Semantic Analysis

Basic Information

  • Authors: Hoang Duong Thien Nguyen, Dawei Qi, Abhik Roychoudhury
  • Pulication: ICSE'13
  • Description: Semantic Program Repair

Example

Buggy code:

Sameple Code

Test Suite:

Test Suite

Overview

Step 1: Fault Localization

Tarantula is applied to produce a suspiciousness ranklist of statements.
Fault Localization

Step 2: Generate Repair Constraint via Symbolic Execution

Repair Constraint
Constraints: f(1, 11, 110) > 110∧f(1, 0, 100) ≤ 100∧f(1, −20, 60) > 60

Step 3: Generate a Repair

Employ program synthesis to solve the constraint for f in order to get a concrete function. Program synthesis requires basic components (e.g. constants, “+”, “−”) as ingredients to construct the function f.
In this technique, these components are incrementally provided to program synthesis.

In the first trial, only a constant is allowed. However, no constant function can satisfy the above constraint. We then allow function f to use one “+”, i.e. f can take either the form of var1 + c or var1+var2, where var1 and var2 are in {inhibit, up_sep, down_sep} and c is an integer constant. The synthesis procedure can find a solution f(inhibit, up sep, down sep) = up sep + 100 which is a successful repair to the program in Fig. 1. Note that if “−” is used instead of “+”, we will get f(inhibit, up sep, down sep) = up sep − (−100) as repair.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值