skip to main content
10.1145/3180155.3180248acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article
Public Access

Efficient sampling of SAT solutions for testing

Published:27 May 2018Publication History

ABSTRACT

In software and hardware testing, generating multiple inputs which satisfy a given set of constraints is an important problem with applications in fuzz testing and stimulus generation. However, it is a challenge to perform the sampling efficiently, while generating a diverse set of inputs which satisfy the constraints. We developed a new algorithm QuickSampler which requires a small number of solver calls to produce millions of samples which satisfy the constraints with high probability. We evaluate QuickSampler on large real-world benchmarks and show that it can produce unique valid solutions orders of magnitude faster than other state-of-the-art sampling tools, with a distribution which is reasonably close to uniform in practice.

References

  1. Saswat Anand and Mary Jean Harrold. 2011. Heap cloning: Enabling dynamic symbolic execution of java programs. In ASE. 33--42. 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. In TACAS'07. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Shay Artzi, Adam Kiezun, Julian Dolby, Frank Tip, Danny Dig, Amit Paradkar, and Michael D. Ernst. 2008. Finding bugs in dynamic web applications. In ISSTA'08. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Thanassis Avgerinos, Alexandre Rebert, Sang Kil Cha, and David Brumley. 2014. Enhancing Symbolic Execution with Veritesting. In Proceedings of the 36th International Conference on Software Engineering (ICSE 2014). ACM, New York, NY, USA, 1083--1094. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Nikolaj Bjørner, Anh-Dung Phan, and Lars Fleckenstein. 2015. vZ-An Optimizing SMT Solver.. In TACAS, Vol. 15. 194--199. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Marcel Böhme, Van-Thuan Pham, and Abhik Roychoudhury. 2016. Coverage-based greybox fuzzing as markov chain. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security. ACM, 1032--1043. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Jacob Burnim and Koushik Sen. 2008. Heuristics for Scalable Dynamic Test Generation. In ASE'08. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Cristian Cadar, Daniel Dunbar, and Dawson Engler. 2008. KLEE: Unassisted and Automatic Generation of High-Coverage Tests for Complex Systems Programs. In OSDI'08. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Supratik Chakraborty, Daniel J Fremont, Kuldeep S Meel, Sanjit A Seshia, and Moshe Y Vardi. 2015. On Parallel Scalable Uniform SAT Witness Generation.. In TACAS. 304--319. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Supratik Chakraborty, Kuldeep S Meel, and Moshe Y Vardi. 2013. A scalable approximate model counter. In International Conference on Principles and Practice of Constraint Programming. Springer, 200--216.Google ScholarGoogle ScholarCross RefCross Ref
  11. Supratik Chakraborty, Kuldeep S Meel, and Moshe Y Vardi. 2014. Balancing scalability and uniformity in SAT witness generator. In Design Automation Conference (DAC), 2014 51st ACM/EDAC/IEEE. IEEE, 1--6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Vitaly Chipounov, Volodymyr Kuznetsov, and George Candea. 2012. The S2E Platform: Design, Implementation, and Applications. ACM Trans. Comput. Syst. 30, 1 (2012), 2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Lori A. Clarke. 1976. A program testing system. In Proc. of the 1976 annual conference. 488--491. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An efficient SMT solver. Tools and Algorithms for the Construction and Analysis of Systems (2008), 337--340. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Stefano Ermon, Carla P Gomes, Ashish Sabharwal, and Bart Selman. 2013. Embed and project: Discrete sampling with universal hashing. In Advances in Neural Information Processing Systems. 2085--2093. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Stefano Ermon, Carla P Gomes, and Bart Selman. 2012. Uniform solution sampling using a constraint solver as an oracle. Conference on Uncertainty in Artificial Intelligence (2012). Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Gordon Fraser and Andrea Arcuri. 2011. EvoSuite: automatic test suite generation for object-oriented software. In Proceedings of the 19th ACM SIGSOFT Symposium and the 13th European Conference on Foundations of Software Engineering (ESEC/FSE '11). ACM, New York, NY, USA, 416--419. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. P. Godefroid, N. Klarlund, and K. Sen. 2005. DART: Directed Automated Random Testing. In PLDI'05. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Godefroid, M.Y. Levin, and D. Molnar. 2008. Automated Whitebox Fuzz Testing. In NDSS'08.Google ScholarGoogle Scholar
  20. Carla P Gomes, Ashish Sabharwal, and Bart Selman. 2007. Near-uniform sampling of combinatorial spaces using XOR constraints. In Advances In Neural Information Processing Systems. 481--488. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Christian Holler, Kim Herzig, and Andreas Zeller. 2012. Fuzzing with Code Fragments. In Proceedings of the 21st USENIX Conference on Security Symposium (Security'12). USENIX Association, Berkeley, CA, USA, 38--38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Allen D. Householder and Jonathan M. Foote. 2012. Probability-Based Parameter Selection for Black-Box Fuzz Testing. Technical Report. Carnegie Mellon University Software Engineering Institute.Google ScholarGoogle Scholar
  23. Alexander Ivrii, Sharad Malik, Kuldeep S Meel, and Moshe Y Vardi. 2016. On computing minimal independent support and its applications to sampling and counting. Constraints 21, 1 (2016), 41--58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Karthick Jayaraman, David Harvison, Vijay Ganesh, and Adam Kiezun. 2009. jFuzz: A Concolic Whitebox Fuzzer for Java. In In NFM'09.Google ScholarGoogle Scholar
  25. James C.King. 1976. Symbolic execution and program testing. Commun. ACM 19 (July 1976), 385--394. Issue 7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Nathan Kitchen and Andreas Kuehlmann. 2007. Stimulus generation for constrained random simulation. In Computer-Aided Design, 2007. ICCAD 2007. IEEE/ACM International Conference on. IEEE, 258--265. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Nathan Boyd Kitchen. 2010. Markov Chain Monte Carlo Stimulus Generation for Constrained Random Simulation. University of California, Berkeley.Google ScholarGoogle Scholar
  28. Guodong Li, Indradeep Ghosh, and Sreeranga P. Rajan. 2011. KLOVER: A Symbolic Execution and Automatic Test Generation Tool for C++ Programs. In CAV. 609--615. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Kuldeep S Meel. 2014. Sampling techniques for boolean satisfiability. Master's thesis (2014).Google ScholarGoogle Scholar
  30. Kuldeep S Meel, Moshe Y Vardi, Supratik Chakraborty, Daniel J Fremont, Sanjit A Seshia, Dror Fried, Alexander Ivrii, and Sharad Malik. 2016. Constrained Sampling and Counting: Universal Hashing Meets SAT Solving.. In AAAI Workshop: Beyond NP.Google ScholarGoogle Scholar
  31. Alexander Nadel. 2011. Generating Diverse Solutions in SAT.. In SAT. Springer, 287--301. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Reuven Naveh and Amit Metodi. 2013. Beyond feasibility: CP usage in constrained-random functional hardware verification. In International Conference on Principles and Practice of Constraint Programming. Springer, 823--831.Google ScholarGoogle ScholarCross RefCross Ref
  33. Yehuda Naveh, Michal Rimon, Itai Jaeger, Yoav Katz, Michael Vinov, Eitan s Marcu, and Gil Shurek. 2007. Constraint-based random stimuli generation for hardware verification. AI magazine 28, 3 (2007), 13.Google ScholarGoogle Scholar
  34. Carlos Pacheco, Shuvendu K. Lahiri, Michael D. Ernst, and Thomas Ball. 2007. Feedback-directed random test generation. In ICSE'07, Proceedings of the 29th International Conference on Software Engineering. Minneapolis, MN, USA, 75--84. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. C. Pasareanu, P. Mehlitz, D. Bushnell, K. Gundy-Burlet, M. Lowry, S. Person, and M. Pape. 2008. Combining Unit-level Symbolic Execution and System-level Concrete Execution for Testing NASA Software. In ISSTA'08. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Prateek Saxena, Devdatta Akhawe, Steve Hanna, Feng Mao, Stephen McCamant, and Dawn Song. 2010. A Symbolic Execution Framework for JavaScript. In Proceedings of the 2010 IEEE Symposium on Security and Privacy (SP '10). IEEE, 513--528. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Koushik Sen and Gul Agha. 2006. CUTE and jCUTE : Concolic Unit Testing and Explicit Path Model-Checking Tools. In CAV'06. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Koushik Sen, Swaroop Kalasapur, Tasneem Brutch, and Simon Gibbs. 2013. Jalangi: A Selective Record-Replay and Dynamic Analysis Framework for JavaScript. In ESEC/FSE'13. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Koushik Sen, Darko Marinov, and Gul Agha. 2005. CUTE: A Concolic Unit Testing Engine for C. In ESEC/FSE'05. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Dawn Song, David Brumley, Heng Yin, Juan Caballero, Ivan Jager, Min Gyung Kang, Zhenkai Liang, James Newsome, Pongsin Poosankam, and Prateek Saxena. 2008. BitBlaze: A New Approach to Computer Security via Binary Analysis. In ICISS'08. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Marc Thurley. 2006. sharpSAT-counting models with advanced component caching and implicit BCP. SAT 4121 (2006), 424--429. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Nikolai Tillmann and Jonathan de Halleux. 2008. Pex - White Box Test Generation for .NET. In TAP'08. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Wei Wei, Jordan Erenrich, and Bart Selman. 2004. Towards efficient sampling: Exploiting random walk strategies. In AAAI, Vol. 4. 670--676. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Wei Wei and Bart Selman. 2005. A new approach to model counting. In SAT. Springer, 324--339. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. 2011. Finding and Understanding Bugs in C Compilers. In Proceedings of the 32Nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '11). ACM, New York, NY, USA, 283--294. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. MichaÅĆ Zalewski. {n. d.}. American Fuzzy Lop. http://lcamtuf.coredump.cx/afl. ({n. d.}). Accessed October 1, 2016.Google ScholarGoogle Scholar
  47. Yanni Zhao, Jinian Bian, Shujun Deng, and Zhiqiu Kong. 2009. Random stimulus generation with self-tuning. In Computer Supported Cooperative Work in Design, 2009. CSCWD 2009. 13th International Conference on. IEEE, 62--65. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Efficient sampling of SAT solutions for testing

        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
          ICSE '18: Proceedings of the 40th International Conference on Software Engineering
          May 2018
          1307 pages
          ISBN:9781450356381
          DOI:10.1145/3180155
          • Conference Chair:
          • Michel Chaudron,
          • General Chair:
          • Ivica Crnkovic,
          • Program Chairs:
          • Marsha Chechik,
          • Mark Harman

          Copyright © 2018 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 the author(s) 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: 27 May 2018

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate276of1,856submissions,15%

          Upcoming Conference

          ICSE 2025

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader