Advertisement

Automated workarounds from Java program specifications based on SAT solving

  • Marcelo Uva
  • Pablo Ponzio
  • Germán Regis
  • Nazareno Aguirre
  • Marcelo F. Frias
FASE 2017

Abstract

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.

Keywords

Runtime recovery Workarounds SAT Solving 

References

  1. 1.
    Replication Package for Automated Workarounds from Java Program Specifications Based on SAT Solving. http://dc.exa.unrc.edu.ar/staff/naguirre/sat-workarounds/. Accessed 30 July 2018
  2. 2.
    Abad, P., Aguirre, N., Bengolea, V.S., Ciolek, D., Frias, M.F., Galeotti, J.P., Maibaum, T., Moscato, M.M., Rosner, N., Vissani, I.: Improving test generation under rich contracts by tight bounds and incremental SAT solving. In: Sixth IEEE International Conference on Software Testing, Verification and Validation (ICST 2013), Luxembourg, 18–22 Mar 2013, pp. 21–30. IEEE Computer Society (2013)Google Scholar
  3. 3.
    Belt, J., Xianghua, D.: Sireum/topi LDP: a lightweight semi-decision procedure for optimizing symbolic execution-based analyses. In: van Vliet H., Issarny V. (eds.) Proceedings of the 7th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT International Symposium on Foundations of Software Engineering 2009, Amsterdam, 24–28 Aug 2009, pp. 355–364. ACM (2009)Google Scholar
  4. 4.
    Carzaniga, A., Gorla, A., Mattavelli, A., Perino, N., Pezzè, M.: Automatic recovery from runtime failures. In: Notkin D., Cheng B.H.C., Pohl K. (eds.) 35th International Conference on Software Engineering (ICSE ’13), San Francisco, CA, pp. 782–791, 18–26 May 2013. IEEE Computer Society (2013)Google Scholar
  5. 5.
    Carzaniga, A., Gorla, A., Perino, N., Pezzè, M.: Automatic workarounds for web applications. In: Roman G.-C., van der Hoek A. (eds.) Proceedings of the 18th ACM SIGSOFT International Symposium on Foundations of Software Engineering, 2010, Santa Fe, NM, USA, 7–11 Nov 2010, pp. 237–246. ACM (2010)Google Scholar
  6. 6.
    Carzaniga, A., Gorla, A., Perino, N., Pezzè, M.: RAW: runtime automatic workarounds. In: Kramer J., Bishop J., Devanbu P.T., Uchitel S. (eds.) Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering (ICSE 2010), Cape Town, vol. 2, pp. 321–322, 1–8 May 2010. ACM (2010)Google Scholar
  7. 7.
    Carzaniga, A., Gorla, A., Perino, N., Pezzè, M.: Automatic workarounds: exploiting the intrinsic redundancy of web applications. ACM Trans. Softw. Eng. Methodol. 24(3), 16-1–16-42 (2015)CrossRefGoogle Scholar
  8. 8.
    Carzaniga, A., Gorla, A., Pezzè, M.: Self-healing by means of automatic workarounds. In: Cheng B.H.C., de Lemos R., Garlan D., Giese H., Litoiu M., Magee J., Müller H.A., Taylor R.N. (eds.) 2008 ICSE Workshop on Software Engineering for Adaptive and Self-Managing Systems, SEAMS 2008, Leipzig, Germany, 12–13 May 2008, pp. 17–24. ACM (2008)Google Scholar
  9. 9.
    Chalin, P., Kiniry, J.R., Leavens, G.T., Poll, E.: Beyond assertions: advanced specification and verification with JML and esc/Java2. In: de Boer F.S., Bonsangue M.M., Graf S., de Roever W.P. (eds.) Formal Methods for Components and Objects, 4th International Symposium, FMCO 2005, Amsterdam, 1–4 Nov 2005, Revised Lectures, volume 4111 of Lecture Notes in Computer Science, pp. 342–363. Springer (2005)Google Scholar
  10. 10.
    Debroy, V., Wong, W.E.: Using mutation to automatically suggest fixes for faulty programs. In: Third International Conference on Software Testing, Verification and Validation (ICST 2010), Paris, 7–9 Apr 2010, pp. 65–74. IEEE Computer Society (2010)Google Scholar
  11. 11.
    Demsky, B., Rinard, M.C.: Automatic detection and repair of errors in data structures. In: Crocker R.S. Jr., Guy L. (eds.) Proceedings of the 2003 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2003), 26–30 Oct 2003, Anaheim, CA, pp. 78–95. ACM (2003)Google Scholar
  12. 12.
    Dennis, G., Chang, F.S.H., Jackson, D.: Modular verification of code with SAT. In: Pollock L.L., Pezzè M. (eds.) Proceedings of the ACM/SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2006), Portland, Maine, pp. 109–120, 17–20 July 2006. ACM (2006)Google Scholar
  13. 13.
    Frias, M.F., Galeotti, J.P., Pombo, C.L., Aguirre, N.: Dynalloy: upgrading alloy with actions. In: Roman G.-C., Griswold W.G., Nuseibeh B. (eds.) 27th International Conference on Software Engineering (ICSE 2005), 15–21 May 2005, St. Louis, Missouri, pp. 442–451. ACM (2005)Google Scholar
  14. 14.
    Galeotti, J.P., Frias, M.F.: Dynalloy as a formal method for the analysis of java programs. In: Sacha K. (ed.) Software Engineering Techniques: Design for Quality (SET 2006), 17–20 Oct 2006, Warsaw, Poland, volume 227 of IFIP, pp. 249–260. Springer (2006)Google Scholar
  15. 15.
    Galeotti, J.P., Rosner, N., Pombo, C.G.L., Frias, M.F.: TACO: efficient sat-based bounded verification using symmetry breaking and tight bounds. IEEE Trans. Softw. Eng. 39(9), 1283–1307 (2013)CrossRefGoogle Scholar
  16. 16.
    Galeotti, J.P., Rosner, N., Pombo, C.L., Frias, M.F.: Analysis of invariants for efficient bounded verification. In: Tonella P., Orso A. (eds.) Proceedings of the Nineteenth International Symposium on Software Testing and Analysis (ISSTA 2010), Trento, 12–16 July 2010, pp. 25–36. ACM (2010)Google Scholar
  17. 17.
    Geldenhuys, J., Aguirre, N., Frias, M.F., Visser, W.: Bounded lazy initialization. In: Brat G., Rungta N., Venet A. (eds.) 5th International Symposium NASA Formal Methods (NFM 2013), Moffett Field, CA, 14–16 May 2013. Proceedings, volume 7871 of Lecture Notes in Computer Science, pp. 229–243. Springer (2013)Google Scholar
  18. 18.
    Goffi, A., Gorla, A., Mattavelli, A., Pezzè, M., Tonella, P.: Search-based synthesis of equivalent method sequences. In: Cheung S.-C., Orso A., Storey M.A.D. (eds.) Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE-22), Hong Kong, 16–22 Nov 2014, pp. 366–376. ACM (2014)Google Scholar
  19. 19.
    Hussain, I., Csallner, C.: Dynamic symbolic data structure repair. In: Kramer J., Bishop J., Devanbu P.T., Uchitel S. (eds.) Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering (ICSE 2010), Cape Town, vol. 2, pp. 215–218, 1–8 May 2010. ACM (2010)Google Scholar
  20. 20.
    Jackson, D.: Software Abstractions: Logic, Language, and Analysis. MIT Press, Cambridge (2006)Google Scholar
  21. 21.
    Khurshid, S., García, I., Suen, Y.L.: Repairing structurally complex data. In: Patrice G. (ed.) Model Checking Software, 12th International SPIN Workshop, San Francisco, CA, 22–24 Aug 2005. Proceedings, volume 3639 of Lecture Notes in Computer Science, pp. 123–138. Springer (2005)Google Scholar
  22. 22.
    Kim, D., Nam, J., Song, J., Kim, S.: Automatic patch generation learned from human-written patches. In: Notkin D., Cheng B.H.C., Pohl K. (eds.) 35th International Conference on Software Engineering (ICSE ’13), San Francisco, CA, pp. 802–811, 18–26 May 2013. IEEE Computer Society (2013)Google Scholar
  23. 23.
    Leino, K.R.M.: Dafny: an automatic program verifier for functional correctness. In: Clarke E.M., Voronkov A. (eds.) Logic for Programming, Artificial Intelligence, and Reasoning—16th International Conference, LPAR-16, Dakar, April 25–May 1 2010, Revised Selected Papers, volume 6355 of Lecture Notes in Computer Science, pp. 348–370. Springer (2010)Google Scholar
  24. 24.
    Liskov, B., Guttag, J.V.: Program Development in Java: Abstraction, Specification, and Object-Oriented Design. Addison-Wesley, Reading (2001)zbMATHGoogle Scholar
  25. 25.
    Loncaric, C., Ernst, M.D., Torlak, E.: Generalized data structure synthesis. In: Chaudron M., Crnkovic I., Chechik M., Harman M. (eds.) Proceedings of the 40th International Conference on Software Engineering (ICSE 2018), Gothenburg, May 27–June 03 2018, pp. 958–968. ACM (2018)Google Scholar
  26. 26.
    Long, F., Rinard, M.: Staged program repair with condition synthesis. In: Di Nitto E., Harman M., Heymans P. (eds.) Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2015), Bergamo, pp. 166–178, Aug 30–Sept 4 2015. ACM (2015)Google Scholar
  27. 27.
    Pacheco, C., Lahiri, S.K., Ernst, M.D., Ball, T.: Feedback-directed random test generation. In: 29th International Conference on Software Engineering (ICSE 2007), Minneapolis, MN, 20–26 May 2007, pp. 75–84. IEEE Computer Society (2007)Google Scholar
  28. 28.
    Polikarpova, N., Furia, C.A., Pei, Y., Wei, Y., Meyer, B.: What good are strong specifications? In: Notkin D., Cheng B.H.C., Pohl K. (eds.) 35th International Conference on Software Engineering (ICSE ’13), San Francisco, CA, pp. 262–271, 18–26 May 2013. IEEE Computer Society (2013)Google Scholar
  29. 29.
    Qi, Z., Long, F., Achour, S., Rinard, M.C.: An analysis of patch plausibility and correctness for generate-and-validate patch generation systems. In: Young M., Xie T. (eds.) Proceedings of the 2015 International Symposium on Software Testing and Analysis (ISSTA 2015), Baltimore, MD, 12–17 July 2015, pp. 24–36. ACM (2015)Google Scholar
  30. 30.
    Rosner, N., Bengolea, V.S., Ponzio, P., Khalek, S.A., Aguirre, N., Frias, M.F., Khurshid, S.: Bounded exhaustive test input generation from hybrid invariants. In: Black A.P., Millstein T.D. (eds.) Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA 2014), Part of SPLASH 2014, Portland, OR, 20–24 Oct 2014, pp. 655–674. ACM (2014)Google Scholar
  31. 31.
    Rosner, N., Geldenhuys, J., Aguirre, N., Visser, W., Frias, M.F.: BLISS: improved symbolic execution by bounded lazy initialization with SAT support. IEEE Trans. Softw. Eng. 41(7), 639–660 (2015)Google Scholar
  32. 32.
    Samimi, H., Aung, E.D., Millstein, T.D.: Falling back on executable specifications. In: D’Hondt T. (ed.) ECOOP 2010—Object-Oriented Programming, 24th European Conference, Maribor, Slovenia, 21–25 June 2010. Proceedings, volume 6183 of Lecture Notes in Computer Science, pp. 552–576. Springer (2010)Google Scholar
  33. 33.
    Smith, E.K., Barr, E.T., Le Goues, C., Brun, Y.: Is the cure worse than the disease? Overfitting in automated program repair. In: Di Nitto E., Harman M., Heymans P. (eds.) Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2015), Bergamo, pp. 532–543, Aug 30–Sept 4 2015. ACM (2015)Google Scholar
  34. 34.
    Visser, W., Pasareanu, C.S., Pelánek, R.: Test input generation for java containers using state matching. In: Pollock L.L., Pezzè M. (eds.) Proceedings of the ACM/SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2006), Portland, Maine, pp. 37–48, 17–20 July 2006. ACM (2006)Google Scholar
  35. 35.
    Weimer, W., Nguyen, T., Le Goues, C., Forrest, S.: Automatically finding patches using genetic programming. In: 31st International Conference on Software Engineering (ICSE 2009), 16–24 May 2009, Vancouver, Proceedings, pp. 364–374. IEEE (2009)Google Scholar
  36. 36.
    Zaeem, R.N., Gopinath, D., Khurshid, S., McKinley, K.S.: History-aware data structure repair using SAT. In: Flanagan C., König B. (eds.) Tools and Algorithms for the Construction and Analysis of Systems—18th International Conference (TACAS 2012), Held as Part of the European Joint Conferences on Theory and Practice of Software (ETAPS 2012), Tallinn, Estonia, Mar 24–Apr 1 2012. Proceedings, volume 7214 of Lecture Notes in Computer Science, pp. 2–17. Springer (2012)Google Scholar
  37. 37.
    Zaeem, R.N., Khurshid, S.: Contract-based data structure repair using alloy. In: D’Hondt T. (ed.) ECOOP 2010—Object-Oriented Programming, 24th European Conference, Maribor, Slovenia, 21–25 June 2010. Proceedings, volume 6183 of Lecture Notes in Computer Science, pp. 577–598. Springer (2010)Google Scholar
  38. 38.
    Zemín, L., Brida, S.G., Godio, A., Cornejo, C., Degiovanni, R., Regis, G., Aguirre, Na., Frias, M.F.: An analysis of the suitability of test-based patch acceptance criteria. In: 10th IEEE/ACM International Workshop on Search-Based Software Testing (SBST@ICSE 2017), Buenos Aires, Argentina, 22–23 May 2017, pp. 14–20. IEEE (2017)Google Scholar

Copyright information

© Springer-Verlag GmbH Germany, part of Springer Nature 2018

Authors and Affiliations

  • Marcelo Uva
    • 1
  • Pablo Ponzio
    • 1
    • 3
  • Germán Regis
    • 1
  • Nazareno Aguirre
    • 1
    • 3
  • Marcelo F. Frias
    • 2
    • 3
  1. 1.Universidad Nacional de Río CuartoRío CuartoArgentina
  2. 2.Instituto Tecnológico de Buenos Aires (ITBA)Buenos AiresArgentina
  3. 3.Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)Buenos AiresArgentina

Personalised recommendations