Automated Program-Semantic Defect Repair and False-Positive Elimination without Side Effects

The alarms of the program-semantic defect-detection report based on static analysis include defects and false positives. The repair of defects and the elimination of false positives are time-consuming and laborious, and new defects may be introduced in the process. To solve these problems, the safe constraints interval of related variables and methods are proposed for the semantic defects in the program, and proposes a functionally equivalent no-side-effect program-semantic defect repair and false-positive elimination strategy based on the test-equivalence theory. This paper realizes the automatic repair of the typical semantic defects of Java programs and the automatic elimination of false positives by adding safe constraint patches. After the repair, the program functions are equivalent and the status of each program point is within the safety range, so that the functions before and after the defect repair are consistent, and the functions and semantics before and after the false positives are eliminated. We have evaluated our approach by repairing 5 projects; our results show that the repair strategy does not require manual confirmation of alarms, automated repair of the program effectively, shortened the repair time greatly, and ensured the correctness of the program after the repair.

[1]  Claire Le Goues,et al.  GenProg: A Generic Method for Automatic Software Repair , 2012, IEEE Transactions on Software Engineering.

[2]  Xiang Gao,et al.  Test-Equivalence Analysis for Automatic Patch Generation , 2018, ACM Trans. Softw. Eng. Methodol..

[3]  Jacques Klein,et al.  FixMiner: Mining relevant fix patterns for automated program repair , 2018, Empirical Software Engineering.

[4]  Sarfraz Khurshid,et al.  SketchFix: a tool for automated program repair approach using lazy candidate generation , 2018, ESEC/SIGSOFT FSE.

[5]  Fan Long,et al.  An analysis of patch plausibility and correctness for generate-and-validate patch generation systems , 2015, ISSTA.

[6]  Gregg Rothermel,et al.  Supporting Controlled Experimentation with Testing Techniques: An Infrastructure and its Potential Impact , 2005, Empirical Software Engineering.

[7]  YuanYuan,et al.  Toward Better Evolutionary Program Repair , 2020 .

[8]  Johannes Bader,et al.  Getafix: learning to fix bugs automatically , 2019, Proc. ACM Program. Lang..

[9]  Gabriele Bavota,et al.  An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translation , 2018, ACM Trans. Softw. Eng. Methodol..

[10]  Sarfraz Khurshid,et al.  EdSketch: execution-driven sketching for Java , 2019, International Journal on Software Tools for Technology Transfer.

[11]  Meng Wu,et al.  Automatic Repair of Semantic Defects Using Restraint Mechanisms , 2020, Symmetry.

[12]  Jeongho Kim,et al.  The effectiveness of context-based change application on automatic program repair , 2019, Empirical Software Engineering.

[13]  Matias Martinez,et al.  Automatic repair of real bugs in java: a large-scale experiment on the defects4j dataset , 2016, Empirical Software Engineering.

[14]  Claire Le Goues,et al.  Current challenges in automatic software repair , 2013, Software Quality Journal.