Demonic testing of concurrent programs

  • Authors:
  • Scott West;Sebastian Nanz;Bertrand Meyer

  • Affiliations:
  • ETH Zürich, Switzerland;ETH Zürich, Switzerland;ETH Zürich, Switzerland

  • Venue:
  • ICFEM'12 Proceedings of the 14th international conference on Formal Engineering Methods: formal methods and software engineering
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Testing presents a daunting challenge for concurrent programs, as non-deterministic scheduling defeats reproducibility. The problem is even harder if, rather than testing entire systems, one tries to test individual components, for example to assess them for thread-safety. We present demonic testing, a technique combining the tangible results of unit testing with the rigour of formal rely-guarantee reasoning to provide deterministic unit testing for concurrent programs. Deterministic execution is provided by abstracting threads away via rely-guarantee reasoning, and replacing them with "demonic" sequences of interfering instructions that drive the program to break invariants. Demonic testing reuses existing unit tests to drive the routine under test, using the execution to discover demonic interference. Programs carry contract-based rely-guarantee style specifications to express what sort of thread interference should be tolerated. Aiding the demonic testing technique is an interference synthesis tool we have implemented based on SMT solving. The technique is shown to find errors in contracted versions of several benchmark applications.