Back to Search Start Over

Automatic Repair of Semantic Defects Using Restraint Mechanisms

Authors :
Haojie Li
Zhang Li
Pang Shanchen
Meng Wu
Wenjing Yin
Dong Yukun
Mengying Wu
Source :
Symmetry; Volume 12; Issue 9; Pages: 1563, Symmetry, Vol 12, Iss 1563, p 1563 (2020)
Publication Year :
2020
Publisher :
MDPI AG, 2020.

Abstract

Recently, software, especially CPS and Internet of Things (IoT), increasingly have high requirements for quality, while program defects exist inevitably duo to the high complexity. Program defect repair faces serious challenges in that such repairs require considerable manpower, and the existing automatic repair approaches have difficulty generating correct patches efficiently. This paper proposes an automatic method for repairing semantic defects in Java programs based on restricted sets which refer to the interval domains of related variables that can trigger program semantic defects. Our work introduces a repair mechanism symmetrically combining defect patterns and repair templates. First, the program semantic defects are summarized into defect patterns according to their grammar and semantic features. A repair template for each type of defect pattern is predefined based on a restricted-set. Then, for each specific defect, a patch statement is automatically synthesized according to the repair template, and the detected defect information is reported by the static detection tool (DTSJava). Next, the patch location is determined by the def-use chain of defect-related variables. Finally, we evaluate the patches generated by our method using DTSJava. We implemented the method in the defect automatic repair prototype tool DTSFix to verify the effect of repairing the semantic defects detected by DTSJava in 6 Java open-source projects. The experimental results showed that 109 of 129 program semantic defects were repaired.

Details

ISSN :
20738994
Volume :
12
Database :
OpenAIRE
Journal :
Symmetry
Accession number :
edsair.doi.dedup.....a1624962430799ee63df94ffc9c136b2
Full Text :
https://doi.org/10.3390/sym12091563