skip to main content
10.1145/1831708.1831734acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

On test repair using symbolic execution

Authors Info & Claims
Published:12 July 2010Publication History

ABSTRACT

When developers change a program, regression tests can fail not only due to faults in the program but also due to out-of-date test code that does not reflect the desired behavior of the program. When this occurs, it is necessary to repair test code such that the tests pass. Repairing tests manually is difficult and time consuming. We recently developed ReAssert, a tool that can automatically repair broken unit tests, but only if they lack complex control flow or operations on expected values.

This paper introduces symbolic test repair, a technique based on symbolic execution, which can overcome some of ReAssert's limitations. We reproduce experiments from earlier work and find that symbolic test repair improves upon previously reported results both quantitatively and qualitatively. We also perform new experiments which confirm the benefits of symbolic test repair and also show surprising similarities in test failures for open-source Java and .NET programs. Our experiments use Pex, a powerful symbolic execution engine for .NET, and we find that Pex provides over half of the repairs possible from the theoretically ideal symbolic test repair.

References

  1. S. Anand, C. Pǎsǎreanu, and W. Visser. JPF-SE: A symbolic execution extension to Java PathFinder. In TACAS, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. Arcuri and X. Yao. A novel co-evolutionary approach to automatic software bug fixing. In CEC, 2008.Google ScholarGoogle ScholarCross RefCross Ref
  3. K. Beck. Where, oh where to test http://www.threeriversinstitute.org/WhereToTest.html.Google ScholarGoogle Scholar
  4. M. Boshernitsan, R. Doong, and A. Savoia. From Daikon to Agitator: Lessons and challenges in building a commercial tool for developer testing. In ISSTA, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Brumley, J. Caballero, Z. Liang, J. Newsome, and D. Song. Towards automatic discovery of deviations in binary implementations with applications to error detection and fingerprint generation. In USENIX, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C2 Wiki. Deleting broken unit tests. http://c2.com/cgi-bin/wiki?DeletingBrokenUnitTests.Google ScholarGoogle Scholar
  7. C. Cadar, D. Dunbar, and D. R. Engler. KLEE: Unassisted and automatic generation of high-coverage tests for complex systems programs. In OSDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. C. Cadar, V. Ganesh, P. M. Pawlowski, D. L. Dill, and D. R. Engler. EXE: Automatically generating inputs of death. ACM Trans. Inf. Syst. Secur., 12(2), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. H. Chang, L. Mariani, and M. Pezzè. In-field healing of integration problems with COTS components. In ICSE, 2009.Google ScholarGoogle Scholar
  10. L. Clarke and D. Richardson. Symbolic evaluation methods for program analysis. In Program Flow Analysis: Theory and Applications, chapter 9. 1981.Google ScholarGoogle Scholar
  11. H. Cleve and A. Zeller. Locating causes of program failures. In ICSE, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Csallner, N. Tillmann, and Y. Smaragdakis. DySy: dynamic symbolic execution for invariant inference. In ICSE, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. B. Daniel and M. Boshernitsan. Predicting effectiveness of automatic testing tools. In ASE, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. B. Daniel, V. Jagannath, D. Dig, and D. Marinov. ReAssert: Suggesting repairs for broken unit tests. In ASE, 2009. http://mir.cs.illinois.edu/reassert/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. B. Daniel, V. Jagannath, D. Dig, and D. Marinov. ReAssert: Suggesting repairs for broken unit tests. Technical Report http://hdl.handle.net/2142/13628, University. of Illinois at Urbana-Champaign, 2009.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. db4objects. Sharpen. https://developer.db4o.com/Documentation/Reference/db4o-7.12/java/reference/html/reference/sharpen.html.Google ScholarGoogle Scholar
  17. L. de Moura and N. Bjørner. Z3: An efficient SMT solver. In TACAS, 2008. http://research.microsoft.com/projects/z3/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. P. Godefroid. Compositional dynamic test generation. In POPL, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Godefroid, A. Kiezun, and M. Y. Levin. Grammar-based whitebox fuzzing. In PLDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Godefroid, N. Klarlund, and K. Sen. DART: directed automated random testing. In PLDI, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. Grechanik, Q. Xie, and C. Fu. Maintaining and evolving GUI-directed test scripts. In ICSE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Harman and N. Alshahwan. Automated session data repair for web application regression testing. In ICST, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. J. Harrold, R. Gupta, and M. L. Soffa. A methodology for controlling the size of a test suite. TOSEM, 2(3), 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. H. He and N. Gupta. Automated debugging using path-based weakest preconditions. In FASE, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  25. J. H. Hicinbothom and W. W. Zachary. A tool for automatically generating transcripts of human-computer interaction. In HFES, 1993.Google ScholarGoogle ScholarCross RefCross Ref
  26. D. Jeffrey, M. Feng, N. Gupta, and R. Gupta. BugFix: A learning-based tool to assist developers in fixing bugs. In ICPC, 2009.Google ScholarGoogle ScholarCross RefCross Ref
  27. D. Jeffrey, N. Gupta, and R. Gupta. Fault localization using value replacement. In ISSTA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. L. Jiang and Z. Su. Context-aware statistical debugging: From bug predictors to faulty control flow paths. In ASE, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Y. Kannan and K. Sen. Universal symbolic execution and its application to likely data structure invariant generation. In ISSTA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. A. Kieyzun, P. J. Guo, K. Jayaraman, and M. D. Ernst. Automatic creation of SQL injection and cross-site scripting attacks. In ICSE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. J. C. King. Symbolic execution and program testing. CACM, 19(7):385--394, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. R. Kitts. Is bad software really my fault? http://artima.com/weblogs/viewpost.jsp?thread=231225.Google ScholarGoogle Scholar
  33. R. Majumdar and K. Sen. Hybrid concolic testing. In ICSE, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. A. Memon. Automatically repairing event sequence-based GUI test suites for regression testing. TSE, 18(2), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. L. Moonen, A. van Deursen, A. Zaidman, and M. Bruntink. On the interplay between software testing and evolution and its effect on program comprehension. In Software Evolution. 2008.Google ScholarGoogle Scholar
  36. NoMoreHacks. Shocker: Changing my code broke my tests, a developer confesses. http://nomorehacks.wordpress.com/2009/08/18/shocker-changing-my-code-broke-my-tests-a-developer-confesses/.Google ScholarGoogle Scholar
  37. C. S. Pǎsǎreanu, P. C. Mehlitz, D. H. Bushnell, K. Gundy-Burlet, M. Lowry, S. Person, and M. Pape. Combining unit-level symbolic execution and system-level concrete execution for testing NASA software. In ISSTA, 2008.Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. K. Rutherford. Why I broke 89 tests. http://silkandspinach.net/2009/10/18/why-i-broke-89-tests/.Google ScholarGoogle Scholar
  39. M. Sama, F. Raimondi, D. S. Rosenblum, and W. Emmerich. Algorithms for efficient symbolic detection of faults in context-aware applications. In ASE Workshops, 2008.Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. D. Schuler, V. Dallmeier, and A. Zeller. Efficient mutation testing by checking invariant violations. Technical report, Universitaet des Saarlandes, 2009.Google ScholarGoogle Scholar
  41. M. Schwern. On fixing a broken test suite, step one: Break the cycle of failure. http://use.perl.org/~schwern/journal/32782.Google ScholarGoogle Scholar
  42. K. Sen, D. Marinov, and G. Agha. CUTE: A concolic unit testing engine for C. In ESEC/FSE, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. S. Sinha, H. Shah, C. Görg, S. Jiang, M. Kim, and M. J. Harrold. Fault localization and repair for Java runtime exceptions. In ISSTA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Stack Overflow. Program evolution and broken tests. http://stackoverflow.com/questions/2054171/.Google ScholarGoogle Scholar
  45. S. Tallam, C. Tian, R. Gupta, and X. Zhang. Avoiding program failures through safe execution perturbationss. In COMPSAC, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. N. Tillmann and J. de Halleux. Pex-white box test generation for .NET. In Tests and Proofs. 2008. http://research.microsoft.com/projects/Pex/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. N. Tillmann and W. Schulte. Parameterized unit tests. In ESEC/FSE, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. F. Tip. A survey of program slicing techniques. Journal of Programming Languages, 3(3), 1995.Google ScholarGoogle Scholar
  49. A. Tomb, G. Brat, and W. Visser. Variably interprocedural program analysis for runtime error detection. In ISSTA, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. X. Wang, S.-C. Cheung, W. K. Chan, and Z. Zhang. Taming coincidental correctness: Coverage refinement with context patterns to improve fault localization. In ICSE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. W. Weimer, T. V. Nguyen, C. L. Goues, and S. Forrest. Automatically finding patches using genetic programming. In ICSE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. J. Wloka, B. G. Ryder, and F. Tip. JUnitMX - A change-aware unit testing tool. In ICSE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. R.-G. Xu, P. Godefroid, and R. Majumdar. Testing for buffer overflows with length abstraction. In ISSTA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. F. Yu, T. Bultan, and O. H. Ibarra. Symbolic string verification: Combining string analysis and size analysis. In TACAS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Y. Yu, J. A. Jones, and M. J. Harrold. An empirical study of the effects of test-suite reduction on fault localization. In ICSE, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. A. Zeller. Automated debugging: Are we close? Computer, 34(11), 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. L. Zhang, S.-S. Hou, C. Guo, T. Xie, and H. Mei. Time-aware test-case prioritization using integer linear programming. In ISSTA, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. X. Zheng and M.-H. Chen. Maintaining multi-tier web applications. In ICSM, 2007.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. On test repair using symbolic execution

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        ISSTA '10: Proceedings of the 19th international symposium on Software testing and analysis
        July 2010
        294 pages
        ISBN:9781605588230
        DOI:10.1145/1831708

        Copyright © 2010 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 12 July 2010

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate58of213submissions,27%

        Upcoming Conference

        ISSTA '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader