Hansei: property-based development of concurrent systems

  • Authors:
  • Joseph Blomstedt

  • Affiliations:
  • Basho Technologies, Seattle, WA, USA

  • Venue:
  • Proceedings of the eleventh ACM SIGPLAN workshop on Erlang workshop
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Avoiding concurrency errors remains one of the main challenges in day-to-day Erlang development. Errors can arise both from unexpected process and message interleaving, as well as concurrent clients or users interacting with the system in an unanticipated manner. To address this issue, many testing tools have been developed over the years. One approach is to pair a property-based testing tool with a tool that overrides the Erlang scheduler. This allows developers to focus on defining the properties of their system, and let the testing tools worry about testing these properties across different interleavings. This paper builds upon this approach and presents the Hansei testing framework. Hansei provides an approach to writing property-based tests that build on standard OTP abstractions, as well as a testing infrastructure designed to support test-driven development of concurrent systems. The Hansei infrastructure builds on the existing QuickCheck property-based testing tool, and supports both built-in message interleaving as well as a testing mode that works with existing process interleaving tools. Existing tools are more mature and feature-complete, while the built-in Hansei support has the unique property of being able to operate on code that spans multiple Erlang VMs.