Nopol: Automatic Repair of Conditional Statement Bugs in Java']Java Programs

被引:232
|
作者
Xuan, Jifeng [1 ]
Martinez, Matias [2 ]
DeMarco, Favio [3 ]
Clement, Maxime [4 ]
Lamelas Marcote, Sebastian [3 ]
Durieux, Thomas [4 ]
Le Berre, Daniel [5 ,6 ]
Monperrus, Martin [7 ,8 ]
机构
[1] Wuhan Univ, Sch Comp, State Key Lab Software Engn, Wuhan 430072, Peoples R China
[2] Univ Lugano, Fac Informat, Lugano, Switzerland
[3] Univ Buenos Aires, RA-1198 Buenos Aires, DF, Argentina
[4] Univ Lille, Dept Comp Sci, Lille, France
[5] Univ Artois, Comp Sci, Lens, France
[6] CNRS, Lens, France
[7] Univ Lille, Lille, France
[8] INRIA, Lille, France
基金
中国国家自然科学基金;
关键词
Automatic repair; patch generation; SMT; fault localization;
D O I
10.1109/TSE.2016.2560811
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We propose NOPOL, an approach to automatic repair of buggy conditional statements (i.e., if-then-else statements). This approach takes a buggy program as well as a test suite as input and generates a patch with a conditional expression as output. The test suite is required to contain passing test cases to model the expected behavior of the program and at least one failing test case that reveals the bug to be repaired. The process of NOPOL consists of three major phases. First, NOPOL employs angelic fix localization to identify expected values of a condition during the test execution. Second, runtime trace collection is used to collect variables and their actual values, including primitive data types and objected-oriented features (e.g., nullness checks), to serve as building blocks for patch generation. Third, NOPOL encodes these collected data into an instance of a Satisfiability Modulo Theory (SMT) problem; then a feasible solution to the SMT instance is translated back into a code patch. We evaluate NOPOL on 22 real-world bugs (16 bugs with buggy IF conditions and six bugs with missing preconditions) on two large open-source projects, namely Apache Commons Math and Apache Commons Lang. Empirical analysis on these bugs shows that our approach can effectively fix bugs with buggy IF conditions and missing preconditions. We illustrate the capabilities and limitations of NOPOL using case studies of real bug fixes.
引用
收藏
页码:34 / 55
页数:22
相关论文
共 50 条
  • [1] Automatic Repair of Java']Java Programs with Mixed Granularity and Variable Mapping
    Cao, Heling
    Cui, Zhiying
    Deng, Miaolei
    Chu, Yonghe
    Meng, Yangxia
    [J]. INFORMATION TECHNOLOGY AND CONTROL, 2023, 52 (01): : 68 - 84
  • [2] Locating bugs in Java']Java programs - First results of the Java']Java diagnosis experiments project
    Mateis, C
    Stumptner, M
    Wotawa, F
    [J]. INTELLIGENT PROBLEM SOLVING: METHODOLOGIES AND APPROACHES, PRODEEDINGS, 2000, 1821 : 174 - 183
  • [3] An exploratory study on exception handling bugs in Java']Java programs
    Ebert, Felipe
    Castor, Fernando
    Serebrenik, Alexander
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2015, 106 : 82 - 101
  • [4] Automatic Repair of Java']Java Programs Weighted Fusion Similarity via Genetic Programming
    Cao, Heling
    He, Zhenghao
    Meng, Yangxia
    Chu, Yonghe
    [J]. INFORMATION TECHNOLOGY AND CONTROL, 2022, 51 (04): : 738 - 756
  • [5] Automatic Error Correction of Java']Java Programs
    Kern, Christian
    Esparza, Javier
    [J]. FORMAL METHODS FOR INDUSTRIAL CRITICAL SYSTEMS, 2010, 6371 : 67 - 81
  • [6] An automatic method for refactoring Java']Java programs
    Yamazaki, S
    Nagata, M
    [J]. KNOWLEDGE-BASED SOFTWARE ENGINEERING, 2002, 80 : 167 - 172
  • [7] Towards automatic specialization of Java']Java programs
    Schultz, UP
    Lawall, JL
    Consel, C
    Muller, G
    [J]. ECOOP'99 - OBJECT-ORIENTED PROGRAMMING, 1999, 1628 : 367 - 390
  • [8] A Reflection on "An Exploratory Study on Exception Handling Bugs in Java']Java Programs"
    Ebert, Felipe
    Castor, Fernando
    Serebrenikt, Alexander
    [J]. PROCEEDINGS OF THE 2020 IEEE 27TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER '20), 2020, : 552 - 556
  • [9] Applying CodeBERT for Automated Program Repair of Java']Java Simple Bugs
    Mashhadi, Ehsan
    Hemmati, Hadi
    [J]. 2021 IEEE/ACM 18TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR 2021), 2021, : 505 - 509
  • [10] Automatic verification of Java']Java programs with dynamic frames
    Smans, Jan
    Jacobs, Bart
    Piessens, Frank
    Schulte, Wolfram
    [J]. FORMAL ASPECTS OF COMPUTING, 2010, 22 (3-4) : 423 - 457