Automated workarounds from Java program specifications based on SAT solving

The failures that bugs in software lead to can sometimes be bypassed by the so-called workarounds: when a (faulty) routine fails, alternative routines that the system offers can be used in place of the failing one, to circumvent the failure. Existing approaches to workaround-based system recovery consider workarounds that are produced from equivalent method sequences, automatically computed from user-provided abstract models, or directly produced from user-provided equivalent sequences of operations. In this paper, we present two techniques for computing workarounds from Java code equipped with formal specifications, that improve previous approaches in two respects. First, the particular state where the failure originated is actively involved in computing workarounds, thus leading to repairs that are more state specific. Second, our techniques automatically compute workarounds on concrete program state characterizations, avoiding abstract software models and user-provided equivalences. The first technique uses SAT solving to compute a sequence of methods that is equivalent to a failing method on a specific failing state, but which can also be generalized to schemas for workaround reuse. The second technique directly exploits SAT to circumvent a failing method, building a state that mimics the (correct) behaviour of a failing routine, from a specific program state too. We perform an experimental evaluation based on case studies involving implementations of collections and a library for date arithmetic, showing that the techniques can effectively compute workarounds from complex contracts in an important number of cases, in time that makes them feasible to be used for run-time repairs. Our results also show that our state-specific workarounds enable us to produce repairs in many cases where previous workaround-based approaches are inapplicable.

[1]  Name M. Lastname Automatically Finding Patches Using Genetic Programming , 2013 .

[2]  Martin Rinard,et al.  Automatic detection and repair of errors in data structures , 2003, OOPSLA 2003.

[3]  Daniel Jackson,et al.  Software Abstractions - Logic, Language, and Analysis , 2006 .

[4]  Sarfraz Khurshid,et al.  Repairing Structurally Complex Data , 2005, SPIN.

[5]  Jaechang Nam,et al.  Automatic patch generation learned from human-written patches , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[6]  Alessandra Gorla,et al.  Automatic Workarounds: Exploiting the Intrinsic Redundancy of Web Applications , 2015, TSEM.

[7]  Alessandra Gorla,et al.  Self-healing by means of automatic workarounds , 2008, SEAMS '08.

[8]  W. Eric Wong,et al.  Using Mutation to Automatically Suggest Fixes for Faulty Programs , 2010, 2010 Third International Conference on Software Testing, Verification and Validation.

[9]  Alessandra Gorla,et al.  Automatic recovery from runtime failures , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[10]  Gary T. Leavens,et al.  Beyond Assertions: Advanced Specification and Verification with JML and ESC/Java2 , 2005, FMCO.

[11]  Nazareno Aguirre,et al.  Bounded Lazy Initialization , 2013, NASA Formal Methods.

[12]  Robby,et al.  Sireum/Topi LDP: a lightweight semi-decision procedure for optimizing symbolic execution-based analyses , 2009, ESEC/FSE '09.

[13]  Nazareno Aguirre,et al.  An Analysis of the Suitability of Test-Based Patch Acceptance Criteria , 2017, 2017 IEEE/ACM 10th International Workshop on Search-Based Software Testing (SBST).

[14]  Bertrand Meyer,et al.  What good are strong specifications? , 2012, 2013 35th International Conference on Software Engineering (ICSE).

[15]  Todd D. Millstein,et al.  Falling Back on Executable Specifications , 2010, ECOOP.

[16]  Yuriy Brun,et al.  Is the cure worse than the disease? overfitting in automated program repair , 2015, ESEC/SIGSOFT FSE.

[17]  Sarfraz Khurshid,et al.  History-Aware Data Structure Repair Using SAT , 2012, TACAS.

[18]  Nazareno Aguirre,et al.  Improving Test Generation under Rich Contracts by Tight Bounds and Incremental SAT Solving , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation.

[19]  Felix Sheng-Ho Chang,et al.  Modular verification of code with SAT , 2006, ISSTA '06.

[20]  Sarfraz Khurshid,et al.  Bounded exhaustive test input generation from hybrid invariants , 2014, OOPSLA 2014.

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

[22]  Corina S. Pasareanu,et al.  Test input generation for java containers using state matching , 2006, ISSTA '06.

[23]  Barbara Liskov,et al.  Program Development in Java - Abstraction, Specification, and Object-Oriented Design , 1986 .

[24]  Alessandra Gorla,et al.  Search-based synthesis of equivalent method sequences , 2014, SIGSOFT FSE.

[25]  Marcelo F. Frias,et al.  Analysis of invariants for efficient bounded verification , 2010, ISSTA '10.

[26]  Christoph Csallner,et al.  Dynamic symbolic data structure repair , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[27]  Michael D. Ernst,et al.  Feedback-Directed Random Test Generation , 2007, 29th International Conference on Software Engineering (ICSE'07).

[28]  Michael D. Ernst,et al.  Generalized Data Structure Synthesis , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE).

[29]  Alessandra Gorla,et al.  Automatic workarounds for web applications , 2010, FSE '10.

[30]  Nazareno Aguirre,et al.  BLISS: Improved Symbolic Execution by Bounded Lazy Initialization with SAT Support , 2015, IEEE Transactions on Software Engineering.

[31]  Nazareno Aguirre,et al.  DynAlloy: upgrading alloy with actions , 2005, ICSE.

[32]  Marcelo F. Frias,et al.  DynAlloy as a Formal Method for the Analysis of Java Programs , 2006, SET.

[33]  Sarfraz Khurshid,et al.  Contract-Based Data Structure Repair Using Alloy , 2010, ECOOP.

[34]  Fan Long,et al.  Staged program repair with condition synthesis , 2015, ESEC/SIGSOFT FSE.

[35]  Marcelo F. Frias,et al.  TACO: Efficient SAT-Based Bounded Verification Using Symmetry Breaking and Tight Bounds , 2013, IEEE Transactions on Software Engineering.

[36]  K. Rustan M. Leino,et al.  Dafny: An Automatic Program Verifier for Functional Correctness , 2010, LPAR.

[37]  Alessandra Gorla,et al.  RAW: runtime automatic workarounds , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.