skip to main content
research-article
Open Access

A solver-aided language for test input generation

Published:12 October 2017Publication History
Skip Abstract Section

Abstract

Developing a small but useful set of inputs for tests is challenging. We show that a domain-specific language backed by a constraint solver can help the programmer with this process. The solver can generate a set of test inputs and guarantee that each input is different from other inputs in a way that is useful for testing.

This paper presents Iorek: a tool that empowers the programmer with the ability to express to any SMT solver what it means for inputs to be different. The core of Iorek is a rich language for constraining the set of inputs, which includes a novel bounded enumeration mechanism that makes it easy to define and encode a flexible notion of difference over a recursive structure. We demonstrate the flexibility of this mechanism for generating strings.

We use Iorek to test real services and find that it is effective at finding bugs. We also build Iorek into a random testing tool and show that it increases coverage.

References

  1. Saswat Anand, Corina S. Păsăreanu, and Willem Visser. 2006. Symbolic Execution with Abstract Subsumption Checking (SPIN). Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Saswat Anand, Corina S. Păsăreanu, and Willem Visser. 2007. JPF-SE: A Symbolic Execution Extension to Java PathFinder (TACAS).Google ScholarGoogle Scholar
  3. Clark Barrett, Roberto Sebastiani, Sanjit A. Seshia, and Cesare Tinelli. 2008a. Handbook of Satisfiability. Chapter Satisfiability Modulo Theories, 127–149.Google ScholarGoogle Scholar
  4. Clark Barrett, Roberto Sebastiani, Sanjit A. Seshia, and Cesare Tinelli. 2008b. Handbook of Satisfiability. Chapter Satisfiability Modulo Theories, 737–797.Google ScholarGoogle Scholar
  5. Nikolaj Bjørner, Vijay Ganesh, Raphaël Michel, and Margus Veanes. 2012. An SMT-LIB format for sequences and regular expressions (SMT Workshop).Google ScholarGoogle Scholar
  6. Rastislav Bodik, Satish Chandra, Joel Galenson, Doug Kimelman, Nicholas Tung, Shaon Barman, and Casey Rodarmor. 2010. Programming with Angelic Nondeterminism (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. James Bornholt, Emina Torlak, Dan Grossman, and Luis Ceze. 2016. Optimizing Synthesis with Metasketches (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Chandrasekhar Boyapati, Sarfraz Khurshid, and Darko Marinov. 2002. Korat: Automated Testing Based on Java Predicates (ISSTA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Cristian Cadar, Vijay Ganesh, Peter M. Pawlowski, David L. Dill, and Dawson R. Engler. 2006. EXE: Automatically Generating Inputs of Death (CCS). Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jens R. Calamé, Natalia Ioustinova, and Jaco van de Pol. 2007. Automatic Model-Based Generation of Parameterized Test Cases Using Data Abstraction. ENTCS 191 (2007), 25–48. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Vitaly Chipounov, Volodymyr Kuznetsov, and George Candea. 2011. S2E: A Platform for In-vivo Multi-path Analysis of Software Systems (Proceedings of the Sixteenth International Conference on Architectural Support for Programming Languages and Operating Systems).Google ScholarGoogle Scholar
  12. Koen Claessen and John Hughes. 2000. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs (ICFP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Brett Daniel, Danny Dig, Kely Garcia, and Darko Marinov. 2007. Automated Testing of Refactoring Engines (ESEC-FSE). Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Jeremy Dick and Alain Faivre. 1993. Automating the generation and sequencing of test cases from model-based specifications (International Symposium of Formal Methods Europe).Google ScholarGoogle Scholar
  15. Gordon Fraser and Andrea Arcuri. 2011. EvoSuite: automatic test suite generation for object-oriented software (ESEC/FSE). Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Patrice Godefroid, Adam Kiezun, and Michael Y. Levin. 2008. Grammar-based Whitebox Fuzzing (PLDI). Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Patrice Godefroid, Nils Klarlund, and Koushik Sen. 2005. DART: Directed Automated Random Testing (PLDI). Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Patrice Godefroid, Michael Y Levin, and David A Molnar. 2008. Automated Whitebox Fuzz Testing (NDSS).Google ScholarGoogle Scholar
  19. John B. Goodenough and Susan L. Gerhart. 1975. Toward a Theory of Test Data Selection. In Proceedings of the International Conference on Reliable Software. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Sumit Gulwani. 2012. Synthesis from examples: Interaction models and algorithms (SYNASC).Google ScholarGoogle Scholar
  21. Susmit Jha and Sanjit A. Seshia. 2014. Are there good mistakes? A theoretical analysis of CEGIS (3rd Workshop on Synthesis (SYNT)).Google ScholarGoogle Scholar
  22. Brittany Johnson, Yoonki Song, Emerson Murphy-Hill, and Robert Bowdidge. 2013. Why Don’t Software Developers Use Static Analysis Tools to Find Bugs? (ICSE). Google ScholarGoogle ScholarCross RefCross Ref
  23. Sarfraz Khurshid and Darko Marinov. 2004. TestEra: Specification-Based Testing of Java Programs Using SAT. ASE (2004).Google ScholarGoogle Scholar
  24. Ali Sinan Köksal, Viktor Kuncak, and Philippe Suter. 2012. Constraints As Control (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ivan Kuraj, Viktor Kuncak, and Daniel Jackson. 2015. Programming with Enumerable Sets of Structures (OOPSLA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Leonidas Lampropoulos, Diane Gallois-Wong, Cătălin Hriţcu, John Hughes, Benjamin C. Pierce, and Li-yao Xia. 2017. Beginner’s Luck: A Language for Property-based Generators (POPL).Google ScholarGoogle Scholar
  27. Nuo Li, Tao Xie, Nikolai Tillmann, Jonathan de Halleux, and Wolfram Schulte. 2009. Reggae: Automated Test Generation for Programs Using Complex Regular Expressions (ASE).Google ScholarGoogle Scholar
  28. Tianyi Liang, Andrew Reynolds, Cesare Tinelli, Clark Barrett, and Morgan Deters. 2014. A DPLL(T) Theory Solver for a Theory of Strings and Regular Expressions (CAV). Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Tim Mackinnon, Steve Freeman, and Philip Craig. 2001. Extreme Programming Examined. Chapter Endo-testing: Unit Testing with Mock Objects, 287–301.Google ScholarGoogle Scholar
  30. Phil McMinn, Muzammil Shahbaz, and Mark Stevenson. 2012. Search-Based Test Input Generation for String Data Types Using the Results of Web Queries (International Conference on Software Testing, Verification and Validation).Google ScholarGoogle Scholar
  31. Kuldeep S. Meel, Moshe Y. Vardi, Supratik Chakraborty, Daniel J. Fremont, Sanjit A. Seshia, Dror Fried, Alexander Ivrii, and Sharad Malik. 2015. Constrained Sampling and Counting: Universal Hashing Meets SAT Solving. CoRR (2015).Google ScholarGoogle Scholar
  32. Simeon Ntafos. 1998. On Random and Partition Testing (ISSTA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Carlos Pacheco and Michael D. Ernst. 2007. Randoop: Feedback-directed Random Testing for Java (OOPSLA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Pablo Ponzio, Nazareno Aguirre, Marcelo F. Frias, and Willem Visser. 2016. Field-exhaustive Testing (FSE). Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Nicolás Rosner, Valeria Bengolea, Pablo Ponzio, Shadi Abdul Khalek, Nazareno Aguirre, Marcelo F. Frias, and Sarfraz Khurshid. 2014. Bounded Exhaustive Test Input Generation from Hybrid Invariants (OOPSLA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Hesam Samimi, Rebecca Hicks, Ari Fogel, and Todd Millstein. 2013. Declarative Mocking (ISSTA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Koushik Sen, Darko Marinov, and Gul Agha. 2005. CUTE: A Concolic Unit Testing Engine for C (ESEC/FSE). Google ScholarGoogle ScholarCross RefCross Ref
  38. Valerio Senni and Fabio Fioravanti. 2012. Generation of Test Data Structures Using Constraint Logic Programming (TAP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Ali Shahbazi and James Miller. 2016. Black-Box String Test Case Generation Through a Multi-Objective Optimization. IEEE Transactions on Software Engineering (2016), 361–378. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Armando Solar Lezama. 2008. Program Synthesis By Sketching. Ph.D. Dissertation. EECS Department, University of California, Berkeley.Google ScholarGoogle Scholar
  41. Nikolai Tillmann and Jonathan De Halleux. 2008. Pex–white box test generation for. net (TAP). Google ScholarGoogle ScholarCross RefCross Ref
  42. Emina Torlak and Rastislav Bodik. 2013. Growing Solver-aided Languages with Rosette (Onward!). Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Emina Torlak and Daniel Jackson. 2007. Kodkod: A Relational Model Finder (TACAS).Google ScholarGoogle Scholar
  44. Minh-Thai Trinh, Duc-Hiep Chu, and Joxan Jaffar. 2014. S3: A Symbolic String Solver for Vulnerability Detection in Web Applications (CCS). Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Richard Uhler and Nirav Dave. 2013. Smten: Automatic Translation of High-level Symbolic Computations into SMT Queries (CAV).Google ScholarGoogle Scholar
  46. Yunhui Zheng, Xiangyu Zhang, and Vijay Ganesh. 2013. Z3-str: A Z3-based String Solver for Web Application Analysis (FSE).Google ScholarGoogle Scholar

Index Terms

  1. A solver-aided language for test input generation

        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

        Full Access

        • Published in

          cover image Proceedings of the ACM on Programming Languages
          Proceedings of the ACM on Programming Languages  Volume 1, Issue OOPSLA
          October 2017
          1786 pages
          EISSN:2475-1421
          DOI:10.1145/3152284
          Issue’s Table of Contents

          Copyright © 2017 Owner/Author

          This work is licensed under a Creative Commons Attribution International 4.0 License.

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 12 October 2017
          Published in pacmpl Volume 1, Issue OOPSLA

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader